shared: add nm_hash_update_valp() helper macro
Add a macro for hashing that takes a pointer and the size is automatically determined by sizeof(*p).
This commit is contained in:
@@ -122,6 +122,9 @@ nm_hash_update (NMHashState *state, const void *ptr, gsize n)
|
||||
nm_hash_update ((state), &_val, sizeof (_val)); \
|
||||
} G_STMT_END
|
||||
|
||||
#define nm_hash_update_valp(state, val) \
|
||||
nm_hash_update ((state), (val), sizeof (*(val))) \
|
||||
|
||||
static inline void
|
||||
nm_hash_update_bool (NMHashState *state, bool val)
|
||||
{
|
||||
|
Reference in New Issue
Block a user