mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 19:28:04 +02:00
glib-aux: make GBytes parameter const for read-only helper functions
This commit is contained in:
parent
f730edfcb1
commit
974bf61428
2 changed files with 4 additions and 4 deletions
|
|
@ -538,7 +538,7 @@ nm_utils_gbytes_equal_mem(GBytes *bytes, gconstpointer mem_data, gsize mem_len)
|
||||||
}
|
}
|
||||||
|
|
||||||
GVariant *
|
GVariant *
|
||||||
nm_utils_gbytes_to_variant_ay(GBytes *bytes)
|
nm_utils_gbytes_to_variant_ay(const GBytes *bytes)
|
||||||
{
|
{
|
||||||
const guint8 *p = NULL;
|
const guint8 *p = NULL;
|
||||||
gsize l = 0;
|
gsize l = 0;
|
||||||
|
|
@ -546,7 +546,7 @@ nm_utils_gbytes_to_variant_ay(GBytes *bytes)
|
||||||
if (!bytes) {
|
if (!bytes) {
|
||||||
/* for convenience, accept NULL to return an empty variant */
|
/* for convenience, accept NULL to return an empty variant */
|
||||||
} else
|
} else
|
||||||
p = g_bytes_get_data(bytes, &l);
|
p = g_bytes_get_data((GBytes *) bytes, &l);
|
||||||
|
|
||||||
return nm_g_variant_new_ay(p, l);
|
return nm_g_variant_new_ay(p, l);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -604,14 +604,14 @@ GBytes *nm_gbytes_get_empty(void);
|
||||||
GBytes *nm_g_bytes_new_from_str(const char *str);
|
GBytes *nm_g_bytes_new_from_str(const char *str);
|
||||||
|
|
||||||
static inline gboolean
|
static inline gboolean
|
||||||
nm_gbytes_equal0(GBytes *a, GBytes *b)
|
nm_gbytes_equal0(const GBytes *a, const GBytes *b)
|
||||||
{
|
{
|
||||||
return a == b || (a && b && g_bytes_equal(a, b));
|
return a == b || (a && b && g_bytes_equal(a, b));
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean nm_utils_gbytes_equal_mem(GBytes *bytes, gconstpointer mem_data, gsize mem_len);
|
gboolean nm_utils_gbytes_equal_mem(GBytes *bytes, gconstpointer mem_data, gsize mem_len);
|
||||||
|
|
||||||
GVariant *nm_utils_gbytes_to_variant_ay(GBytes *bytes);
|
GVariant *nm_utils_gbytes_to_variant_ay(const GBytes *bytes);
|
||||||
|
|
||||||
GHashTable *nm_strdict_clone(GHashTable *src);
|
GHashTable *nm_strdict_clone(GHashTable *src);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue