mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-08 22:20:19 +01:00
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.
This commit is contained in:
parent
6ce7b3ca0f
commit
25f4d23e13
3 changed files with 8 additions and 8 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue