diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-04-11 02:07:14 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-04-11 23:10:40 +0200 |
commit | 9be9c7cff600018279a0c3fa5fbe719bd1c0b8ad (patch) | |
tree | 7c1e61f36680f92143e0df19a55de2f0f9a0edc3 /src/libsystemd-bus/bus-message.c | |
parent | 3fd0bd432d4875c15b9e8d586770f60f03278fe7 (diff) |
macro: make sure ALIGN() can be calculated constant by the compiler
If we pass a constant value to ALIGN() gcc should have the chance to
calculate the value during compilation rather than runtime, so let's
avoid a static inline call if we can.
Diffstat (limited to 'src/libsystemd-bus/bus-message.c')
-rw-r--r-- | src/libsystemd-bus/bus-message.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c index 3081664091..4d4f3b5260 100644 --- a/src/libsystemd-bus/bus-message.c +++ b/src/libsystemd-bus/bus-message.c @@ -265,7 +265,7 @@ int bus_message_from_malloc( } else return -EBADMSG; - total = sizeof(struct bus_header) + ALIGN_TO(fs, 8) + bs; + total = sizeof(struct bus_header) + ALIGN8(fs) + bs; if (length != total) return -EBADMSG; @@ -283,7 +283,7 @@ int bus_message_from_malloc( m->sealed = true; m->header = h; m->fields = (uint8_t*) buffer + sizeof(struct bus_header); - m->body = (uint8_t*) buffer + sizeof(struct bus_header) + ALIGN_TO(fs, 8); + m->body = (uint8_t*) buffer + sizeof(struct bus_header) + ALIGN8(fs); m->fds = fds; m->n_fds = n_fds; |