summaryrefslogtreecommitdiff
path: root/src/shared/dbus-common.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-05-02 22:51:50 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-05-02 22:52:09 -0400
commit44a6b1b68029833893f6e9cee35aa27a974038f6 (patch)
tree170b79abd66a206598ac095156a6c4012d0583f4 /src/shared/dbus-common.h
parent2f79c10e9aef916efbcf29315eea8c25d0a50ac4 (diff)
Add __attribute__((const, pure, format)) in various places
I'm assuming that it's fine if a _const_ or _pure_ function calls assert. It is assumed that the assert won't trigger, and even if it does, it can only trigger on the first call with a given set of parameters, and we don't care if the compiler moves the order of calls.
Diffstat (limited to 'src/shared/dbus-common.h')
-rw-r--r--src/shared/dbus-common.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/shared/dbus-common.h b/src/shared/dbus-common.h
index 16fc14b8e4..9752f08c05 100644
--- a/src/shared/dbus-common.h
+++ b/src/shared/dbus-common.h
@@ -25,6 +25,8 @@
#include <inttypes.h>
#include <sys/types.h>
+#include "macro.h"
+
#ifndef DBUS_ERROR_UNKNOWN_OBJECT
#define DBUS_ERROR_UNKNOWN_OBJECT "org.freedesktop.DBus.Error.UnknownObject"
#endif
@@ -187,13 +189,13 @@ int bus_property_set_uint64(DBusMessageIter *i, const char *property, void *data
return 0; \
}
-const char *bus_errno_to_dbus(int error);
+const char *bus_errno_to_dbus(int error) _const_;
DBusMessage* bus_properties_changed_new(const char *path, const char *interface, const char *properties);
DBusMessage* bus_properties_changed_one_new(const char *path, const char *interface, const char *property);
-uint32_t bus_flags_to_events(DBusWatch *bus_watch);
-unsigned bus_events_to_flags(uint32_t events);
+uint32_t bus_flags_to_events(DBusWatch *bus_watch) _pure_;
+unsigned bus_events_to_flags(uint32_t events) _const_;
int bus_parse_strv(DBusMessage *m, char ***_l);
int bus_parse_strv_iter(DBusMessageIter *iter, char ***_l);