mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
json: Fix *GetBoolean functions
They were not used anywhere so far so nobody noticed they are broken.
This commit is contained in:
parent
0f536dea9b
commit
b9171eba2f
@ -491,12 +491,13 @@ int virJSONValueGetNumberDouble(virJSONValuePtr number, double *value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int virJSONValueGetBoolean(virJSONValuePtr val)
|
int virJSONValueGetBoolean(virJSONValuePtr val, bool *value)
|
||||||
{
|
{
|
||||||
if (val->type != VIR_JSON_TYPE_NUMBER)
|
if (val->type != VIR_JSON_TYPE_BOOLEAN)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return val->data.boolean;
|
*value = val->data.boolean;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -593,7 +594,7 @@ int virJSONValueObjectGetNumberDouble(virJSONValuePtr object, const char *key, d
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int virJSONValueObjectGetBoolean(virJSONValuePtr object, const char *key)
|
int virJSONValueObjectGetBoolean(virJSONValuePtr object, const char *key, bool *value)
|
||||||
{
|
{
|
||||||
virJSONValuePtr val;
|
virJSONValuePtr val;
|
||||||
if (object->type != VIR_JSON_TYPE_OBJECT)
|
if (object->type != VIR_JSON_TYPE_OBJECT)
|
||||||
@ -603,7 +604,7 @@ int virJSONValueObjectGetBoolean(virJSONValuePtr object, const char *key)
|
|||||||
if (!val)
|
if (!val)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return virJSONValueGetBoolean(val);
|
return virJSONValueGetBoolean(val, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ int virJSONValueGetNumberUint(virJSONValuePtr object, unsigned int *value);
|
|||||||
int virJSONValueGetNumberLong(virJSONValuePtr object, long long *value);
|
int virJSONValueGetNumberLong(virJSONValuePtr object, long long *value);
|
||||||
int virJSONValueGetNumberUlong(virJSONValuePtr object, unsigned long long *value);
|
int virJSONValueGetNumberUlong(virJSONValuePtr object, unsigned long long *value);
|
||||||
int virJSONValueGetNumberDouble(virJSONValuePtr object, double *value);
|
int virJSONValueGetNumberDouble(virJSONValuePtr object, double *value);
|
||||||
int virJSONValueGetBoolean(virJSONValuePtr object);
|
int virJSONValueGetBoolean(virJSONValuePtr object, bool *value);
|
||||||
int virJSONValueIsNull(virJSONValuePtr object);
|
int virJSONValueIsNull(virJSONValuePtr object);
|
||||||
|
|
||||||
const char *virJSONValueObjectGetString(virJSONValuePtr object, const char *key);
|
const char *virJSONValueObjectGetString(virJSONValuePtr object, const char *key);
|
||||||
@ -114,7 +114,7 @@ int virJSONValueObjectGetNumberUint(virJSONValuePtr object, const char *key, uns
|
|||||||
int virJSONValueObjectGetNumberLong(virJSONValuePtr object, const char *key, long long *value);
|
int virJSONValueObjectGetNumberLong(virJSONValuePtr object, const char *key, long long *value);
|
||||||
int virJSONValueObjectGetNumberUlong(virJSONValuePtr object, const char *key, unsigned long long *value);
|
int virJSONValueObjectGetNumberUlong(virJSONValuePtr object, const char *key, unsigned long long *value);
|
||||||
int virJSONValueObjectGetNumberDouble(virJSONValuePtr object, const char *key, double *value);
|
int virJSONValueObjectGetNumberDouble(virJSONValuePtr object, const char *key, double *value);
|
||||||
int virJSONValueObjectGetBoolean(virJSONValuePtr object, const char *key);
|
int virJSONValueObjectGetBoolean(virJSONValuePtr object, const char *key, bool *value);
|
||||||
int virJSONValueObjectIsNull(virJSONValuePtr object, const char *key);
|
int virJSONValueObjectIsNull(virJSONValuePtr object, const char *key);
|
||||||
|
|
||||||
int virJSONValueObjectAppendString(virJSONValuePtr object, const char *key, const char *value);
|
int virJSONValueObjectAppendString(virJSONValuePtr object, const char *key, const char *value);
|
||||||
|
Loading…
Reference in New Issue
Block a user