[PATCH 0/2] util: xml: Clean up other instances of problems pointed out in review

In review of my series which was adding new XML Property fetching helpers I was asked to change few things which were also present in other instances in existing code. Fix those too. Peter Krempa (2): util: xml: Fix declararation of 'const char *' parameters in virXMLProp* helpers util: xml: Use common formatting of 'Bitwise-OR' in function param description src/util/virxml.c | 34 +++++++++++++++++----------------- src/util/virxml.h | 12 ++++++------ 2 files changed, 23 insertions(+), 23 deletions(-) -- 2.37.3

We commonly use 'const char *name' instead of 'const char* name'. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/util/virxml.c | 20 ++++++++++---------- src/util/virxml.h | 12 ++++++------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/util/virxml.c b/src/util/virxml.c index a53a52dcf8..c43cc0fd5d 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -517,8 +517,8 @@ virXMLNodeContentString(xmlNodePtr node) static int virXMLPropEnumInternal(xmlNodePtr node, - const char* name, - int (*strToInt)(const char*), + const char *name, + int (*strToInt)(const char *), virXMLPropFlags flags, unsigned int *result, unsigned int defaultResult) @@ -570,7 +570,7 @@ virXMLPropEnumInternal(xmlNodePtr node, */ int virXMLPropTristateBool(xmlNodePtr node, - const char* name, + const char *name, virXMLPropFlags flags, virTristateBool *result) { @@ -590,7 +590,7 @@ virXMLPropTristateBool(xmlNodePtr node, * being omitted entirely */ int virXMLPropTristateBoolAllowDefault(xmlNodePtr node, - const char* name, + const char *name, virXMLPropFlags flags, virTristateBool *result) { @@ -616,7 +616,7 @@ virXMLPropTristateBoolAllowDefault(xmlNodePtr node, */ int virXMLPropTristateSwitch(xmlNodePtr node, - const char* name, + const char *name, virXMLPropFlags flags, virTristateSwitch *result) { @@ -708,7 +708,7 @@ virXMLPropInt(xmlNodePtr node, */ int virXMLPropUInt(xmlNodePtr node, - const char* name, + const char *name, int base, virXMLPropFlags flags, unsigned int *result) @@ -831,7 +831,7 @@ virXMLPropLongLong(xmlNodePtr node, */ int virXMLPropULongLong(xmlNodePtr node, - const char* name, + const char *name, int base, virXMLPropFlags flags, unsigned long long *result) @@ -891,7 +891,7 @@ virXMLPropULongLong(xmlNodePtr node, */ int virXMLPropEnumDefault(xmlNodePtr node, - const char* name, + const char *name, int (*strToInt)(const char*), virXMLPropFlags flags, unsigned int *result, @@ -916,7 +916,7 @@ virXMLPropEnumDefault(xmlNodePtr node, */ int virXMLPropUUID(xmlNodePtr node, - const char* name, + const char *name, virXMLPropFlags flags, unsigned char *result) { @@ -963,7 +963,7 @@ virXMLPropUUID(xmlNodePtr node, */ int virXMLPropEnum(xmlNodePtr node, - const char* name, + const char *name, int (*strToInt)(const char*), virXMLPropFlags flags, unsigned int *result) diff --git a/src/util/virxml.h b/src/util/virxml.h index af58d44835..65db46ca98 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -135,7 +135,7 @@ virXMLPropInt(xmlNodePtr node, int virXMLPropUInt(xmlNodePtr node, - const char* name, + const char *name, int base, virXMLPropFlags flags, unsigned int *result) @@ -152,7 +152,7 @@ virXMLPropLongLong(xmlNodePtr node, int virXMLPropULongLong(xmlNodePtr node, - const char* name, + const char *name, int base, virXMLPropFlags flags, unsigned long long *result) @@ -160,8 +160,8 @@ virXMLPropULongLong(xmlNodePtr node, int virXMLPropEnum(xmlNodePtr node, - const char* name, - int (*strToInt)(const char*), + const char *name, + int (*strToInt)(const char *), virXMLPropFlags flags, unsigned int *result) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) @@ -176,8 +176,8 @@ virXMLPropUUID(xmlNodePtr node, int virXMLPropEnumDefault(xmlNodePtr node, - const char* name, - int (*strToInt)(const char*), + const char *name, + int (*strToInt)(const char *), virXMLPropFlags flags, unsigned int *result, unsigned int defaultResult) -- 2.37.3

Our public API docs use the hyphenated version with capital OR. Fix the virXMLProp* helpers to use the same syntax. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/util/virxml.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/util/virxml.c b/src/util/virxml.c index c43cc0fd5d..0548a29e65 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -557,7 +557,7 @@ virXMLPropEnumInternal(xmlNodePtr node, * virXMLPropTristateBool: * @node: XML dom node pointer * @name: Name of the property (attribute) to get - * @flags: Bitwise or of virXMLPropFlags + * @flags: Bitwise-OR of virXMLPropFlags * @result: The returned value * * Convenience function to return value of a yes / no attribute. @@ -603,7 +603,7 @@ virXMLPropTristateBoolAllowDefault(xmlNodePtr node, * virXMLPropTristateSwitch: * @node: XML dom node pointer * @name: Name of the property (attribute) to get - * @flags: Bitwise or of virXMLPropFlags + * @flags: Bitwise-OR of virXMLPropFlags * @result: The returned value * * Convenience function to return value of an on / off attribute. @@ -632,7 +632,7 @@ virXMLPropTristateSwitch(xmlNodePtr node, * @node: XML dom node pointer * @name: Name of the property (attribute) to get * @base: Number base, see strtol - * @flags: Bitwise or of virXMLPropFlags + * @flags: Bitwise-OR of virXMLPropFlags * @result: The returned value * @defaultResult: default value of @result in case the property is not found * @@ -696,7 +696,7 @@ virXMLPropInt(xmlNodePtr node, * @node: XML dom node pointer * @name: Name of the property (attribute) to get * @base: Number base, see strtol - * @flags: Bitwise or of virXMLPropFlags + * @flags: Bitwise-OR of virXMLPropFlags * @result: The returned value * * Convenience function to return value of an unsigned integer attribute. @@ -819,7 +819,7 @@ virXMLPropLongLong(xmlNodePtr node, * @node: XML dom node pointer * @name: Name of the property (attribute) to get * @base: Number base, see strtol - * @flags: Bitwise or of virXMLPropFlags + * @flags: Bitwise-OR of virXMLPropFlags * @result: The returned value * * Convenience function to return value of an unsigned long long attribute. @@ -879,7 +879,7 @@ virXMLPropULongLong(xmlNodePtr node, * @name: Name of the property (attribute) to get * @strToInt: Conversion function to turn enum name to value. Expected to * return negative value on failure. - * @flags: Bitwise or of virXMLPropFlags + * @flags: Bitwise-OR of virXMLPropFlags * @result: The returned value * @defaultResult: default value set to @result in case the property is missing * @@ -951,7 +951,7 @@ virXMLPropUUID(xmlNodePtr node, * @name: Name of the property (attribute) to get * @strToInt: Conversion function to turn enum name to value. Expected to * return negative value on failure. - * @flags: Bitwise or of virXMLPropFlags + * @flags: Bitwise-OR of virXMLPropFlags * @result: The returned value * * Convenience function to return value of an enum attribute. -- 2.37.3

On a Monday in 2022, Peter Krempa wrote:
In review of my series which was adding new XML Property fetching helpers I was asked to change few things which were also present in other instances in existing code. Fix those too.
Peter Krempa (2): util: xml: Fix declararation of 'const char *' parameters in virXMLProp* helpers util: xml: Use common formatting of 'Bitwise-OR' in function param description
src/util/virxml.c | 34 +++++++++++++++++----------------- src/util/virxml.h | 12 ++++++------ 2 files changed, 23 insertions(+), 23 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano
participants (2)
-
Ján Tomko
-
Peter Krempa