From e8af5838573583baa198fc05d7bfcfd3c6cac994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Thu, 4 May 2023 16:26:31 +0200 Subject: dbus-internals: use `_DBUS_FUNCTION_NAME` in `_dbus_verbose()` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dbus-internals.h already defines a macro which expands to the name of the current function based on C standard version, etc. So use that instead of hard-coding `__FUNCTION__`. Signed-off-by: Barnabás Pőcze --- dbus/dbus-internals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbus/dbus-internals.h b/dbus/dbus-internals.h index 2387752d..4aef24ca 100644 --- a/dbus/dbus-internals.h +++ b/dbus/dbus-internals.h @@ -104,7 +104,7 @@ int _dbus_get_check_failed_count (void); DBUS_PRIVATE_EXPORT void _dbus_verbose_real (const char *file, const int line, const char *function, const char *format,...) _DBUS_GNUC_PRINTF (4, 5); -# define _dbus_verbose(fmt,...) _dbus_verbose_real( __FILE__,__LINE__,__FUNCTION__,fmt, ## __VA_ARGS__) +# define _dbus_verbose(fmt,...) _dbus_verbose_real( __FILE__,__LINE__,_DBUS_FUNCTION_NAME,fmt, ## __VA_ARGS__) #else DBUS_PRIVATE_EXPORT void _dbus_verbose_real (const char *format, -- cgit v1.2.1 From 0098e306026ba5d0d1c4e4d975c06e9016502dfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Thu, 4 May 2023 16:31:44 +0200 Subject: dbus-sysdeps-win: do not log function name twice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `_dbus_verbose()` already logs the function name, do not log it again in the message. Signed-off-by: Barnabás Pőcze --- dbus/dbus-sysdeps-win.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index 11064bb4..fa408328 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -1019,12 +1019,12 @@ _dbus_getsid(char **sid, dbus_pid_t process_id) psid = token_user->User.Sid; if (!IsValidSid (psid)) { - _dbus_verbose("%s invalid sid\n",__FUNCTION__); + _dbus_verbose("invalid sid\n"); goto failed; } if (!ConvertSidToStringSidA (psid, sid)) { - _dbus_verbose("%s invalid sid\n",__FUNCTION__); + _dbus_verbose("invalid sid\n"); goto failed; } //okay: -- cgit v1.2.1 From d42c42d999ecc0bfc3adfd684f1dc4b6960a4d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Thu, 4 May 2023 16:37:57 +0200 Subject: dbus-spawn-win: use `_DBUS_FUNCTION_NAME` instead of `__FUNCTION__` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dbus-internals.h already defines a macro which expands to the name of the current function based on C standard version, etc. So use that instead of hard-coding `__FUNCTION__`. Signed-off-by: Barnabás Pőcze --- dbus/dbus-spawn-win.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dbus/dbus-spawn-win.c b/dbus/dbus-spawn-win.c index 3b4bc052..5ad4fe5f 100644 --- a/dbus/dbus-spawn-win.c +++ b/dbus/dbus-spawn-win.c @@ -5,7 +5,7 @@ #if !defined(SPAWN_DEBUG) || defined(_MSC_VER) #define PING() #else -#define PING() fprintf (stderr, "%s:%s:%d\n", __FILE__, __FUNCTION__, __LINE__); fflush (stderr) +#define PING() fprintf (stderr, "%s:%s:%d\n", __FILE__, _DBUS_FUNCTION_NAME, __LINE__); fflush (stderr) #endif #include @@ -107,7 +107,7 @@ _dbus_babysitter_new (void) old_refcount = _dbus_atomic_inc (&sitter->refcount); - _dbus_babysitter_trace_ref (sitter, old_refcount, old_refcount+1, __FUNCTION__); + _dbus_babysitter_trace_ref (sitter, old_refcount, old_refcount+1, _DBUS_FUNCTION_NAME); sitter->child_handle = NULL; @@ -141,7 +141,7 @@ _dbus_babysitter_ref (DBusBabysitter *sitter) old_refcount = _dbus_atomic_inc (&sitter->refcount); _dbus_assert (old_refcount > 0); - _dbus_babysitter_trace_ref (sitter, old_refcount, old_refcount+1, __FUNCTION__); + _dbus_babysitter_trace_ref (sitter, old_refcount, old_refcount+1, _DBUS_FUNCTION_NAME); return sitter; } @@ -182,7 +182,7 @@ _dbus_babysitter_unref (DBusBabysitter *sitter) old_refcount = _dbus_atomic_dec (&sitter->refcount); _dbus_assert (old_refcount > 0); - _dbus_babysitter_trace_ref (sitter, old_refcount, old_refcount-1, __FUNCTION__); + _dbus_babysitter_trace_ref (sitter, old_refcount, old_refcount-1, _DBUS_FUNCTION_NAME); if (old_refcount == 1) { -- cgit v1.2.1