diff options
Diffstat (limited to 'dbus')
-rw-r--r-- | dbus/dbus-arch-deps.h.in | 8 | ||||
-rw-r--r-- | dbus/dbus-errors.c | 24 | ||||
-rw-r--r-- | dbus/dbus-errors.h | 2 | ||||
-rw-r--r-- | dbus/dbus-macros.h | 13 | ||||
-rw-r--r-- | dbus/dbus-marshal-validate.c | 12 | ||||
-rw-r--r-- | dbus/dbus-server-socket.c | 2 |
6 files changed, 49 insertions, 12 deletions
diff --git a/dbus/dbus-arch-deps.h.in b/dbus/dbus-arch-deps.h.in index 2a02a7f5..ca8e286b 100644 --- a/dbus/dbus-arch-deps.h.in +++ b/dbus/dbus-arch-deps.h.in @@ -33,11 +33,11 @@ DBUS_BEGIN_DECLS #if @DBUS_HAVE_INT64@ #define DBUS_HAVE_INT64 1 -typedef @DBUS_INT64_TYPE@ dbus_int64_t; -typedef unsigned @DBUS_INT64_TYPE@ dbus_uint64_t; +_DBUS_GNUC_EXTENSION typedef @DBUS_INT64_TYPE@ dbus_int64_t; +_DBUS_GNUC_EXTENSION typedef unsigned @DBUS_INT64_TYPE@ dbus_uint64_t; -#define DBUS_INT64_CONSTANT(val) @DBUS_INT64_CONSTANT@ -#define DBUS_UINT64_CONSTANT(val) @DBUS_UINT64_CONSTANT@ +#define DBUS_INT64_CONSTANT(val) (_DBUS_GNUC_EXTENSION @DBUS_INT64_CONSTANT@) +#define DBUS_UINT64_CONSTANT(val) (_DBUS_GNUC_EXTENSION @DBUS_UINT64_CONSTANT@) #else #undef DBUS_HAVE_INT64 diff --git a/dbus/dbus-errors.c b/dbus/dbus-errors.c index d0a80b02..9629c682 100644 --- a/dbus/dbus-errors.c +++ b/dbus/dbus-errors.c @@ -34,7 +34,29 @@ * @brief Error reporting internals * @{ */ - + +/** + * @def DBUS_ERROR_INIT + * + * Expands to a suitable initializer for a DBusError on the stack. + * Declaring a DBusError with: + * + * @code + * DBusError error = DBUS_ERROR_INIT; + * + * do_things_with (&error); + * @endcode + * + * is a more concise form of: + * + * @code + * DBusError error; + * + * dbus_error_init (&error); + * do_things_with (&error); + * @endcode + */ + /** * Internals of DBusError */ diff --git a/dbus/dbus-errors.h b/dbus/dbus-errors.h index e01818c4..0a480d8c 100644 --- a/dbus/dbus-errors.h +++ b/dbus/dbus-errors.h @@ -58,6 +58,8 @@ struct DBusError void *padding1; /**< placeholder */ }; +#define DBUS_ERROR_INIT { NULL, NULL, TRUE, 0, 0, 0, 0, NULL } + void dbus_error_init (DBusError *error); void dbus_error_free (DBusError *error); void dbus_set_error (DBusError *error, diff --git a/dbus/dbus-macros.h b/dbus/dbus-macros.h index 461dff39..bf004b8b 100644 --- a/dbus/dbus-macros.h +++ b/dbus/dbus-macros.h @@ -58,6 +58,12 @@ # define DBUS_DEPRECATED #endif +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8) +# define _DBUS_GNUC_EXTENSION __extension__ +#else +# define _DBUS_GNUC_EXTENSION +#endif + /* Normally docs are in .c files, but there isn't a .c file for this. */ /** * @defgroup DBusMacros Utility macros @@ -118,6 +124,13 @@ * Please don't use this in your own code, consider it * D-Bus internal. */ +/** + * @def _DBUS_GNUC_EXTENSION + * + * Tells gcc not to warn about extensions to the C standard in the + * following expression, even if compiling with -pedantic. Do not use + * this macro in your own code; please consider it to be internal to libdbus. + */ /** @} */ diff --git a/dbus/dbus-marshal-validate.c b/dbus/dbus-marshal-validate.c index 62d94556..e63a463b 100644 --- a/dbus/dbus-marshal-validate.c +++ b/dbus/dbus-marshal-validate.c @@ -1065,17 +1065,17 @@ _dbus_validate_signature (const DBusString *str, } /** define _dbus_check_is_valid_path() */ -DEFINE_DBUS_NAME_CHECK(path); +DEFINE_DBUS_NAME_CHECK(path) /** define _dbus_check_is_valid_interface() */ -DEFINE_DBUS_NAME_CHECK(interface); +DEFINE_DBUS_NAME_CHECK(interface) /** define _dbus_check_is_valid_member() */ -DEFINE_DBUS_NAME_CHECK(member); +DEFINE_DBUS_NAME_CHECK(member) /** define _dbus_check_is_valid_error_name() */ -DEFINE_DBUS_NAME_CHECK(error_name); +DEFINE_DBUS_NAME_CHECK(error_name) /** define _dbus_check_is_valid_bus_name() */ -DEFINE_DBUS_NAME_CHECK(bus_name); +DEFINE_DBUS_NAME_CHECK(bus_name) /** define _dbus_check_is_valid_signature() */ -DEFINE_DBUS_NAME_CHECK(signature); +DEFINE_DBUS_NAME_CHECK(signature) /** @} */ diff --git a/dbus/dbus-server-socket.c b/dbus/dbus-server-socket.c index c8ae38a7..0cd2bb6c 100644 --- a/dbus/dbus-server-socket.c +++ b/dbus/dbus-server-socket.c @@ -153,8 +153,8 @@ socket_handle_watch (DBusWatch *watch, void *data) { DBusServer *server = data; - DBusServerSocket *socket_server = data; #ifndef DBUS_DISABLE_ASSERT + DBusServerSocket *socket_server = data; int i; dbus_bool_t found = FALSE; #endif |