diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2019-01-03 07:41:04 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2019-01-03 07:41:04 +0000 |
| commit | b917024aa1ac4cb0a40164132db3c6d2913157eb (patch) | |
| tree | 4424bef9f2ac9a3dab21c822836a1b5c79ffee47 /src/plugins/Input/mpeg | |
| parent | bef5a901922c002815d047d276e61ec0bf8c0f46 (diff) | |
| download | qmmp-b917024aa1ac4cb0a40164132db3c6d2913157eb.tar.gz qmmp-b917024aa1ac4cb0a40164132db3c6d2913157eb.tar.bz2 qmmp-b917024aa1ac4cb0a40164132db3c6d2913157eb.zip | |
fixed build with -Werror=zero-as-null-pointer-constant
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8572 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/mpeg')
| -rw-r--r-- | src/plugins/Input/mpeg/decoder_mad.cpp | 16 | ||||
| -rw-r--r-- | src/plugins/Input/mpeg/decoder_mad.h | 2 | ||||
| -rw-r--r-- | src/plugins/Input/mpeg/decoder_mpg123.cpp | 16 | ||||
| -rw-r--r-- | src/plugins/Input/mpeg/decodermpegfactory.cpp | 12 | ||||
| -rw-r--r-- | src/plugins/Input/mpeg/mpegmetadatamodel.cpp | 4 | ||||
| -rw-r--r-- | src/plugins/Input/mpeg/settingsdialog.h | 2 | ||||
| -rw-r--r-- | src/plugins/Input/mpeg/tagextractor.cpp | 2 |
7 files changed, 27 insertions, 27 deletions
diff --git a/src/plugins/Input/mpeg/decoder_mad.cpp b/src/plugins/Input/mpeg/decoder_mad.cpp index d7625fc70..4e984db58 100644 --- a/src/plugins/Input/mpeg/decoder_mad.cpp +++ b/src/plugins/Input/mpeg/decoder_mad.cpp @@ -41,7 +41,7 @@ DecoderMAD::DecoderMAD(QIODevice *i) : Decoder(i) m_bitrate = 0; m_freq = 0; m_len = 0; - m_input_buf = 0; + m_input_buf = nullptr; m_input_bytes = 0; m_skip_frames = 0; m_eof = false; @@ -56,7 +56,7 @@ DecoderMAD::~DecoderMAD() { qDebug("DecoderMAD: deleting input_buf"); delete [] m_input_buf; - m_input_buf = 0; + m_input_buf = nullptr; } } @@ -98,7 +98,7 @@ bool DecoderMAD::initialize() mad_stream_buffer(&m_stream, (unsigned char *) m_input_buf, m_input_bytes); m_stream.error = MAD_ERROR_BUFLEN; mad_frame_mute (&m_frame); - m_stream.next_frame = 0; + m_stream.next_frame = nullptr; m_stream.sync = 0; ChannelMap map; if(m_channels == 1) @@ -131,7 +131,7 @@ void DecoderMAD::deinit() if(m_xing.lame) { delete m_xing.lame; - m_xing.lame = 0; + m_xing.lame = nullptr; } } @@ -204,17 +204,17 @@ bool DecoderMAD::findXingHeader(struct mad_bitptr ptr, unsigned int bitlen) DecoderMAD::LameHeader* DecoderMAD::findLameHeader(mad_bitptr ptr, unsigned int bitlen) { if(bitlen < 272) - return 0; + return nullptr; if(mad_bit_read (&ptr, 32) != LAME_MAGIC) - return 0; + return nullptr; LameHeader header; mad_bit_skip (&ptr, 40); //version header.revision = mad_bit_read (&ptr, 4); if (header.revision == 15) - return 0; + return nullptr; mad_bit_skip(&ptr, 12); //VBR,Lowpass filter value header.peak = mad_bit_read(&ptr, 32) << 5; //Peak amplitude @@ -428,7 +428,7 @@ void DecoderMAD::seek(qint64 pos) m_stream.error = MAD_ERROR_BUFLEN; m_stream.sync = 0; m_input_bytes = 0; - m_stream.next_frame = 0; + m_stream.next_frame = nullptr; m_skip_frames = 2; m_skip_bytes = 0; m_play_bytes = -1; diff --git a/src/plugins/Input/mpeg/decoder_mad.h b/src/plugins/Input/mpeg/decoder_mad.h index 9768213a1..8980f1768 100644 --- a/src/plugins/Input/mpeg/decoder_mad.h +++ b/src/plugins/Input/mpeg/decoder_mad.h @@ -89,7 +89,7 @@ private: frames = 0; bytes = 0; scale = 0; - lame = 0; + lame = nullptr; } }; XingHeader m_xing; diff --git a/src/plugins/Input/mpeg/decoder_mpg123.cpp b/src/plugins/Input/mpeg/decoder_mpg123.cpp index 8c6c0cf27..9a1a5f18b 100644 --- a/src/plugins/Input/mpeg/decoder_mpg123.cpp +++ b/src/plugins/Input/mpeg/decoder_mpg123.cpp @@ -66,14 +66,14 @@ DecoderMPG123::DecoderMPG123(QIODevice *i) : Decoder(i) m_rate = 0; m_frame_info.bitrate = 0; m_mpg123_encoding = MPG123_ENC_SIGNED_16; - m_handle = 0; + m_handle = nullptr; m_errors = 0; } DecoderMPG123::~DecoderMPG123() { cleanup(m_handle); - m_handle = 0; + m_handle = nullptr; } bool DecoderMPG123::initialize() @@ -94,7 +94,7 @@ bool DecoderMPG123::initialize() } int channels = 0; - if(!(m_handle = mpg123_new(0, &err))) + if(!(m_handle = mpg123_new(nullptr, &err))) { qWarning("DecoderMPG123: basic setup goes wrong: %s", mpg123_plain_strerror(err)); return false; @@ -102,11 +102,11 @@ bool DecoderMPG123::initialize() mpg123_param (m_handle, MPG123_ADD_FLAGS, MPG123_SEEKBUFFER | MPG123_FUZZY, 0); - if((err = mpg123_replace_reader_handle(m_handle, mpg123_read_cb, mpg123_seek_cb, 0)) != MPG123_OK) + if((err = mpg123_replace_reader_handle(m_handle, mpg123_read_cb, mpg123_seek_cb, nullptr)) != MPG123_OK) { qWarning("DecoderMPG123: mpg123 error: %s", mpg123_plain_strerror(err)); cleanup(m_handle); - m_handle = 0; + m_handle = nullptr; return false; } setMPG123Format(MPG123_ENC_FLOAT_32); @@ -115,7 +115,7 @@ bool DecoderMPG123::initialize() { qWarning("DecoderMPG123: mpg123 error: %s", mpg123_plain_strerror(err)); cleanup(m_handle); - m_handle = 0; + m_handle = nullptr; return false; } @@ -123,7 +123,7 @@ bool DecoderMPG123::initialize() { qWarning("DecoderMPG123: mpg123 error: %s", mpg123_plain_strerror(err)); cleanup(m_handle); - m_handle = 0; + m_handle = nullptr; return false; } //check format @@ -131,7 +131,7 @@ bool DecoderMPG123::initialize() { cleanup(m_handle); qWarning("DecoderMPG123: bad encoding: 0x%x!\n", m_mpg123_encoding); - m_handle = 0; + m_handle = nullptr; return false; } diff --git a/src/plugins/Input/mpeg/decodermpegfactory.cpp b/src/plugins/Input/mpeg/decodermpegfactory.cpp index 0c1356262..a251fc750 100644 --- a/src/plugins/Input/mpeg/decodermpegfactory.cpp +++ b/src/plugins/Input/mpeg/decodermpegfactory.cpp @@ -136,7 +136,7 @@ bool DecoderMPEGFactory::canDecode(QIODevice *input) const if (decoderName != "mpg123") { mpg123_init(); - mpg123_handle *handle = mpg123_new(0, 0); + mpg123_handle *handle = mpg123_new(nullptr, nullptr); if (!handle) return false; if(mpg123_open_feed(handle) != MPG123_OK) @@ -151,7 +151,7 @@ bool DecoderMPEGFactory::canDecode(QIODevice *input) const return false; } size_t out_size = 0; - int ret = mpg123_decode(handle, (unsigned char*) buf, dataSize, 0, 0, &out_size); + int ret = mpg123_decode(handle, (unsigned char*) buf, dataSize, nullptr, 0, &out_size); mpg123_close(handle); mpg123_delete(handle); return ret == MPG123_DONE || ret == MPG123_NEW_FORMAT; @@ -175,7 +175,7 @@ DecoderProperties DecoderMPEGFactory::properties() const Decoder *DecoderMPEGFactory::create(const QString &, QIODevice *input) { - Decoder *d = 0; + Decoder *d = nullptr; #if defined(WITH_MAD) && defined(WITH_MPG123) QSettings settings(Qmmp::configFile(), QSettings::IniFormat); if(settings.value("MPEG/decoder", "mad").toString() == "mpg123") @@ -203,7 +203,7 @@ QList<TrackInfo *> DecoderMPEGFactory::createPlayList(const QString &path, Track if(parts == TrackInfo::NoParts) return QList<TrackInfo*>() << info; - TagLib::Tag *tag = 0; + TagLib::Tag *tag = nullptr; TagLib::FileStream stream(QStringToFileName(path), true); TagLib::MPEG::File fileRef(&stream, TagLib::ID3v2::FrameFactory::instance()); @@ -212,7 +212,7 @@ QList<TrackInfo *> DecoderMPEGFactory::createPlayList(const QString &path, Track QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("MPEG"); - QTextCodec *codec = 0; + QTextCodec *codec = nullptr; uint tag_array[3]; tag_array[0] = settings.value("tag_1", SettingsDialog::ID3v2).toInt(); @@ -324,7 +324,7 @@ QList<TrackInfo *> DecoderMPEGFactory::createPlayList(const QString &path, Track if(fileRef.ID3v2Tag() && !fileRef.ID3v2Tag()->isEmpty()) { TagLib::ID3v2::Tag *tag = fileRef.ID3v2Tag(); - TagLib::ID3v2::UserTextIdentificationFrame* frame = 0; + TagLib::ID3v2::UserTextIdentificationFrame *frame = nullptr; TagLib::ID3v2::FrameList frames = tag->frameList("TXXX"); for(TagLib::ID3v2::FrameList::Iterator it = frames.begin(); it != frames.end(); ++it) { diff --git a/src/plugins/Input/mpeg/mpegmetadatamodel.cpp b/src/plugins/Input/mpeg/mpegmetadatamodel.cpp index d4760ea88..a960a15a3 100644 --- a/src/plugins/Input/mpeg/mpegmetadatamodel.cpp +++ b/src/plugins/Input/mpeg/mpegmetadatamodel.cpp @@ -380,7 +380,7 @@ void MpegFileTagModel::setValue(Qmmp::MetaData key, const QString &value) bool MpegFileTagModel::exists() const { - return (m_tag != 0); + return (m_tag != nullptr); } void MpegFileTagModel::create() @@ -397,7 +397,7 @@ void MpegFileTagModel::create() void MpegFileTagModel::remove() { - m_tag = 0; + m_tag = nullptr; } void MpegFileTagModel::save() diff --git a/src/plugins/Input/mpeg/settingsdialog.h b/src/plugins/Input/mpeg/settingsdialog.h index cdebaa15a..1a08d76f3 100644 --- a/src/plugins/Input/mpeg/settingsdialog.h +++ b/src/plugins/Input/mpeg/settingsdialog.h @@ -30,7 +30,7 @@ class SettingsDialog : public QDialog { Q_OBJECT public: - SettingsDialog(bool using_rusxmms, QWidget *parent = 0); + SettingsDialog(bool using_rusxmms, QWidget *parent = nullptr); ~SettingsDialog(); diff --git a/src/plugins/Input/mpeg/tagextractor.cpp b/src/plugins/Input/mpeg/tagextractor.cpp index 1e1557947..948b57f67 100644 --- a/src/plugins/Input/mpeg/tagextractor.cpp +++ b/src/plugins/Input/mpeg/tagextractor.cpp @@ -59,7 +59,7 @@ const QMap<Qmmp::MetaData, QString> TagExtractor::id3v2tag() settings.beginGroup("MPEG"); QByteArray name = settings.value("ID3v2_encoding","UTF-8").toByteArray (); bool utf = false; - QTextCodec *codec = 0; + QTextCodec *codec = nullptr; if (name.contains("UTF")) { codec = QTextCodec::codecForName ("UTF-8"); |
