From: Andrei Emeltchenko Date: Tue, 10 Sep 2013 13:11:37 +0000 (+0300) Subject: codingstyle: Change __FUNCTION__ to __func__ X-Git-Tag: android-x86-4.4-r3~7645 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=c64fd37802d3609522d8121a21126ea797bf4e23;p=android-x86%2Fexternal-bluetooth-bluez.git codingstyle: Change __FUNCTION__ to __func__ The __func__ macro is part of the C99 standard whereas __FUNCTION__ is a legacy gcc specific alias for it: http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html Additionally, checkpatch.pl that's commonly used to verify coding style also recommends to use __func__ instead of __FUNCTION__. --- diff --git a/attrib/gattrib.c b/attrib/gattrib.c index c662acebe..609b908be 100644 --- a/attrib/gattrib.c +++ b/attrib/gattrib.c @@ -718,7 +718,7 @@ gboolean g_attrib_unregister(GAttrib *attrib, guint id) GSList *l; if (id == 0) { - warn("%s: invalid id", __FUNCTION__); + warn("%s: invalid id", __func__); return FALSE; } diff --git a/gobex/gobex-debug.h b/gobex/gobex-debug.h index 688466ef5..a98653d83 100644 --- a/gobex/gobex-debug.h +++ b/gobex/gobex-debug.h @@ -40,7 +40,7 @@ extern guint gobex_debug; #define g_obex_debug(level, format, ...) \ if (gobex_debug & level) \ g_log("gobex", G_LOG_LEVEL_DEBUG, "%s:%s() " format, __FILE__, \ - __FUNCTION__, ## __VA_ARGS__) + __func__, ## __VA_ARGS__) static inline void g_obex_dump(guint level, const char *prefix, const void *buf, gsize len) diff --git a/obexd/src/log.h b/obexd/src/log.h index 1bf1b058b..d9fb8678f 100644 --- a/obexd/src/log.h +++ b/obexd/src/log.h @@ -52,5 +52,5 @@ struct obex_debug_desc { .file = __FILE__, .flags = OBEX_DEBUG_FLAG_DEFAULT, \ }; \ if (__obex_debug_desc.flags & OBEX_DEBUG_FLAG_PRINT) \ - obex_debug("%s:%s() " fmt, __FILE__, __FUNCTION__ , ## arg); \ + obex_debug("%s:%s() " fmt, __FILE__, __func__ , ## arg); \ } while (0) diff --git a/src/log.h b/src/log.h index 3d34fa377..bf9eac2aa 100644 --- a/src/log.h +++ b/src/log.h @@ -55,5 +55,5 @@ void __btd_enable_debug(struct btd_debug_desc *start, .file = __FILE__, .flags = BTD_DEBUG_FLAG_DEFAULT, \ }; \ if (__btd_debug_desc.flags & BTD_DEBUG_FLAG_PRINT) \ - btd_debug("%s:%s() " fmt, __FILE__, __FUNCTION__ , ## arg); \ + btd_debug("%s:%s() " fmt, __FILE__, __func__ , ## arg); \ } while (0)