diff options
| author | Michael Biebl <biebl@debian.org> | 2022-02-14 19:23:28 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2022-02-14 19:23:28 +0100 |
| commit | 2f94dba7385fd0e0ef19a06eb4a2fcf6c43d7946 (patch) | |
| tree | e2222f5577115985dd52044d2991253403cdd952 /src/libnm-glib-aux/nm-hash-utils.h | |
| parent | 88c227d90a6b7b388c5c85d72802a0ca8f05ed5c (diff) | |
New upstream version 1.35.91 upstream/1.35.91
Diffstat (limited to 'src/libnm-glib-aux/nm-hash-utils.h')
| -rw-r--r-- | src/libnm-glib-aux/nm-hash-utils.h | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/libnm-glib-aux/nm-hash-utils.h b/src/libnm-glib-aux/nm-hash-utils.h index d7de2de4..b7ee4dd1 100644 --- a/src/libnm-glib-aux/nm-hash-utils.h +++ b/src/libnm-glib-aux/nm-hash-utils.h @@ -201,10 +201,10 @@ nm_hash_update_str(NMHashState *state, const char *str) #endif guint nm_hash_ptr(gconstpointer ptr); -guint nm_direct_hash(gconstpointer str); +#define nm_direct_hash nm_hash_ptr guint nm_hash_str(const char *str); -guint nm_str_hash(gconstpointer str); +#define nm_str_hash ((guint(*)(gconstpointer str)) nm_hash_str) #define nm_hash_val(static_seed, val) \ ({ \ @@ -284,15 +284,7 @@ gboolean nm_pg_bytes_equal(gconstpointer a, gconstpointer b); * * Note that there is a chance that two different pointer values hash to the same obfuscated * value. So beware of that when reviewing logs. However, such a collision is very unlikely. */ -static inline guint64 -nm_hash_obfuscate_ptr(guint static_seed, gconstpointer val) -{ - NMHashState h; - - nm_hash_init(&h, static_seed); - nm_hash_update_val(&h, val); - return nm_hash_complete_u64(&h); -} +guint64 nm_hash_obfuscate_ptr(guint static_seed, gconstpointer val); /* if you want to log obfuscated pointer for a certain context (like, NMPRuleManager * logging user-tags), then you are advised to use nm_hash_obfuscate_ptr() with your |