mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 13:28:02 +02:00
shared: add nm_hash_obfuscated_ptr_str() helper
This commit is contained in:
parent
1e870c675d
commit
ace515e697
1 changed files with 13 additions and 0 deletions
|
|
@ -352,6 +352,19 @@ nm_hash_obfuscate_ptr (guint static_seed, gconstpointer val)
|
|||
* values in a global context. */
|
||||
#define NM_HASH_OBFUSCATE_PTR(ptr) (nm_hash_obfuscate_ptr (1678382159u, ptr))
|
||||
|
||||
static inline const char *
|
||||
nm_hash_obfuscated_ptr_str (gconstpointer ptr, char buf[static 17])
|
||||
{
|
||||
int l;
|
||||
|
||||
nm_assert (buf);
|
||||
l = g_snprintf (buf, 17, NM_HASH_OBFUSCATE_PTR_FMT, NM_HASH_OBFUSCATE_PTR (ptr));
|
||||
nm_assert (l < 17);
|
||||
return buf;
|
||||
}
|
||||
|
||||
#define nm_hash_obfuscated_ptr_str_a(ptr) (nm_hash_obfuscated_ptr_str ((ptr), g_alloca (17)))
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#endif /* __NM_HASH_UTILS_H__ */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue