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

Make belle_sip_channel_set_public_ip_port() static. #12

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Ionic
Copy link

@Ionic Ionic commented Sep 8, 2020

There's no need to have belle_sip_channel_set_public_ip_port() non-static, so make it static instead.

It can easily be made API by removing the static keyword again and additionally adding it to the proper header file if needed later on.

Includes #11, so don't review/merge before the other. I'll rebase this PR as soon as #11 is merged.

The original code tried to map belle_sip_deb(...) (i.e., a variadic
macro) to bctbx_debug(...) (i.e., another variadic macro as the
replacement).

This didn't work for multiple reasons:
  - no code used belle_sip_deb(), but actually belle_sip_debug().
  - the target function has to be called with either a named variadic
    argument (e.g., "nameargs..." -> "nameargs") or, if it's
    unnamed/anonymous via the portable __VA_ARGS__ name/macro.

Rename it to belle_sip_debug and make it a non-variadic substitution to
bctbx_debug, since the usage is 1:1 currently.

If it stops being a 1:1 replacement in the future, it's easy to just
make it variadic again such as via:

  belle_sip_debug(args...) some_func(NULL, args)
(Still) disabled by default, of course.
Instead, let's just use the proper format specifier.

Since belle-sip already requires C99, it should always be available.
No functional change, of course.
…_contact_address_accurate().

It's static, so nothing other than the compilation unit is affected.
Nothing outside of the compilation unit uses it, so it should have been
static since its inception.

If it does turn out that it needs to be part of the API, we can still
make it non-static and export it in a header file.
@Ionic Ionic changed the title Make belle_sip_channel_set_public_ip_port() static. Make belle_sip_channel_set_public_ip_port() static. Sep 8, 2020
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.

1 participant