Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mod_spandsp_dsp.c: resolve V.18 mode and v18_init compilation errors #2758

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vishalk17
Copy link

@vishalk17 vishalk17 commented Feb 1, 2025

================================
Commit that Introduced Compilation Error :

freeswitch/spandsp@d9681c3#diff-348092e97708aedff108326c3f98a9ea907ee9a58b5a780e508d5f08503475fb

================================

Resolve compilation errors in mod_spandsp_dsp.c caused by SpanDSP API updates:

  1. Mode Constants: Updated deprecated mode names (e.g., V18_MODE_5BIT_4545V18_MODE_WEITBRECHT_5BIT_4545).
  2. v18_init Calls: Added missing status_handler and status_handler_user_data arguments (set to NULL).

These changes align mod_spandsp_dsp.c with the SpanDSP library’s API defined in v18.h.

================================
Explanation :

- The mode constants in mod_spandsp_dsp.c (e.g., V18_MODE_5BIT_4545) are outdated. SpanDSP's v18.h uses newer names like V18_MODE_WEITBRECHT_5BIT_4545,

- The v18_init function now requires 8 arguments (as per v18.h), but the code only passes 6.Add two NULL arguments for the missing parameters (status_handler and status_handler_user_data).

================================
for ref. Errors were:

mod_spandsp_dsp.c: In function 'get_v18_mode':
mod_spandsp_dsp.c:159:17: error: 'V18_MODE_5BIT_4545' undeclared (first use in this function)
  159 |         int r = V18_MODE_5BIT_4545;
      |                 ^~~~~~~~~~~~~~~~~~
mod_spandsp_dsp.c:159:17: note: each undeclared identifier is reported only once for each function it appears in
mod_spandsp_dsp.c:165:29: error: 'V18_MODE_5BIT_50' undeclared (first use in this function)
  165 |                         r = V18_MODE_5BIT_50;
      |                             ^~~~~~~~~~~~~~~~
mod_spandsp_dsp.c: In function 'spandsp_tdd_send_session':
mod_spandsp_dsp.c:216:21: error: too few arguments to function 'v18_init'
  216 |         tdd_state = v18_init(NULL, TRUE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, NULL);
      |                     ^~~~~~~~
In file included from /usr/local/include/spandsp.h:114,
                 from mod_spandsp.h:50,
                 from mod_spandsp_dsp.c:36:
/usr/local/include/spandsp/v18.h:138:29: note: declared here
  138 | SPAN_DECLARE(v18_state_t *) v18_init(v18_state_t *s,
      |                             ^~~~~~~~
mod_spandsp_dsp.c: In function 'spandsp_tdd_encode_session':
mod_spandsp_dsp.c:263:26: error: too few arguments to function 'v18_init'
  263 |         pvt->tdd_state = v18_init(NULL, TRUE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, NULL);
      |                          ^~~~~~~~
/usr/local/include/spandsp/v18.h:138:29: note: declared here
  138 | SPAN_DECLARE(v18_state_t *) v18_init(v18_state_t *s,
      |                             ^~~~~~~~
mod_spandsp_dsp.c: In function 'spandsp_tdd_decode_session':
mod_spandsp_dsp.c:341:26: error: too few arguments to function 'v18_init'
  341 |         pvt->tdd_state = v18_init(NULL, FALSE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, pvt);
      |                          ^~~~~~~~
/usr/local/include/spandsp/v18.h:138:29: note: declared here
  138 | SPAN_DECLARE(v18_state_t *) v18_init(v18_state_t *s,
      |                             ^~~~~~~~
make[4]: *** [Makefile:772: mod_spandsp_la-mod_spandsp_dsp.lo] Error 1

--------------
Commit that Introduced Compilation Error :

freeswitch/spandsp@d9681c3#diff-348092e97708aedff108326c3f98a9ea907ee9a58b5a780e508d5f08503475fb

--------------
Resolve compilation errors in `mod_spandsp_dsp.c` caused by SpanDSP API updates:
1. **Mode Constants**: Updated deprecated mode names (e.g., `V18_MODE_5BIT_4545` → `V18_MODE_WEITBRECHT_5BIT_4545`).
2. **v18_init Calls**: Added missing `status_handler` and `status_handler_user_data` arguments (set to `NULL`).

These changes align mod_spandsp_dsp.c with the SpanDSP library’s API defined in v18.h.

---------------
Explanation :

    - The mode constants in mod_spandsp_dsp.c (e.g., V18_MODE_5BIT_4545) are outdated. SpanDSP's v18.h uses newer names like V18_MODE_WEITBRECHT_5BIT_4545,

    - The v18_init function now requires 8 arguments (as per v18.h), but the code only passes 6.Add two NULL arguments for the missing parameters (status_handler and status_handler_user_data).
-------------
for ref. Errors were:

mod_spandsp_dsp.c: In function 'get_v18_mode':
mod_spandsp_dsp.c:159:17: error: 'V18_MODE_5BIT_4545' undeclared (first use in this function)
  159 |         int r = V18_MODE_5BIT_4545;
      |                 ^~~~~~~~~~~~~~~~~~
mod_spandsp_dsp.c:159:17: note: each undeclared identifier is reported only once for each function it appears in
mod_spandsp_dsp.c:165:29: error: 'V18_MODE_5BIT_50' undeclared (first use in this function)
  165 |                         r = V18_MODE_5BIT_50;
      |                             ^~~~~~~~~~~~~~~~
mod_spandsp_dsp.c: In function 'spandsp_tdd_send_session':
mod_spandsp_dsp.c:216:21: error: too few arguments to function 'v18_init'
  216 |         tdd_state = v18_init(NULL, TRUE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, NULL);
      |                     ^~~~~~~~
In file included from /usr/local/include/spandsp.h:114,
                 from mod_spandsp.h:50,
                 from mod_spandsp_dsp.c:36:
/usr/local/include/spandsp/v18.h:138:29: note: declared here
  138 | SPAN_DECLARE(v18_state_t *) v18_init(v18_state_t *s,
      |                             ^~~~~~~~
mod_spandsp_dsp.c: In function 'spandsp_tdd_encode_session':
mod_spandsp_dsp.c:263:26: error: too few arguments to function 'v18_init'
  263 |         pvt->tdd_state = v18_init(NULL, TRUE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, NULL);
      |                          ^~~~~~~~
/usr/local/include/spandsp/v18.h:138:29: note: declared here
  138 | SPAN_DECLARE(v18_state_t *) v18_init(v18_state_t *s,
      |                             ^~~~~~~~
mod_spandsp_dsp.c: In function 'spandsp_tdd_decode_session':
mod_spandsp_dsp.c:341:26: error: too few arguments to function 'v18_init'
  341 |         pvt->tdd_state = v18_init(NULL, FALSE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, pvt);
      |                          ^~~~~~~~
/usr/local/include/spandsp/v18.h:138:29: note: declared here
  138 | SPAN_DECLARE(v18_state_t *) v18_init(v18_state_t *s,
      |                             ^~~~~~~~
make[4]: *** [Makefile:772: mod_spandsp_la-mod_spandsp_dsp.lo] Error 1
@azzbcc
Copy link
Contributor

azzbcc commented Feb 2, 2025

#2668

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants