Skip to content

Compiler warnings about unsigned conversions or overflows #98

Description

@danielzgtg

There are warnings about unsigned conversions or overflows. They should either be fixed or silenced with static_cast.

home@daniel-desktop3:~/CLionProjects/AudioFile/build$ cmake ..
-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.3s)
-- Generating done (0.0s)
-- Build files have been written to: /home/home/CLionProjects/AudioFile/build
home@daniel-desktop3:~/CLionProjects/AudioFile/build$ make
[  0%] Built target AudioFile
[ 11%] Building CXX object examples/CMakeFiles/Example.dir/examples.cpp.o
[ 22%] Linking CXX executable Example
[ 22%] Built target Example
[ 33%] Building CXX object tests/CMakeFiles/Tests.dir/AiffLoadingTests.cpp.o
In file included from /home/home/CLionProjects/AudioFile/tests/AiffLoadingTests.cpp:4:
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static T AudioSampleConverter<T>::twentyFourBitIntToSample(int32_t) [with T = signed char; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:672:78:   required from ‘bool AudioFile<T>::decodeWaveFile(const std::vector<unsigned char>&) [with T = signed char]’
  672 |                 T sample = AudioSampleConverter<T>::twentyFourBitIntToSample (sampleAsInt);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:539:16:   required from ‘bool AudioFile<T>::loadFromMemory(const std::vector<unsigned char>&) [with T = signed char]’
  539 |         return decodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:526:16:   required from ‘bool AudioFile<T>::load(const std::string&) [with T = signed char; std::string = std::__cxx11::basic_string<char>]’
  526 |         return loadFromMemory (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/AiffLoadingTests.cpp:215:40:   required from ‘void DOCTEST_ANON_SUITE_22::test8Bit44100WithInteger(bool) [with T = signed char]’
  215 |         bool loadedOK = audioFile.load (projectBuildDirectory + "/test-audio/aiff_stereo_8bit_44100.aif");
      |                         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/AiffLoadingTests.cpp:237:41:   required from here
  237 |         test8Bit44100WithInteger<int8_t>();
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/home/CLionProjects/AudioFile/AudioFile.h:1403:51: warning: overflow in conversion from ‘SampleLimit’ to ‘signed char’ changes value from ‘SignedInt24_Min’ to ‘0’ [-Woverflow]
 1403 |             return static_cast<T> (clamp (sample, SignedInt24_Min, SignedInt24_Max));
      |                                                   ^~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:1403:68: warning: overflow in conversion from ‘SampleLimit’ to ‘signed char’ changes value from ‘SignedInt24_Max’ to ‘-1’ [-Woverflow]
 1403 |             return static_cast<T> (clamp (sample, SignedInt24_Min, SignedInt24_Max));
      |                                                                    ^~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static T AudioSampleConverter<T>::twentyFourBitIntToSample(int32_t) [with T = unsigned char; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:672:78:   required from ‘bool AudioFile<T>::decodeWaveFile(const std::vector<unsigned char>&) [with T = unsigned char]’
  672 |                 T sample = AudioSampleConverter<T>::twentyFourBitIntToSample (sampleAsInt);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:539:16:   required from ‘bool AudioFile<T>::loadFromMemory(const std::vector<unsigned char>&) [with T = unsigned char]’
  539 |         return decodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:526:16:   required from ‘bool AudioFile<T>::load(const std::string&) [with T = unsigned char; std::string = std::__cxx11::basic_string<char>]’
  526 |         return loadFromMemory (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/AiffLoadingTests.cpp:215:40:   required from ‘void DOCTEST_ANON_SUITE_22::test8Bit44100WithInteger(bool) [with T = unsigned char]’
  215 |         bool loadedOK = audioFile.load (projectBuildDirectory + "/test-audio/aiff_stereo_8bit_44100.aif");
      |                         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/AiffLoadingTests.cpp:238:42:   required from here
  238 |         test8Bit44100WithInteger<uint8_t>();
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/home/CLionProjects/AudioFile/AudioFile.h:1405:80: warning: unsigned conversion from ‘SampleLimit’ to ‘unsigned char’ changes value from ‘UnsignedInt24_Max’ to ‘255’ [-Woverflow]
 1405 |             return static_cast<T> (clamp (sample + 8388608, UnsignedInt24_Min, UnsignedInt24_Max));
      |                                                                                ^~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static T AudioSampleConverter<T>::thirtyTwoBitIntToSample(int32_t) [with T = unsigned char; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:688:79:   required from ‘bool AudioFile<T>::decodeWaveFile(const std::vector<unsigned char>&) [with T = unsigned char]’
  688 |                     sample = AudioSampleConverter<T>::thirtyTwoBitIntToSample (sampleAsInt);
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:539:16:   required from ‘bool AudioFile<T>::loadFromMemory(const std::vector<unsigned char>&) [with T = unsigned char]’
  539 |         return decodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:526:16:   required from ‘bool AudioFile<T>::load(const std::string&) [with T = unsigned char; std::string = std::__cxx11::basic_string<char>]’
  526 |         return loadFromMemory (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/AiffLoadingTests.cpp:215:40:   required from ‘void DOCTEST_ANON_SUITE_22::test8Bit44100WithInteger(bool) [with T = unsigned char]’
  215 |         bool loadedOK = audioFile.load (projectBuildDirectory + "/test-audio/aiff_stereo_8bit_44100.aif");
      |                         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/AiffLoadingTests.cpp:238:42:   required from here
  238 |         test8Bit44100WithInteger<uint8_t>();
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/home/CLionProjects/AudioFile/AudioFile.h:1356:84: warning: unsigned conversion from ‘long int’ to ‘unsigned char’ changes value from ‘4294967295’ to ‘255’ [-Woverflow]
 1356 |             return static_cast<T> (clamp (static_cast<T> (sample + 2147483648), 0, 4294967295));
      |                                                                                    ^~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static T AudioSampleConverter<T>::twentyFourBitIntToSample(int32_t) [with T = short int; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:672:78:   required from ‘bool AudioFile<T>::decodeWaveFile(const std::vector<unsigned char>&) [with T = short int]’
  672 |                 T sample = AudioSampleConverter<T>::twentyFourBitIntToSample (sampleAsInt);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:539:16:   required from ‘bool AudioFile<T>::loadFromMemory(const std::vector<unsigned char>&) [with T = short int]’
  539 |         return decodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:526:16:   required from ‘bool AudioFile<T>::load(const std::string&) [with T = short int; std::string = std::__cxx11::basic_string<char>]’
  526 |         return loadFromMemory (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/AiffLoadingTests.cpp:215:40:   required from ‘void DOCTEST_ANON_SUITE_22::test8Bit44100WithInteger(bool) [with T = short int]’
  215 |         bool loadedOK = audioFile.load (projectBuildDirectory + "/test-audio/aiff_stereo_8bit_44100.aif");
      |                         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/AiffLoadingTests.cpp:239:42:   required from here
  239 |         test8Bit44100WithInteger<int16_t>();
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/home/CLionProjects/AudioFile/AudioFile.h:1403:51: warning: overflow in conversion from ‘SampleLimit’ to ‘short int’ changes value from ‘SignedInt24_Min’ to ‘0’ [-Woverflow]
 1403 |             return static_cast<T> (clamp (sample, SignedInt24_Min, SignedInt24_Max));
      |                                                   ^~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:1403:68: warning: overflow in conversion from ‘SampleLimit’ to ‘short int’ changes value from ‘SignedInt24_Max’ to ‘-1’ [-Woverflow]
 1403 |             return static_cast<T> (clamp (sample, SignedInt24_Min, SignedInt24_Max));
      |                                                                    ^~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static T AudioSampleConverter<T>::twentyFourBitIntToSample(int32_t) [with T = short unsigned int; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:672:78:   required from ‘bool AudioFile<T>::decodeWaveFile(const std::vector<unsigned char>&) [with T = short unsigned int]’
  672 |                 T sample = AudioSampleConverter<T>::twentyFourBitIntToSample (sampleAsInt);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:539:16:   required from ‘bool AudioFile<T>::loadFromMemory(const std::vector<unsigned char>&) [with T = short unsigned int]’
  539 |         return decodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:526:16:   required from ‘bool AudioFile<T>::load(const std::string&) [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’
  526 |         return loadFromMemory (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/AiffLoadingTests.cpp:215:40:   required from ‘void DOCTEST_ANON_SUITE_22::test8Bit44100WithInteger(bool) [with T = short unsigned int]’
  215 |         bool loadedOK = audioFile.load (projectBuildDirectory + "/test-audio/aiff_stereo_8bit_44100.aif");
      |                         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/AiffLoadingTests.cpp:240:43:   required from here
  240 |         test8Bit44100WithInteger<uint16_t>();
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/home/CLionProjects/AudioFile/AudioFile.h:1405:80: warning: unsigned conversion from ‘SampleLimit’ to ‘short unsigned int’ changes value from ‘UnsignedInt24_Max’ to ‘65535’ [-Woverflow]
 1405 |             return static_cast<T> (clamp (sample + 8388608, UnsignedInt24_Min, UnsignedInt24_Max));
      |                                                                                ^~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static T AudioSampleConverter<T>::thirtyTwoBitIntToSample(int32_t) [with T = short unsigned int; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:688:79:   required from ‘bool AudioFile<T>::decodeWaveFile(const std::vector<unsigned char>&) [with T = short unsigned int]’
  688 |                     sample = AudioSampleConverter<T>::thirtyTwoBitIntToSample (sampleAsInt);
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:539:16:   required from ‘bool AudioFile<T>::loadFromMemory(const std::vector<unsigned char>&) [with T = short unsigned int]’
  539 |         return decodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:526:16:   required from ‘bool AudioFile<T>::load(const std::string&) [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’
  526 |         return loadFromMemory (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/AiffLoadingTests.cpp:215:40:   required from ‘void DOCTEST_ANON_SUITE_22::test8Bit44100WithInteger(bool) [with T = short unsigned int]’
  215 |         bool loadedOK = audioFile.load (projectBuildDirectory + "/test-audio/aiff_stereo_8bit_44100.aif");
      |                         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/AiffLoadingTests.cpp:240:43:   required from here
  240 |         test8Bit44100WithInteger<uint16_t>();
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/home/CLionProjects/AudioFile/AudioFile.h:1356:84: warning: unsigned conversion from ‘long int’ to ‘short unsigned int’ changes value from ‘4294967295’ to ‘65535’ [-Woverflow]
 1356 |             return static_cast<T> (clamp (static_cast<T> (sample + 2147483648), 0, 4294967295));
      |                                                                                    ^~~~~~~~~~
[ 44%] Building CXX object tests/CMakeFiles/Tests.dir/FileWritingTests.cpp.o
In file included from /home/home/CLionProjects/AudioFile/tests/FileWritingTests.cpp:5:
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static int16_t AudioSampleConverter<T>::sampleToSixteenBitInt(T) [with T = unsigned char; int16_t = short int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:967:86:   required from ‘bool AudioFile<T>::encodeWaveFile(std::vector<unsigned char>&) [with T = unsigned char]’
  967 |                 int16_t sampleAsInt = AudioSampleConverter<T>::sampleToSixteenBitInt (samples[channel][i]);
      |                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:897:16:   required from ‘bool AudioFile<T>::saveToMemory(std::vector<unsigned char>&, AudioFileFormat) [with T = unsigned char]’
  897 |         return encodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:888:16:   required from ‘bool AudioFile<T>::save(const std::string&, AudioFileFormat) [with T = unsigned char; std::string = std::__cxx11::basic_string<char>]’
  888 |         return saveToMemory (fileData, format) && writeDataToFile (fileData, filePath);
      |                ^~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/FileWritingTests.cpp:84:36:   required from ‘void writeTestAudioFile(int, int, int, AudioFileFormat) [with T = unsigned char]’
   84 |     bool OK = audioFileWriter.save (filePath, format);
      |               ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/FileWritingTests.cpp:191:57:   required from here
  191 |                             writeTestAudioFile<uint8_t> (channels, sampleRate, bitDepth, format);
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:1458:76: warning: unsigned conversion from ‘SampleLimit’ to ‘unsigned char’ changes value from ‘UnsignedInt16_Max’ to ‘255’ [-Woverflow]
 1458 |             return static_cast<int16_t> (clamp (sample, UnsignedInt16_Min, UnsignedInt16_Max) + SignedInt16_Min);
      |                                                                            ^~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static int32_t AudioSampleConverter<T>::sampleToTwentyFourBitInt(T) [with T = unsigned char; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:972:94:   required from ‘bool AudioFile<T>::encodeWaveFile(std::vector<unsigned char>&) [with T = unsigned char]’
  972 |                 int32_t sampleAsIntAgain = AudioSampleConverter<T>::sampleToTwentyFourBitInt (samples[channel][i]);
      |                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:897:16:   required from ‘bool AudioFile<T>::saveToMemory(std::vector<unsigned char>&, AudioFileFormat) [with T = unsigned char]’
  897 |         return encodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:888:16:   required from ‘bool AudioFile<T>::save(const std::string&, AudioFileFormat) [with T = unsigned char; std::string = std::__cxx11::basic_string<char>]’
  888 |         return saveToMemory (fileData, format) && writeDataToFile (fileData, filePath);
      |                ^~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/FileWritingTests.cpp:84:36:   required from ‘void writeTestAudioFile(int, int, int, AudioFileFormat) [with T = unsigned char]’
   84 |     bool OK = audioFileWriter.save (filePath, format);
      |               ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/FileWritingTests.cpp:191:57:   required from here
  191 |                             writeTestAudioFile<uint8_t> (channels, sampleRate, bitDepth, format);
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:1423:76: warning: unsigned conversion from ‘SampleLimit’ to ‘unsigned char’ changes value from ‘UnsignedInt24_Max’ to ‘255’ [-Woverflow]
 1423 |             return static_cast<int32_t> (clamp (sample, UnsignedInt24_Min, UnsignedInt24_Max) + SignedInt24_Min);
      |                                                                            ^~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static int32_t AudioSampleConverter<T>::sampleToThirtyTwoBitInt(T) [with T = unsigned char; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:1002:84:   required from ‘bool AudioFile<T>::encodeWaveFile(std::vector<unsigned char>&) [with T = unsigned char]’
 1002 |                     sampleAsInt = AudioSampleConverter<T>::sampleToThirtyTwoBitInt (samples[channel][i]);
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:897:16:   required from ‘bool AudioFile<T>::saveToMemory(std::vector<unsigned char>&, AudioFileFormat) [with T = unsigned char]’
  897 |         return encodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:888:16:   required from ‘bool AudioFile<T>::save(const std::string&, AudioFileFormat) [with T = unsigned char; std::string = std::__cxx11::basic_string<char>]’
  888 |         return saveToMemory (fileData, format) && writeDataToFile (fileData, filePath);
      |                ^~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/FileWritingTests.cpp:84:36:   required from ‘void writeTestAudioFile(int, int, int, AudioFileFormat) [with T = unsigned char]’
   84 |     bool OK = audioFileWriter.save (filePath, format);
      |               ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/FileWritingTests.cpp:191:57:   required from here
  191 |                             writeTestAudioFile<uint8_t> (channels, sampleRate, bitDepth, format);
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:1388:60: warning: unsigned conversion from ‘long int’ to ‘unsigned char’ changes value from ‘4294967295’ to ‘255’ [-Woverflow]
 1388 |             return static_cast<int32_t> (clamp (sample, 0, 4294967295) - 2147483648);
      |                                                            ^~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static T AudioSampleConverter<T>::twentyFourBitIntToSample(int32_t) [with T = unsigned char; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:672:78:   required from ‘bool AudioFile<T>::decodeWaveFile(const std::vector<unsigned char>&) [with T = unsigned char]’
  672 |                 T sample = AudioSampleConverter<T>::twentyFourBitIntToSample (sampleAsInt);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:539:16:   required from ‘bool AudioFile<T>::loadFromMemory(const std::vector<unsigned char>&) [with T = unsigned char]’
  539 |         return decodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:526:16:   required from ‘bool AudioFile<T>::load(const std::string&) [with T = unsigned char; std::string = std::__cxx11::basic_string<char>]’
  526 |         return loadFromMemory (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/FileWritingTests.cpp:93:30:   required from ‘void writeTestAudioFile(int, int, int, AudioFileFormat) [with T = unsigned char]’
   93 |         audioFileReader.load (filePath);
      |         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/FileWritingTests.cpp:191:57:   required from here
  191 |                             writeTestAudioFile<uint8_t> (channels, sampleRate, bitDepth, format);
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:1405:80: warning: unsigned conversion from ‘SampleLimit’ to ‘unsigned char’ changes value from ‘UnsignedInt24_Max’ to ‘255’ [-Woverflow]
 1405 |             return static_cast<T> (clamp (sample + 8388608, UnsignedInt24_Min, UnsignedInt24_Max));
      |                                                                                ^~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static T AudioSampleConverter<T>::thirtyTwoBitIntToSample(int32_t) [with T = unsigned char; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:688:79:   required from ‘bool AudioFile<T>::decodeWaveFile(const std::vector<unsigned char>&) [with T = unsigned char]’
  688 |                     sample = AudioSampleConverter<T>::thirtyTwoBitIntToSample (sampleAsInt);
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:539:16:   required from ‘bool AudioFile<T>::loadFromMemory(const std::vector<unsigned char>&) [with T = unsigned char]’
  539 |         return decodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:526:16:   required from ‘bool AudioFile<T>::load(const std::string&) [with T = unsigned char; std::string = std::__cxx11::basic_string<char>]’
  526 |         return loadFromMemory (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/FileWritingTests.cpp:93:30:   required from ‘void writeTestAudioFile(int, int, int, AudioFileFormat) [with T = unsigned char]’
   93 |         audioFileReader.load (filePath);
      |         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/FileWritingTests.cpp:191:57:   required from here
  191 |                             writeTestAudioFile<uint8_t> (channels, sampleRate, bitDepth, format);
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:1356:84: warning: unsigned conversion from ‘long int’ to ‘unsigned char’ changes value from ‘4294967295’ to ‘255’ [-Woverflow]
 1356 |             return static_cast<T> (clamp (static_cast<T> (sample + 2147483648), 0, 4294967295));
      |                                                                                    ^~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static int32_t AudioSampleConverter<T>::sampleToTwentyFourBitInt(T) [with T = short int; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:972:94:   required from ‘bool AudioFile<T>::encodeWaveFile(std::vector<unsigned char>&) [with T = short int]’
  972 |                 int32_t sampleAsIntAgain = AudioSampleConverter<T>::sampleToTwentyFourBitInt (samples[channel][i]);
      |                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:897:16:   required from ‘bool AudioFile<T>::saveToMemory(std::vector<unsigned char>&, AudioFileFormat) [with T = short int]’
  897 |         return encodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:888:16:   required from ‘bool AudioFile<T>::save(const std::string&, AudioFileFormat) [with T = short int; std::string = std::__cxx11::basic_string<char>]’
  888 |         return saveToMemory (fileData, format) && writeDataToFile (fileData, filePath);
      |                ^~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/FileWritingTests.cpp:84:36:   required from ‘void writeTestAudioFile(int, int, int, AudioFileFormat) [with T = short int]’
   84 |     bool OK = audioFileWriter.save (filePath, format);
      |               ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/FileWritingTests.cpp:193:57:   required from here
  193 |                             writeTestAudioFile<int16_t> (channels, sampleRate, bitDepth, format);
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:1421:57: warning: overflow in conversion from ‘SampleLimit’ to ‘short int’ changes value from ‘SignedInt24_Min’ to ‘0’ [-Woverflow]
 1421 |             return static_cast<int32_t> (clamp (sample, SignedInt24_Min, SignedInt24_Max));
      |                                                         ^~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:1421:74: warning: overflow in conversion from ‘SampleLimit’ to ‘short int’ changes value from ‘SignedInt24_Max’ to ‘-1’ [-Woverflow]
 1421 |             return static_cast<int32_t> (clamp (sample, SignedInt24_Min, SignedInt24_Max));
      |                                                                          ^~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static int32_t AudioSampleConverter<T>::sampleToThirtyTwoBitInt(T) [with T = short int; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:1002:84:   required from ‘bool AudioFile<T>::encodeWaveFile(std::vector<unsigned char>&) [with T = short int]’
 1002 |                     sampleAsInt = AudioSampleConverter<T>::sampleToThirtyTwoBitInt (samples[channel][i]);
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:897:16:   required from ‘bool AudioFile<T>::saveToMemory(std::vector<unsigned char>&, AudioFileFormat) [with T = short int]’
  897 |         return encodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:888:16:   required from ‘bool AudioFile<T>::save(const std::string&, AudioFileFormat) [with T = short int; std::string = std::__cxx11::basic_string<char>]’
  888 |         return saveToMemory (fileData, format) && writeDataToFile (fileData, filePath);
      |                ^~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/FileWritingTests.cpp:84:36:   required from ‘void writeTestAudioFile(int, int, int, AudioFileFormat) [with T = short int]’
   84 |     bool OK = audioFileWriter.save (filePath, format);
      |               ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/FileWritingTests.cpp:193:57:   required from here
  193 |                             writeTestAudioFile<int16_t> (channels, sampleRate, bitDepth, format);
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:1386:57: warning: overflow in conversion from ‘long long int’ to ‘short int’ changes value from ‘-2147483648’ to ‘0’ [-Woverflow]
 1386 |             return static_cast<int32_t> (clamp (sample, -2147483648LL, 2147483647LL));
      |                                                         ^~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:1386:72: warning: overflow in conversion from ‘long long int’ to ‘short int’ changes value from ‘2147483647’ to ‘-1’ [-Woverflow]
 1386 |             return static_cast<int32_t> (clamp (sample, -2147483648LL, 2147483647LL));
      |                                                                        ^~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static T AudioSampleConverter<T>::twentyFourBitIntToSample(int32_t) [with T = short int; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:672:78:   required from ‘bool AudioFile<T>::decodeWaveFile(const std::vector<unsigned char>&) [with T = short int]’
  672 |                 T sample = AudioSampleConverter<T>::twentyFourBitIntToSample (sampleAsInt);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:539:16:   required from ‘bool AudioFile<T>::loadFromMemory(const std::vector<unsigned char>&) [with T = short int]’
  539 |         return decodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:526:16:   required from ‘bool AudioFile<T>::load(const std::string&) [with T = short int; std::string = std::__cxx11::basic_string<char>]’
  526 |         return loadFromMemory (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/FileWritingTests.cpp:93:30:   required from ‘void writeTestAudioFile(int, int, int, AudioFileFormat) [with T = short int]’
   93 |         audioFileReader.load (filePath);
      |         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/FileWritingTests.cpp:193:57:   required from here
  193 |                             writeTestAudioFile<int16_t> (channels, sampleRate, bitDepth, format);
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:1403:51: warning: overflow in conversion from ‘SampleLimit’ to ‘short int’ changes value from ‘SignedInt24_Min’ to ‘0’ [-Woverflow]
 1403 |             return static_cast<T> (clamp (sample, SignedInt24_Min, SignedInt24_Max));
      |                                                   ^~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:1403:68: warning: overflow in conversion from ‘SampleLimit’ to ‘short int’ changes value from ‘SignedInt24_Max’ to ‘-1’ [-Woverflow]
 1403 |             return static_cast<T> (clamp (sample, SignedInt24_Min, SignedInt24_Max));
      |                                                                    ^~~~~~~~~~~~~~~
[ 55%] Building CXX object tests/CMakeFiles/Tests.dir/GeneralTests.cpp.o
In file included from /home/home/CLionProjects/AudioFile/tests/GeneralTests.cpp:5:
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static T AudioSampleConverter<T>::twentyFourBitIntToSample(int32_t) [with T = short int; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:672:78:   required from ‘bool AudioFile<T>::decodeWaveFile(const std::vector<unsigned char>&) [with T = short int]’
  672 |                 T sample = AudioSampleConverter<T>::twentyFourBitIntToSample (sampleAsInt);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:539:16:   required from ‘bool AudioFile<T>::loadFromMemory(const std::vector<unsigned char>&) [with T = short int]’
  539 |         return decodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:526:16:   required from ‘bool AudioFile<T>::load(const std::string&) [with T = short int; std::string = std::__cxx11::basic_string<char>]’
  526 |         return loadFromMemory (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/GeneralTests.cpp:104:16:   required from here
  104 |         a.load (filePath);
      |         ~~~~~~~^~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:1403:51: warning: overflow in conversion from ‘SampleLimit’ to ‘short int’ changes value from ‘SignedInt24_Min’ to ‘0’ [-Woverflow]
 1403 |             return static_cast<T> (clamp (sample, SignedInt24_Min, SignedInt24_Max));
      |                                                   ^~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:1403:68: warning: overflow in conversion from ‘SampleLimit’ to ‘short int’ changes value from ‘SignedInt24_Max’ to ‘-1’ [-Woverflow]
 1403 |             return static_cast<T> (clamp (sample, SignedInt24_Min, SignedInt24_Max));
      |                                                                    ^~~~~~~~~~~~~~~
[ 66%] Building CXX object tests/CMakeFiles/Tests.dir/SampleConversionTests.cpp.o
[ 77%] Building CXX object tests/CMakeFiles/Tests.dir/WavLoadingTests.cpp.o
In file included from /home/home/CLionProjects/AudioFile/tests/WavLoadingTests.cpp:4:
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static T AudioSampleConverter<T>::twentyFourBitIntToSample(int32_t) [with T = signed char; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:672:78:   required from ‘bool AudioFile<T>::decodeWaveFile(const std::vector<unsigned char>&) [with T = signed char]’
  672 |                 T sample = AudioSampleConverter<T>::twentyFourBitIntToSample (sampleAsInt);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:539:16:   required from ‘bool AudioFile<T>::loadFromMemory(const std::vector<unsigned char>&) [with T = signed char]’
  539 |         return decodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:526:16:   required from ‘bool AudioFile<T>::load(const std::string&) [with T = signed char; std::string = std::__cxx11::basic_string<char>]’
  526 |         return loadFromMemory (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/WavLoadingTests.cpp:296:40:   required from ‘void DOCTEST_ANON_SUITE_34::test8Bit44100WithInteger() [with T = signed char]’
  296 |         bool loadedOK = audioFile.load (projectBuildDirectory + "/test-audio/wav_stereo_8bit_44100.wav");
      |                         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/WavLoadingTests.cpp:317:41:   required from here
  317 |         test8Bit44100WithInteger<int8_t>();
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/home/CLionProjects/AudioFile/AudioFile.h:1403:51: warning: overflow in conversion from ‘SampleLimit’ to ‘signed char’ changes value from ‘SignedInt24_Min’ to ‘0’ [-Woverflow]
 1403 |             return static_cast<T> (clamp (sample, SignedInt24_Min, SignedInt24_Max));
      |                                                   ^~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:1403:68: warning: overflow in conversion from ‘SampleLimit’ to ‘signed char’ changes value from ‘SignedInt24_Max’ to ‘-1’ [-Woverflow]
 1403 |             return static_cast<T> (clamp (sample, SignedInt24_Min, SignedInt24_Max));
      |                                                                    ^~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static T AudioSampleConverter<T>::twentyFourBitIntToSample(int32_t) [with T = unsigned char; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:672:78:   required from ‘bool AudioFile<T>::decodeWaveFile(const std::vector<unsigned char>&) [with T = unsigned char]’
  672 |                 T sample = AudioSampleConverter<T>::twentyFourBitIntToSample (sampleAsInt);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:539:16:   required from ‘bool AudioFile<T>::loadFromMemory(const std::vector<unsigned char>&) [with T = unsigned char]’
  539 |         return decodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:526:16:   required from ‘bool AudioFile<T>::load(const std::string&) [with T = unsigned char; std::string = std::__cxx11::basic_string<char>]’
  526 |         return loadFromMemory (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/WavLoadingTests.cpp:296:40:   required from ‘void DOCTEST_ANON_SUITE_34::test8Bit44100WithInteger() [with T = unsigned char]’
  296 |         bool loadedOK = audioFile.load (projectBuildDirectory + "/test-audio/wav_stereo_8bit_44100.wav");
      |                         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/WavLoadingTests.cpp:318:42:   required from here
  318 |         test8Bit44100WithInteger<uint8_t>();
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/home/CLionProjects/AudioFile/AudioFile.h:1405:80: warning: unsigned conversion from ‘SampleLimit’ to ‘unsigned char’ changes value from ‘UnsignedInt24_Max’ to ‘255’ [-Woverflow]
 1405 |             return static_cast<T> (clamp (sample + 8388608, UnsignedInt24_Min, UnsignedInt24_Max));
      |                                                                                ^~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static T AudioSampleConverter<T>::thirtyTwoBitIntToSample(int32_t) [with T = unsigned char; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:688:79:   required from ‘bool AudioFile<T>::decodeWaveFile(const std::vector<unsigned char>&) [with T = unsigned char]’
  688 |                     sample = AudioSampleConverter<T>::thirtyTwoBitIntToSample (sampleAsInt);
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:539:16:   required from ‘bool AudioFile<T>::loadFromMemory(const std::vector<unsigned char>&) [with T = unsigned char]’
  539 |         return decodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:526:16:   required from ‘bool AudioFile<T>::load(const std::string&) [with T = unsigned char; std::string = std::__cxx11::basic_string<char>]’
  526 |         return loadFromMemory (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/WavLoadingTests.cpp:296:40:   required from ‘void DOCTEST_ANON_SUITE_34::test8Bit44100WithInteger() [with T = unsigned char]’
  296 |         bool loadedOK = audioFile.load (projectBuildDirectory + "/test-audio/wav_stereo_8bit_44100.wav");
      |                         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/WavLoadingTests.cpp:318:42:   required from here
  318 |         test8Bit44100WithInteger<uint8_t>();
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/home/CLionProjects/AudioFile/AudioFile.h:1356:84: warning: unsigned conversion from ‘long int’ to ‘unsigned char’ changes value from ‘4294967295’ to ‘255’ [-Woverflow]
 1356 |             return static_cast<T> (clamp (static_cast<T> (sample + 2147483648), 0, 4294967295));
      |                                                                                    ^~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static T AudioSampleConverter<T>::twentyFourBitIntToSample(int32_t) [with T = short int; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:672:78:   required from ‘bool AudioFile<T>::decodeWaveFile(const std::vector<unsigned char>&) [with T = short int]’
  672 |                 T sample = AudioSampleConverter<T>::twentyFourBitIntToSample (sampleAsInt);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:539:16:   required from ‘bool AudioFile<T>::loadFromMemory(const std::vector<unsigned char>&) [with T = short int]’
  539 |         return decodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:526:16:   required from ‘bool AudioFile<T>::load(const std::string&) [with T = short int; std::string = std::__cxx11::basic_string<char>]’
  526 |         return loadFromMemory (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/WavLoadingTests.cpp:296:40:   required from ‘void DOCTEST_ANON_SUITE_34::test8Bit44100WithInteger() [with T = short int]’
  296 |         bool loadedOK = audioFile.load (projectBuildDirectory + "/test-audio/wav_stereo_8bit_44100.wav");
      |                         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/WavLoadingTests.cpp:319:42:   required from here
  319 |         test8Bit44100WithInteger<int16_t>();
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/home/CLionProjects/AudioFile/AudioFile.h:1403:51: warning: overflow in conversion from ‘SampleLimit’ to ‘short int’ changes value from ‘SignedInt24_Min’ to ‘0’ [-Woverflow]
 1403 |             return static_cast<T> (clamp (sample, SignedInt24_Min, SignedInt24_Max));
      |                                                   ^~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:1403:68: warning: overflow in conversion from ‘SampleLimit’ to ‘short int’ changes value from ‘SignedInt24_Max’ to ‘-1’ [-Woverflow]
 1403 |             return static_cast<T> (clamp (sample, SignedInt24_Min, SignedInt24_Max));
      |                                                                    ^~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static T AudioSampleConverter<T>::twentyFourBitIntToSample(int32_t) [with T = short unsigned int; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:672:78:   required from ‘bool AudioFile<T>::decodeWaveFile(const std::vector<unsigned char>&) [with T = short unsigned int]’
  672 |                 T sample = AudioSampleConverter<T>::twentyFourBitIntToSample (sampleAsInt);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:539:16:   required from ‘bool AudioFile<T>::loadFromMemory(const std::vector<unsigned char>&) [with T = short unsigned int]’
  539 |         return decodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:526:16:   required from ‘bool AudioFile<T>::load(const std::string&) [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’
  526 |         return loadFromMemory (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/WavLoadingTests.cpp:296:40:   required from ‘void DOCTEST_ANON_SUITE_34::test8Bit44100WithInteger() [with T = short unsigned int]’
  296 |         bool loadedOK = audioFile.load (projectBuildDirectory + "/test-audio/wav_stereo_8bit_44100.wav");
      |                         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/WavLoadingTests.cpp:320:43:   required from here
  320 |         test8Bit44100WithInteger<uint16_t>();
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/home/CLionProjects/AudioFile/AudioFile.h:1405:80: warning: unsigned conversion from ‘SampleLimit’ to ‘short unsigned int’ changes value from ‘UnsignedInt24_Max’ to ‘65535’ [-Woverflow]
 1405 |             return static_cast<T> (clamp (sample + 8388608, UnsignedInt24_Min, UnsignedInt24_Max));
      |                                                                                ^~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h: In instantiation of ‘static T AudioSampleConverter<T>::thirtyTwoBitIntToSample(int32_t) [with T = short unsigned int; int32_t = int]’:
/home/home/CLionProjects/AudioFile/AudioFile.h:688:79:   required from ‘bool AudioFile<T>::decodeWaveFile(const std::vector<unsigned char>&) [with T = short unsigned int]’
  688 |                     sample = AudioSampleConverter<T>::thirtyTwoBitIntToSample (sampleAsInt);
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:539:16:   required from ‘bool AudioFile<T>::loadFromMemory(const std::vector<unsigned char>&) [with T = short unsigned int]’
  539 |         return decodeWaveFile (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/AudioFile.h:526:16:   required from ‘bool AudioFile<T>::load(const std::string&) [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’
  526 |         return loadFromMemory (fileData);
      |                ^~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/WavLoadingTests.cpp:296:40:   required from ‘void DOCTEST_ANON_SUITE_34::test8Bit44100WithInteger() [with T = short unsigned int]’
  296 |         bool loadedOK = audioFile.load (projectBuildDirectory + "/test-audio/wav_stereo_8bit_44100.wav");
      |                         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/home/CLionProjects/AudioFile/tests/WavLoadingTests.cpp:320:43:   required from here
  320 |         test8Bit44100WithInteger<uint16_t>();
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/home/CLionProjects/AudioFile/AudioFile.h:1356:84: warning: unsigned conversion from ‘long int’ to ‘short unsigned int’ changes value from ‘4294967295’ to ‘65535’ [-Woverflow]
 1356 |             return static_cast<T> (clamp (static_cast<T> (sample + 2147483648), 0, 4294967295));
      |                                                                                    ^~~~~~~~~~
[ 88%] Building CXX object tests/CMakeFiles/Tests.dir/main.cpp.o
[100%] Linking CXX executable Tests
[100%] Built target Tests
home@daniel-desktop3:~/CLionProjects/AudioFile/build$ 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions