From 208fc93aaa44df75da1df47332ac0e6f4d27af4a Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 18 Jan 2024 12:41:50 -0800 Subject: [PATCH] cppcheck: match function argument names Found with funcArgNamesDifferent Signed-off-by: Rosen Penev --- taglib/ape/apeitem.cpp | 4 ++-- taglib/asf/asfattribute.cpp | 36 +++++++++++++++---------------- taglib/dsdiff/dsdifffile.cpp | 4 ++-- taglib/flac/flacpicture.h | 14 ++++++------ taglib/mpeg/id3v1/id3v1genres.cpp | 6 +++--- taglib/mpeg/mpegfile.h | 16 +++++++------- taglib/tag.cpp | 4 ++-- taglib/toolkit/tfile.h | 4 ++-- taglib/toolkit/tfilestream.h | 4 ++-- 9 files changed, 46 insertions(+), 46 deletions(-) diff --git a/taglib/ape/apeitem.cpp b/taglib/ape/apeitem.cpp index 08d3b253..4e9adac7 100644 --- a/taglib/ape/apeitem.cpp +++ b/taglib/ape/apeitem.cpp @@ -141,10 +141,10 @@ void APE::Item::setValue(const String &value) d->value.clear(); } -void APE::Item::setValues(const StringList &value) +void APE::Item::setValues(const StringList &values) { d->type = Text; - d->text = value; + d->text = values; d->value.clear(); } diff --git a/taglib/asf/asfattribute.cpp b/taglib/asf/asfattribute.cpp index 76de2ff7..7e691e6a 100644 --- a/taglib/asf/asfattribute.cpp +++ b/taglib/asf/asfattribute.cpp @@ -162,30 +162,30 @@ ASF::Picture ASF::Attribute::toPicture() const return d->pictureValue; } -String ASF::Attribute::parse(ASF::File &f, int kind) +String ASF::Attribute::parse(ASF::File &file, int kind) { unsigned int size, nameLength; String name; d->pictureValue = Picture::fromInvalid(); // extended content descriptor if(kind == 0) { - nameLength = readWORD(&f); - name = readString(&f, nameLength); - d->type = static_cast(readWORD(&f)); - size = readWORD(&f); + nameLength = readWORD(&file); + name = readString(&file, nameLength); + d->type = static_cast(readWORD(&file)); + size = readWORD(&file); } // metadata & metadata library else { - int temp = readWORD(&f); + int temp = readWORD(&file); // metadata library if(kind == 2) { d->language = temp; } - d->stream = readWORD(&f); - nameLength = readWORD(&f); - d->type = static_cast(readWORD(&f)); - size = readDWORD(&f); - name = readString(&f, nameLength); + d->stream = readWORD(&file); + nameLength = readWORD(&file); + d->type = static_cast(readWORD(&file)); + size = readDWORD(&file); + name = readString(&file, nameLength); } if(kind != 2 && size > 65535) { @@ -194,33 +194,33 @@ String ASF::Attribute::parse(ASF::File &f, int kind) switch(d->type) { case WordType: - d->numericValue = readWORD(&f); + d->numericValue = readWORD(&file); break; case BoolType: if(kind == 0) { - d->numericValue = (readDWORD(&f) != 0); + d->numericValue = (readDWORD(&file) != 0); } else { - d->numericValue = (readWORD(&f) != 0); + d->numericValue = (readWORD(&file) != 0); } break; case DWordType: - d->numericValue = readDWORD(&f); + d->numericValue = readDWORD(&file); break; case QWordType: - d->numericValue = readQWORD(&f); + d->numericValue = readQWORD(&file); break; case UnicodeType: - d->stringValue = readString(&f, size); + d->stringValue = readString(&file, size); break; case BytesType: case GuidType: - d->byteVectorValue = f.readBlock(size); + d->byteVectorValue = file.readBlock(size); break; } diff --git a/taglib/dsdiff/dsdifffile.cpp b/taglib/dsdiff/dsdifffile.cpp index 6a5cf843..b3a265e4 100644 --- a/taglib/dsdiff/dsdifffile.cpp +++ b/taglib/dsdiff/dsdifffile.cpp @@ -189,9 +189,9 @@ PropertyMap DSDIFF::File::properties() const return d->tag.properties(); } -void DSDIFF::File::removeUnsupportedProperties(const StringList &unsupported) +void DSDIFF::File::removeUnsupportedProperties(const StringList &properties) { - d->tag.removeUnsupportedProperties(unsupported); + d->tag.removeUnsupportedProperties(properties); } PropertyMap DSDIFF::File::setProperties(const PropertyMap &properties) diff --git a/taglib/flac/flacpicture.h b/taglib/flac/flacpicture.h index c83867ee..93520621 100644 --- a/taglib/flac/flacpicture.h +++ b/taglib/flac/flacpicture.h @@ -72,7 +72,7 @@ namespace TagLib { * Sets the mime type of the image. This should in most cases be * "image/png" or "image/jpeg". */ - void setMimeType(const String &m); + void setMimeType(const String &mimeType); /*! * Returns a text description of the image. @@ -81,10 +81,10 @@ namespace TagLib { String description() const; /*! - * Sets a textual description of the image to \a desc. + * Sets a textual description of the image to \a description. */ - void setDescription(const String &desc); + void setDescription(const String &description); /*! * Returns the width of the image. @@ -94,7 +94,7 @@ namespace TagLib { /*! * Sets the width of the image. */ - void setWidth(int w); + void setWidth(int width); /*! * Returns the height of the image. @@ -104,7 +104,7 @@ namespace TagLib { /*! * Sets the height of the image. */ - void setHeight(int h); + void setHeight(int height); /*! * Returns the color depth (in bits-per-pixel) of the image. @@ -114,7 +114,7 @@ namespace TagLib { /*! * Sets the color depth (in bits-per-pixel) of the image. */ - void setColorDepth(int depth); + void setColorDepth(int colorDepth); /*! * Returns the number of colors used on the image.. @@ -149,7 +149,7 @@ namespace TagLib { /*! * Parse the picture data in the FLAC picture block format. */ - bool parse(const ByteVector &rawData); + bool parse(const ByteVector &data); private: class PicturePrivate; diff --git a/taglib/mpeg/id3v1/id3v1genres.cpp b/taglib/mpeg/id3v1/id3v1genres.cpp index f814401b..e479ccf1 100644 --- a/taglib/mpeg/id3v1/id3v1genres.cpp +++ b/taglib/mpeg/id3v1/id3v1genres.cpp @@ -247,10 +247,10 @@ ID3v1::GenreMap ID3v1::genreMap() return m; } -String ID3v1::genre(int i) +String ID3v1::genre(int index) { - if(i >= 0 && static_cast(i) < genres.size()) - return String(genres[i]); // always make a copy + if(index >= 0 && static_cast(index) < genres.size()) + return String(genres[index]); // always make a copy return String(); } diff --git a/taglib/mpeg/mpegfile.h b/taglib/mpeg/mpegfile.h index 3c3e62d2..bff35b4d 100644 --- a/taglib/mpeg/mpegfile.h +++ b/taglib/mpeg/mpegfile.h @@ -74,14 +74,14 @@ namespace TagLib { * Constructs an MPEG file from \a file. If \a readProperties is \c true the * file's audio properties will also be read. * - * If \a propertiesStyle is not Fast, the file will be scanned + * If \a readStyle is not Fast, the file will be scanned * completely if no ID3v2 tag or MPEG sync code is found at the start. * * If this file contains an ID3v2 tag, the frames will be created using * \a frameFactory (default if null). */ File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average, + Properties::ReadStyle readStyle = Properties::Average, ID3v2::FrameFactory *frameFactory = nullptr); /*! @@ -91,7 +91,7 @@ namespace TagLib { * If this file contains an ID3v2 tag, the frames will be created using * \a frameFactory. * - * If \a propertiesStyle is not Fast, the file will be scanned + * If \a readStyle is not Fast, the file will be scanned * completely if no ID3v2 tag or MPEG sync code is found at the start. * * \deprecated Use the constructor above. @@ -99,7 +99,7 @@ namespace TagLib { TAGLIB_DEPRECATED File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); + Properties::ReadStyle readStyle = Properties::Average); /*! * Constructs an MPEG file from \a stream. If \a readProperties is \c true the @@ -111,14 +111,14 @@ namespace TagLib { * If this file contains an ID3v2 tag, the frames will be created using * \a frameFactory. * - * If \a propertiesStyle is not Fast, the file will be scanned + * If \a readStyle is not Fast, the file will be scanned * completely if no ID3v2 tag or MPEG sync code is found at the start. * * If this file contains an ID3v2 tag, the frames will be created using * \a frameFactory (default if null). */ File(IOStream *stream, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average, + Properties::ReadStyle readStyle = Properties::Average, ID3v2::FrameFactory *frameFactory = nullptr); /*! @@ -131,7 +131,7 @@ namespace TagLib { * If this file contains an ID3v2 tag, the frames will be created using * \a frameFactory. * - * If \a propertiesStyle is not Fast, the file will be scanned + * If \a readStyle is not Fast, the file will be scanned * completely if no ID3v2 tag or MPEG sync code is found at the start. * * \deprecated Use the constructor above. @@ -139,7 +139,7 @@ namespace TagLib { TAGLIB_DEPRECATED File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); + Properties::ReadStyle readStyle = Properties::Average); /*! * Destroys this instance of the File. diff --git a/taglib/tag.cpp b/taglib/tag.cpp index 0826120a..a1e7e5ae 100644 --- a/taglib/tag.cpp +++ b/taglib/tag.cpp @@ -190,7 +190,7 @@ void Tag::duplicate(const Tag *source, Tag *target, bool overwrite) // static } } -String Tag::joinTagValues(const StringList &l) +String Tag::joinTagValues(const StringList &values) { - return l.toString(" / "); + return values.toString(" / "); } diff --git a/taglib/toolkit/tfile.h b/taglib/toolkit/tfile.h index 6d4eadb3..196e262a 100644 --- a/taglib/toolkit/tfile.h +++ b/taglib/toolkit/tfile.h @@ -281,13 +281,13 @@ namespace TagLib { protected: /*! - * Construct a File object and open the \a file. \a file should be a + * Construct a File object and open the \a fileName. \a fileName should be a * C-string in the local file system encoding. * * \note Constructor is protected since this class should only be * instantiated through subclasses. */ - File(FileName file); + File(FileName fileName); /*! * Construct a File object and use the \a stream instance. diff --git a/taglib/toolkit/tfilestream.h b/taglib/toolkit/tfilestream.h index e3d8d2ca..36e1d542 100644 --- a/taglib/toolkit/tfilestream.h +++ b/taglib/toolkit/tfilestream.h @@ -43,10 +43,10 @@ namespace TagLib { { public: /*! - * Construct a FileStream object and open the \a file. \a file should be a + * Construct a FileStream object and open the \a fileName. \a fileName should be a * C-string in the local file system encoding. */ - FileStream(FileName file, bool openReadOnly = false); + FileStream(FileName fileName, bool openReadOnly = false); /*! * Construct a FileStream object using an existing \a fileDescriptor.