mirror of https://gitee.com/openkylin/libvirt.git
util: json: Make argument of virJSONValueArraySize const
The function doesn't allow to modify the array in any way, thus the argument can be const.
This commit is contained in:
parent
165c34778b
commit
60e4e5783d
|
@ -797,7 +797,7 @@ virJSONValueIsArray(virJSONValuePtr array)
|
|||
|
||||
|
||||
int
|
||||
virJSONValueArraySize(virJSONValuePtr array)
|
||||
virJSONValueArraySize(const virJSONValue *array)
|
||||
{
|
||||
if (array->type != VIR_JSON_TYPE_ARRAY)
|
||||
return -1;
|
||||
|
|
|
@ -105,7 +105,7 @@ int virJSONValueObjectHasKey(virJSONValuePtr object, const char *key);
|
|||
virJSONValuePtr virJSONValueObjectGet(virJSONValuePtr object, const char *key);
|
||||
|
||||
bool virJSONValueIsArray(virJSONValuePtr array);
|
||||
int virJSONValueArraySize(virJSONValuePtr object);
|
||||
int virJSONValueArraySize(const virJSONValue *array);
|
||||
virJSONValuePtr virJSONValueArrayGet(virJSONValuePtr object, unsigned int element);
|
||||
virJSONValuePtr virJSONValueArraySteal(virJSONValuePtr object, unsigned int element);
|
||||
|
||||
|
|
Loading…
Reference in New Issue