mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
util: fix various ATTRIBUTE_NONNULL calls
Git bisect took me to commit where incorrect usage of ATTRIBUTE_NONNULL was introduced and caused coverity scan to fail. This patch fixes the issue where the index starts from 1 and not 0 and two other different cases. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
d20ebdda28
commit
23b99623ee
@ -53,7 +53,7 @@ void virAppendElement(void *ptrptr,
|
||||
void *newelem,
|
||||
bool clearOriginal,
|
||||
bool inPlace)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
|
||||
int virDeleteElementsN(void *ptrptr, size_t size, size_t at, size_t *countptr,
|
||||
size_t toremove, bool inPlace)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
|
||||
|
@ -82,7 +82,7 @@ int virNetDevOpenvswitchInterfaceClearQos(const char *ifname,
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
|
||||
|
||||
int virNetDevOpenvswitchInterfaceClearRxQos(const char *ifname)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
|
||||
ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT;
|
||||
|
||||
int virNetDevOpenvswitchInterfaceClearTxQos(const char *ifname,
|
||||
const unsigned char *vmid)
|
||||
|
@ -109,14 +109,14 @@ virXMLPropTristateBool(xmlNodePtr node,
|
||||
const char *name,
|
||||
virXMLPropFlags flags,
|
||||
virTristateBool *result)
|
||||
ATTRIBUTE_NONNULL(0) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4);
|
||||
|
||||
int
|
||||
virXMLPropTristateSwitch(xmlNodePtr node,
|
||||
const char *name,
|
||||
virXMLPropFlags flags,
|
||||
virTristateSwitch *result)
|
||||
ATTRIBUTE_NONNULL(0) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4);
|
||||
|
||||
int
|
||||
virXMLPropInt(xmlNodePtr node,
|
||||
@ -125,7 +125,7 @@ virXMLPropInt(xmlNodePtr node,
|
||||
virXMLPropFlags flags,
|
||||
int *result,
|
||||
int defaultResult)
|
||||
ATTRIBUTE_NONNULL(0) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5);
|
||||
|
||||
int
|
||||
virXMLPropUInt(xmlNodePtr node,
|
||||
@ -133,7 +133,7 @@ virXMLPropUInt(xmlNodePtr node,
|
||||
int base,
|
||||
virXMLPropFlags flags,
|
||||
unsigned int *result)
|
||||
ATTRIBUTE_NONNULL(0) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5);
|
||||
|
||||
int
|
||||
virXMLPropULongLong(xmlNodePtr node,
|
||||
@ -141,7 +141,7 @@ virXMLPropULongLong(xmlNodePtr node,
|
||||
int base,
|
||||
virXMLPropFlags flags,
|
||||
unsigned long long *result)
|
||||
ATTRIBUTE_NONNULL(0) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5);
|
||||
|
||||
int
|
||||
virXMLPropEnum(xmlNodePtr node,
|
||||
@ -149,8 +149,8 @@ virXMLPropEnum(xmlNodePtr node,
|
||||
int (*strToInt)(const char*),
|
||||
virXMLPropFlags flags,
|
||||
unsigned int *result)
|
||||
ATTRIBUTE_NONNULL(0) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
|
||||
ATTRIBUTE_NONNULL(4);
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
|
||||
ATTRIBUTE_NONNULL(5);
|
||||
|
||||
int
|
||||
virXMLPropEnumDefault(xmlNodePtr node,
|
||||
@ -159,8 +159,8 @@ virXMLPropEnumDefault(xmlNodePtr node,
|
||||
virXMLPropFlags flags,
|
||||
unsigned int *result,
|
||||
unsigned int defaultResult)
|
||||
ATTRIBUTE_NONNULL(0) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
|
||||
ATTRIBUTE_NONNULL(4);
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
|
||||
ATTRIBUTE_NONNULL(5);
|
||||
|
||||
|
||||
/* Internal function; prefer the macros below. */
|
||||
|
Loading…
Reference in New Issue
Block a user