mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-23 09:28:54 +02:00
gvariant: Change type of ‘y’ variants from guchar to guint8
This fits better with the convention in the rest of GLib where arbitrary 8-bit values are represented as guint8, avoiding the potential confusing of a name which references ‘char’s. This is not an API break, as both guint8 and guchar are unconditionally typedeffed to unsigned char. https://gitlab.gnome.org/GNOME/glib/issues/896
This commit is contained in:
@@ -403,11 +403,11 @@ g_variant_get_boolean (GVariant *value)
|
||||
* It is an error to call this function with a @value of any type
|
||||
* other than %G_VARIANT_TYPE_BYTE.
|
||||
*
|
||||
* Returns: a #guchar
|
||||
* Returns: a #guint8
|
||||
*
|
||||
* Since: 2.24
|
||||
**/
|
||||
NUMERIC_TYPE (BYTE, byte, guchar)
|
||||
NUMERIC_TYPE (BYTE, byte, guint8)
|
||||
|
||||
/**
|
||||
* g_variant_new_int16:
|
||||
@@ -1105,7 +1105,7 @@ g_variant_lookup_value (GVariant *dictionary,
|
||||
* the appropriate type:
|
||||
* - %G_VARIANT_TYPE_INT16 (etc.): #gint16 (etc.)
|
||||
* - %G_VARIANT_TYPE_BOOLEAN: #guchar (not #gboolean!)
|
||||
* - %G_VARIANT_TYPE_BYTE: #guchar
|
||||
* - %G_VARIANT_TYPE_BYTE: #guint8
|
||||
* - %G_VARIANT_TYPE_HANDLE: #guint32
|
||||
* - %G_VARIANT_TYPE_DOUBLE: #gdouble
|
||||
*
|
||||
@@ -5042,7 +5042,7 @@ g_variant_valist_get_leaf (const gchar **str,
|
||||
return;
|
||||
|
||||
case 'y':
|
||||
*(guchar *) ptr = g_variant_get_byte (value);
|
||||
*(guint8 *) ptr = g_variant_get_byte (value);
|
||||
return;
|
||||
|
||||
case 'n':
|
||||
@@ -5083,7 +5083,7 @@ g_variant_valist_get_leaf (const gchar **str,
|
||||
switch (*(*str)++)
|
||||
{
|
||||
case 'y':
|
||||
*(guchar *) ptr = 0;
|
||||
*(guint8 *) ptr = 0;
|
||||
return;
|
||||
|
||||
case 'n':
|
||||
|
Reference in New Issue
Block a user