From 2844daafcf5740e62960a54f19009dd1eb44b5c2 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Mon, 15 Dec 2008 11:18:41 +0100 Subject: Needed to change from #define macro to function to avoid compiler warning When xmlExtractContent() was used together with the defaultValue() macro, a compiler warning appeared. Changed the xmlExtractContent() macro to a inline function, hopefully the overhead will be minimal with this change. --- common/eurephia_xml.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/eurephia_xml.h b/common/eurephia_xml.h index c955653..761ffda 100644 --- a/common/eurephia_xml.h +++ b/common/eurephia_xml.h @@ -27,7 +27,9 @@ char *xmlGetAttrValue(xmlAttr *properties, const char *key); xmlNode *xmlFindNode(xmlNode *node, const char *key); -#define xmlExtractContent(n) (char*) (((n != NULL) && (n->children != NULL)) ? n->children->content : NULL) +inline char *xmlExtractContent(xmlNode *n) { + return (char *) (((n != NULL) && (n->children != NULL)) ? n->children->content : NULL); +} inline char *xmlGetNodeContent(xmlNode *node, const char *key) { return xmlExtractContent(xmlFindNode(node, key)); } -- cgit