third_party_libsnd/tests
bobsayshilol 5ba69401c1
Fix pedantic warnings (#703)
* Fix warnings about incorrect format specifiers.
GCC only wants to see void pointers for %p formatters, so cast as appropriate.

* Fix a warning about an invalid enum value.
The following warning was observed when compiling with -pedantic:

    warning: ISO C restricts enumerator values to range of 'int' (2147483648 is too large)

The values of these enums don't escape wav_read_header() and are only used to set bits in a bitmask, so simply use the next bit rather than jumping to a huge number.

* Give anonymous unions a name.
This fixes the 'anonymous unions are a C11 extension' warning when compiling with -pedantic.

* Use flexible array members rather than zero sized arrays.
This flagged up the following warning when compiling with -pedantic:
    warning: zero size arrays are an extension [-Wzero-length-array]

* Safely return the smallest value of a short.
GCC gives the following warning when compiling with -pedantic:

    warning: overflow in conversion from 'int' to 'short int' changes value from '32768' to '-32768' [-Woverflow]

This looks intentional from the surrounding code, so return -32768 in a legal way rather than depending on undefined behaviour.

* Use the same min/max approach with all compilers.
The GCC specific code gives the following warning from GCC when compiled with -pedantic:

    warning: ISO C forbids braced-groups within expressions [-pedantic]

This code was also a fundamentally different way of calculating min/max since it didn't evaluate the inputs more than once, which meant there was potentially a difference in behaviour when the library was built with different compilers if the evaluation of 'a' or 'b' had side effects.
2021-02-14 10:16:33 +05:00
..
aiff_rw_test.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
alaw_test.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
benchmark-0.0.28 First snapshot of the public project. 2007-05-14 19:55:24 +10:00
benchmark-1.0.0 First snapshot of the public project. 2007-05-14 19:55:24 +10:00
benchmark-1.0.0rc2 First snapshot of the public project. 2007-05-14 19:55:24 +10:00
benchmark-1.0.6pre10-coltrane First snapshot of the public project. 2007-05-14 19:55:24 +10:00
benchmark-1.0.6pre10-miles First snapshot of the public project. 2007-05-14 19:55:24 +10:00
benchmark-1.0.18pre16-hendrix Add two benchmark results for current version. 2007-09-12 21:51:44 +10:00
benchmark-1.0.18pre16-mingus Add two benchmark results for current version. 2007-09-12 21:51:44 +10:00
benchmark-latest-coltrane First snapshot of the public project. 2007-05-14 19:55:24 +10:00
benchmark.def More whitespace and cstyle fixes. 2012-01-21 14:24:38 +11:00
benchmark.tpl More whitespace and cstyle fixes. 2012-01-21 14:24:38 +11:00
channel_test.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
checksum_test.c Fix MSAN errors 2017-05-04 18:42:24 +10:00
chunk_test.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
command_test.c Add BWF v2 loudness parameters 2019-08-27 07:28:25 +10:00
compression_size_test.c Opus file support 2019-02-20 19:30:30 +11:00
cpp_test.cc tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
cue_test.c Add support for more than 1000 cue points in WAV and AIFF files (#434) 2018-12-23 20:32:56 +11:00
dft_cmp.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
dft_cmp.h tests: Improvements to floating point tests 2015-10-19 12:41:50 +11:00
dither_test.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
dwvw_test.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
error_test.c Fix pedantic warnings (#703) 2021-02-14 10:16:33 +05:00
external_libs_test.c Opus file support 2019-02-20 19:30:30 +11:00
fix_this.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
floating_point_test.def tests/(floating_point|scale_clip)_test.def : Quote hex literals. 2014-06-30 18:32:14 +10:00
floating_point_test.tpl Fix int normalisation when reading in floats with the replacement reader (#702) 2021-02-14 09:45:07 +05:00
format_check_test.c Opus file support 2019-02-20 19:30:30 +11:00
generate.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
generate.h Update copyright dates. 2011-01-19 21:36:56 +11:00
header_test.def *.(def|tpl) : Remove arch-tag comments from end of files. 2007-06-09 21:40:30 +10:00
header_test.tpl tests/header_test.tpl: Fix a memory leak 2017-10-26 19:21:06 +11:00
headerless_test.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
largefile_test.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
locale_test.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
long_read_write_test.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
lossy_comp_test.c Opus file support 2019-02-20 19:30:30 +11:00
misc_test.c Fix warnings reported by Clang 10 2020-08-31 16:59:01 +05:00
multi_file_test.c tests/ : Fix all printf format warnings. 2012-02-18 12:59:32 +11:00
ogg_opus_test.c Opus file support 2019-02-20 19:30:30 +11:00
ogg_test.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
pcm_test.def tests/ : Fix undefined behaviour warnings. 2014-12-16 13:21:19 +11:00
pcm_test.tpl Fix Clang warnings 2020-09-04 10:03:09 +05:00
peak_chunk_test.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
pedantic-header-test.sh.in Move public headers to include directory 2020-08-26 11:59:26 +05:00
pipe_test.def *.(def|tpl) : Remove arch-tag comments from end of files. 2007-06-09 21:40:30 +10:00
pipe_test.tpl Make build system completely non-recursive 2017-09-26 19:35:56 +10:00
raw_test.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
rdwr_test.def tests/rdwr_test.(def|tpl) : Add new test program and hook into build. 2010-02-28 13:52:11 +11:00
rdwr_test.tpl Whitespace and cstyle fixes. 2012-01-20 22:46:13 +11:00
scale_clip_test.def tests/(floating_point|scale_clip)_test.def : Quote hex literals. 2014-06-30 18:32:14 +10:00
scale_clip_test.tpl tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
sftest.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
sfversion.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
stdin_test.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
stdio_test.c Make build system completely non-recursive 2017-09-26 19:35:56 +10:00
stdout_test.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
string_test.c Opus file support 2019-02-20 19:30:30 +11:00
test_wrapper.sh.in Opus file support 2019-02-20 19:30:30 +11:00
ulaw_test.c tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00
utils.def tests/utils.(def|tpl) : Add compare_XXX_or_die functions. 2007-12-14 20:41:33 +11:00
utils.tpl CMake: Fix MinGW with Clang compiler warnings 2020-08-31 09:30:42 +05:00
virtual_io_test.c tests/vrtual_io_test.c: Fix typo 2018-09-20 07:13:50 +10:00
win32_ordinal_test.c Remove redundant libsndfile.def.in 2017-10-31 18:42:40 +11:00
win32_test.c Fix a bunch of compiler warnings with gcc-4.6. 2011-03-28 18:43:05 +11:00
write_read_test.def tests/ : Add tests for 20 and 24 bit ALAC/CAF files. 2012-03-10 10:59:15 +11:00
write_read_test.tpl tests: Fixes for MSVC 2017-04-14 13:03:27 +10:00