X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Funit.h;h=fb158d511d398a7c36febc5fc67cf4c190f3f2d6;hb=8c6db8336536916d0476ff8233e0abf40a2f6aab;hp=3397d472cbf8b6cf873983b5fc1a741acc77a1ff;hpb=c952c6ece28b6c0f774f823c917f458fe3424993;p=elogind.git diff --git a/src/unit.h b/src/unit.h index 3397d472c..fb158d511 100644 --- a/src/unit.h +++ b/src/unit.h @@ -296,7 +296,7 @@ struct UnitVTable { void (*bus_query_pid_done)(Unit *u, const char *name, pid_t pid); /* Called for each message received on the bus */ - DBusHandlerResult (*bus_message_handler)(Unit *u, DBusMessage *message); + DBusHandlerResult (*bus_message_handler)(Unit *u, DBusConnection *c, DBusMessage *message); /* This is called for each unit type and should be used to * enumerate existing devices and load them. However, @@ -336,14 +336,14 @@ extern const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX]; /* For casting a unit into the various unit types */ #define DEFINE_CAST(UPPERCASE, MixedCase) \ static inline MixedCase* UPPERCASE(Unit *u) { \ - if (!u || u->meta.type != UNIT_##UPPERCASE) \ + if (_unlikely_(!u || u->meta.type != UNIT_##UPPERCASE)) \ return NULL; \ \ return (MixedCase*) u; \ } /* For casting the various unit types into a unit */ -#define UNIT(u) ((Unit*) (u)) +#define UNIT(u) ((Unit*) (&(u)->meta)) DEFINE_CAST(SOCKET, Socket); DEFINE_CAST(TIMER, Timer);