freeswitch / spandsp

SpanDSP is a low-level signal processing library that modulates and demodulates signals commonly used in telephony, such as the "noise" generated by a fax modem or DTMF touchpad.
Other
141 stars 117 forks source link

tone_detect.h: fix missing ')' for SPANDSP_USE_FIXED_POINT #75

Closed shr-project closed 3 months ago

shr-project commented 3 months ago
libtool: compile:  ccache arm-oe-linux-gnueabi-gcc -mthumb -mfpu=neon -mfloat-abi=softfp -mcpu=cortex-a9 -mtune=cortex-a9 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -funwind-tables -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/mach-oe-linux-gnueabi/lib32-spandsp/3.0.0+git/lib32-recipe-sysroot -DHAVE_CONFIG_H -I. -I../../git/src -I.. -DNDEBUG -Wunused-but-set-variable -std=gnu99 -ffast-math -Wall -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden -DHAVE_VISIBILITY=1 -O2 -pipe -g -feliminate-unused-debug-types -fcanon-prefix-map -fmacro-prefix-map=TOPDIR/BUILD/work/mach-oe-linux-gnueabi/lib32-spandsp/3.0.0+git/git=/usr/src/debug/lib32-spandsp/3.0.0+git -fdebug-prefix-map=TOPDIR/BUILD/work/mach-oe-linux-gnueabi/lib32-spandsp/3.0.0+git/git=/usr/src/debug/lib32-spandsp/3.0.0+git -fmacro-prefix-map=TOPDIR/BUILD/work/mach-oe-linux-gnueabi/lib32-spandsp/3.0.0+git/build=/usr/src/debug/lib32-spandsp/3.0.0+git -fdebug-prefix-map=TOPDIR/BUILD/work/mach-oe-linux-gnueabi/lib32-spandsp/3.0.0+git/build=/usr/src/debug/lib32-spandsp/3.0.0+git -fdebug-prefix-map=TOPDIR/BUILD/work/mach-oe-linux-gnueabi/lib32-spandsp/3.0.0+git/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/mach-oe-linux-gnueabi/lib32-spandsp/3.0.0+git/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/mach-oe-linux-gnueabi/lib32-spandsp/3.0.0+git/recipe-sysroot-native= -c ../../git/src/t38_terminal.c  -fPIC -DPIC -o .libs/t38_terminal.o ../../git/src/ademco_contactid.c:449:110: error: expected ')' before ';' token
  449 | static const int detection_threshold            = goertzel_threshold_dbm0(GOERTZEL_SAMPLES_PER_BLOCK, -42.0f);
      |                                                                                                              ^
In file included from ../../git/src/ademco_contactid.c:66:
../../git/src/spandsp/tone_detect.h:63:55: note: to match this '('
   63 | #define goertzel_threshold_dbm0(len,thresh)     (int) ((len*len*256.0*256.0/2.0*pow(10.0, (thresh - DBM0_MAX_SINE_POWER)/10.0))
      |                                                       ^
../../git/src/ademco_contactid.c:449:51: note: in expansion of macro 'goertzel_threshold_dbm0'
  449 | static const int detection_threshold            = goertzel_threshold_dbm0(GOERTZEL_SAMPLES_PER_BLOCK, -42.0f);
      |                                                   ^~~~~~~~~~~~~~~~~~~~~~~
../../git/src/ademco_contactid.c:449:18: warning: 'detection_threshold' defined but not used [-Wunused-const-variable=]
  449 | static const int detection_threshold            = goertzel_threshold_dbm0(GOERTZEL_SAMPLES_PER_BLOCK, -42.0f);
      |                  ^~~~~~~~~~~~~~~~~~~
../../git/src/ademco_contactid.c:210:35: warning: 'ademco_codes' defined but not used [-Wunused-const-variable=]
  210 | static const struct ademco_code_s ademco_codes[] =
      |                                   ^~~~~~~~~~~~
make[2]: *** [Makefile:1091: ademco_contactid.lo] Error 1
freeswitch-ci-system[bot] commented 3 months ago

Scan-build found bugs: https://public-artifacts.signalwire.cloud/drone/freeswitch/spandsp/72/index.html

shr-project commented 3 months ago

Scan-build found bugs: https://public-artifacts.signalwire.cloud/drone/freeswitch/spandsp/72/index.html

not related to this PR, I believe

shr-project commented 3 months ago

and the difference between arm and aarch64 build comes from AX_FIXED_POINT_MACHINE/ac_FixedPoint defined in m4/ax_fixed_point_machine.m4

-checking if aarch64-oe-linux-gnu is fixed point only... no -checking if aarch64-oe-linux-gnu fails on misaligned memory access... no +checking if arm-oemllib32-linux-gnueabi is fixed point only... yes +checking if arm-oemllib32-linux-gnueabi fails on misaligned memory access... yes

not sure if this is accurate, this was CI build for cortex-a9 (I'm not using spandsp for anything, it was failing in one of CI build which builds all packages available in OpenEmbedded).

shr-project commented 3 months ago

@coppice-git please check this

shr-project commented 3 months ago

https://github.com/freeswitch/spandsp/commit/4a73bd7ede87fd5028f0a12b01134b12ab9c3e50#diff-c4443226946a645f536f8d66a09fc11c8dae656fe2f31ea8f728a8e15c4379db