mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-22 08:10:45 +02:00
glib-aux: use max_align_t in NM_HASH_COMBINE_VALS() macro
The _nm_alignas() exists to choose a suitable alignment. Since it's on the stack, it has (almost) no overhead to just use the maximum alignment. That's why gint64 was chosen before. But that isn't the largest alignment. We rely on C11 already, and we also always include <stddef.h>. So use max_align_t instead.
This commit is contained in:
parent
c4992c75f7
commit
22f6ac039d
1 changed files with 1 additions and 1 deletions
|
|
@ -140,7 +140,7 @@ nm_hash_update_bool(NMHashState *state, bool val)
|
|||
#define NM_HASH_COMBINE_VALS(var, ...) \
|
||||
const struct _nm_packed { \
|
||||
NM_VA_ARGS_FOREACH(, , , _NM_HASH_COMBINE_VALS_TYPE_OP, __VA_ARGS__) \
|
||||
} var _nm_alignas(guint64) = { \
|
||||
} var _nm_alignas(max_align_t) = { \
|
||||
NM_VA_ARGS_FOREACH(, , , _NM_HASH_COMBINE_VALS_INIT_OP, __VA_ARGS__)}
|
||||
|
||||
/* nm_hash_update_vals() is faster then nm_hash_update_val() as it combines multiple
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue