glib-aux: make GBytes parameter const for read-only helper functions

This commit is contained in:
Thomas Haller 2021-10-27 20:44:25 +02:00
parent f730edfcb1
commit 974bf61428
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
2 changed files with 4 additions and 4 deletions

View file

@ -538,7 +538,7 @@ nm_utils_gbytes_equal_mem(GBytes *bytes, gconstpointer mem_data, gsize mem_len)
}
GVariant *
nm_utils_gbytes_to_variant_ay(GBytes *bytes)
nm_utils_gbytes_to_variant_ay(const GBytes *bytes)
{
const guint8 *p = NULL;
gsize l = 0;
@ -546,7 +546,7 @@ nm_utils_gbytes_to_variant_ay(GBytes *bytes)
if (!bytes) {
/* for convenience, accept NULL to return an empty variant */
} else
p = g_bytes_get_data(bytes, &l);
p = g_bytes_get_data((GBytes *) bytes, &l);
return nm_g_variant_new_ay(p, l);
}

View file

@ -604,14 +604,14 @@ GBytes *nm_gbytes_get_empty(void);
GBytes *nm_g_bytes_new_from_str(const char *str);
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));
}
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);