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

Fix and improve debugging. #10

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

Commits on Sep 8, 2020

  1. Fix debug printing function: belle_sip_debug().

    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)
    Ionic committed Sep 8, 2020
    Configuration menu
    Copy the full SHA
    90bf82e View commit details
    Browse the repository at this point in the history
  2. Add handy switch to quickly enable debug mode.

    (Still) disabled by default, of course.
    Ionic committed Sep 8, 2020
    Configuration menu
    Copy the full SHA
    dc1caf8 View commit details
    Browse the repository at this point in the history
  3. Don't truncate timeout value to int in debug message.

    Instead, let's just use the proper format specifier.
    
    Since belle-sip already requires C99, it should always be available.
    Ionic committed Sep 8, 2020
    Configuration menu
    Copy the full SHA
    257fba4 View commit details
    Browse the repository at this point in the history