diff options
| author | Justus Winter <[email protected]> | 2016-05-10 11:03:34 +0000 | 
|---|---|---|
| committer | Justus Winter <[email protected]> | 2016-05-10 11:03:34 +0000 | 
| commit | f531608539b45f0bbd036f430943b390ec21aa65 (patch) | |
| tree | 56cf3f4db0c38e668645668ebb3dec418bed77a5 /src/debug.c | |
| parent | More GTK2 removal (diff) | |
| parent | Allow cc to detect missing cases in a switch. (diff) | |
| download | gpgme-f531608539b45f0bbd036f430943b390ec21aa65.tar.gz gpgme-f531608539b45f0bbd036f430943b390ec21aa65.zip | |
Merge branch 'master' into justus/pyme3
Diffstat (limited to 'src/debug.c')
| -rw-r--r-- | src/debug.c | 31 | 
1 files changed, 26 insertions, 5 deletions
| diff --git a/src/debug.c b/src/debug.c index ca0bb21a..1dd37234 100644 --- a/src/debug.c +++ b/src/debug.c @@ -46,6 +46,7 @@  #include "util.h"  #include "ath.h"  #include "sema.h" +#include "sys-util.h"  #include "debug.h" @@ -80,11 +81,12 @@ _gpgme_debug_frame_begin (void)  #endif  } -void _gpgme_debug_frame_end (void) +int _gpgme_debug_frame_end (void)  {  #ifdef FRAME_NR    frame_nr--;  #endif +  return 0;  } @@ -206,7 +208,16 @@ debug_init (void)    UNLOCK (debug_lock);    if (debug_level > 0) -    _gpgme_debug (DEBUG_INIT, "gpgme_debug: level=%d\n", debug_level); +    { +      _gpgme_debug (DEBUG_INIT, "gpgme_debug: level=%d\n", debug_level); +#ifdef HAVE_W32_SYSTEM +      { +        const char *name = _gpgme_get_inst_dir (); +        _gpgme_debug (DEBUG_INIT, "gpgme_debug: gpgme='%s'\n", +                      name? name: "?"); +      } +#endif +    }  } @@ -223,8 +234,17 @@ _gpgme_debug_subsystem_init (void) -/* Log the formatted string FORMAT at debug level LEVEL or higher.  */ -void +/* Log the formatted string FORMAT at debug level LEVEL or higher. + * + * Returns: 0 + * + * Note that we always return 0 because the old TRACE macro evaluated + * to 0 which issues a warning with newer gcc version about an unused + * values.  By using a return value of this function this can be + * avoided.  Fixme: It might be useful to check whether the return + * value from the TRACE macros are actually used somewhere. + */ +int  _gpgme_debug (int level, const char *format, ...)  {    va_list arg_ptr; @@ -232,7 +252,7 @@ _gpgme_debug (int level, const char *format, ...)    saved_errno = errno;    if (debug_level < level) -    return; +    return 0;    va_start (arg_ptr, format);    LOCK (debug_lock); @@ -273,6 +293,7 @@ _gpgme_debug (int level, const char *format, ...)    fflush (errfp);    gpg_err_set_errno (saved_errno); +  return 0;  } | 
