Fix issues reported by Clang Static Analyzer

Some deadcode.DeadStores.

On Debian 12:
CXXFLAGS=-I/usr/include/x86_64-linux-gnu/c++/12 \
cmake -DCMAKE_C_COMPILER=/usr/share/clang/scan-build-14/libexec/ccc-analyzer \
    -DCMAKE_CXX_COMPILER=/usr/share/clang/scan-build-14/libexec/c++-analyzer \
    -DBUILD_SHARED_LIBS=OFF \
    -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
    -DENABLE_CCACHE=ON -DBUILD_TESTING=ON -DBUILD_EXAMPLES=ON \
    -DCMAKE_BUILD_TYPE=Debug ../taglib
scan-build make
This commit is contained in:
Urs Fleisch
2023-12-02 11:44:00 +01:00
parent cf2bdce21d
commit 131918333b
12 changed files with 117 additions and 97 deletions

View File

@ -122,13 +122,13 @@ void Opus::Properties::read(File *file)
// *Input Sample Rate* (32 bits, unsigned, little endian)
d->inputSampleRate = data.toUInt(pos, false);
pos += 4;
// pos += 4;
// *Output Gain* (16 bits, signed, little endian)
pos += 2;
// pos += 2;
// *Channel Mapping Family* (8 bits, unsigned)
pos += 1;
// pos += 1;
const Ogg::PageHeader *first = file->firstPageHeader();
const Ogg::PageHeader *last = file->lastPageHeader();

View File

@ -141,8 +141,8 @@ void Speex::Properties::read(File *file)
// vbr; /**< 1 for a VBR encoding, 0 otherwise */
d->vbr = data.toUInt(pos, false) == 1;
pos += 4;
// pos += 4;
// frames_per_packet; /**< Number of frames stored per Ogg packet */
// unsigned int framesPerPacket = data.mid(pos, 4).toUInt(false);

View File

@ -145,7 +145,6 @@ void Vorbis::Properties::read(File *file)
pos += 4;
d->bitrateMinimum = data.toUInt(pos, false);
pos += 4;
// Find the length of the file. See http://wiki.xiph.org/VorbisStreamLength/
// for my notes on the topic.