From 25f4d23e13b65ff766a8b7d7fdb6339cbb92d972 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 2 Jun 2021 10:22:51 +0200 Subject: [PATCH] glib-aux: change nm_uuid_is_valid_full() to nm_uuid_is_normalized_full() Most of the time, we care about whether we have a normalized UUID. nm_uuid_is_valid_full() only exists for a particular case where we want to use the function in a header, without including "nm-uuid.h". In that case, we actually also care about normalized UUIDs. --- src/core/settings/nm-settings-storage.h | 6 +++--- src/libnm-glib-aux/nm-uuid.c | 6 +++--- src/libnm-glib-aux/nm-uuid.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/core/settings/nm-settings-storage.h b/src/core/settings/nm-settings-storage.h index d873a485bd..2e5e1c5579 100644 --- a/src/core/settings/nm-settings-storage.h +++ b/src/core/settings/nm-settings-storage.h @@ -60,14 +60,14 @@ nm_settings_storage_get_plugin(const NMSettingsStorage *self) return self->_plugin; } -gboolean nm_uuid_is_valid_full(const char *str); +gboolean nm_uuid_is_normalized_full(const char *str); static inline const char * nm_settings_storage_get_uuid(const NMSettingsStorage *self) { g_return_val_if_fail(NM_IS_SETTINGS_STORAGE(self), NULL); - nm_assert(nm_uuid_is_valid_full(self->_uuid)); + nm_assert(nm_uuid_is_normalized_full(self->_uuid)); return self->_uuid; } @@ -76,7 +76,7 @@ nm_settings_storage_get_uuid_opt(const NMSettingsStorage *self) { g_return_val_if_fail(NM_IS_SETTINGS_STORAGE(self), NULL); - nm_assert(!self->_uuid || nm_uuid_is_valid_full(self->_uuid)); + nm_assert(!self->_uuid || nm_uuid_is_normalized_full(self->_uuid)); return self->_uuid; } diff --git a/src/libnm-glib-aux/nm-uuid.c b/src/libnm-glib-aux/nm-uuid.c index 977a9e79a9..2c6e218a7c 100644 --- a/src/libnm-glib-aux/nm-uuid.c +++ b/src/libnm-glib-aux/nm-uuid.c @@ -130,13 +130,13 @@ nm_uuid_generate_random(NMUuid *out_uuid) /*****************************************************************************/ gboolean -nm_uuid_is_valid_full(const char *str) +nm_uuid_is_normalized_full(const char *str) { - /* The only reason why this exists is that nm_uuid_is_valid() is an inline function. + /* The only reason why this exists is that nm_uuid_is_normalized() is an inline function. * If you need to forward declare the function, that won't work. * * Usually, you wouldn't use this variant! */ - return nm_uuid_is_valid(str); + return nm_uuid_is_normalized(str); } /*****************************************************************************/ diff --git a/src/libnm-glib-aux/nm-uuid.h b/src/libnm-glib-aux/nm-uuid.h index 29e32ddf87..10302bd87a 100644 --- a/src/libnm-glib-aux/nm-uuid.h +++ b/src/libnm-glib-aux/nm-uuid.h @@ -33,14 +33,14 @@ gboolean nm_uuid_is_null(const NMUuid *uuid); /*****************************************************************************/ -gboolean nm_uuid_is_valid_full(const char *str); - static inline gboolean nm_uuid_is_valid(const char *str) { return str && nm_uuid_parse_full(str, NULL, NULL); } +gboolean nm_uuid_is_normalized_full(const char *str); + static inline gboolean nm_uuid_is_normalized(const char *str) {