From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16154 invoked by alias); 22 Jun 2009 13:33:41 -0000 Received: (qmail 16144 invoked by alias); 22 Jun 2009 13:33:41 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: cluster: STABLE3 - rgmanager: Fix resrules.c compiler warnings To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/STABLE3 X-Git-Reftype: branch X-Git-Oldrev: 9a6b6c07462a2cc4c70b67d1dd5883fb002d60dd X-Git-Newrev: 19db8ef7657c4e5767fb3c9892c2a7e5726938a5 From: Lon Hohberger Message-Id: <20090622133309.8431A1201D4@lists.fedorahosted.org> Date: Mon, 22 Jun 2009 13:34:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00599.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=19db8ef7657c4e5767fb3c9892c2a7e5726938a5 Commit: 19db8ef7657c4e5767fb3c9892c2a7e5726938a5 Parent: 9a6b6c07462a2cc4c70b67d1dd5883fb002d60dd Author: Lon Hohberger AuthorDate: Tue Jun 16 14:14:17 2009 -0400 Committer: Lon Hohberger CommitterDate: Mon Jun 22 09:32:03 2009 -0400 rgmanager: Fix resrules.c compiler warnings Signed-off-by: Lon Hohberger --- rgmanager/include/reslist.h | 2 +- rgmanager/src/daemons/reslist.c | 2 +- rgmanager/src/daemons/resrules.c | 41 ++++++++++++++++++------------------- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/rgmanager/include/reslist.h b/rgmanager/include/reslist.h index 1e5f2b2..19fd023 100644 --- a/rgmanager/include/reslist.h +++ b/rgmanager/include/reslist.h @@ -177,7 +177,7 @@ void res_build_name(char *, size_t, resource_t *); /* Internal functions; shouldn't be needed. */ -const char *xpath_get_one(xmlDocPtr doc, xmlXPathContextPtr ctx, +char *xpath_get_one(xmlDocPtr doc, xmlXPathContextPtr ctx, const char *query); int store_attribute(resource_attr_t **attrsp, char *name, char *value, int flags); diff --git a/rgmanager/src/daemons/reslist.c b/rgmanager/src/daemons/reslist.c index f663de5..d3ce483 100644 --- a/rgmanager/src/daemons/reslist.c +++ b/rgmanager/src/daemons/reslist.c @@ -428,7 +428,7 @@ store_resource(resource_t **reslist, resource_t *newres) @param query Query to execute. @return newly allocated pointer to value or NULL if not found. */ -const char * +char * xpath_get_one(xmlDocPtr __attribute__ ((unused)) doc, xmlXPathContextPtr ctx, const char *query) { diff --git a/rgmanager/src/daemons/resrules.c b/rgmanager/src/daemons/resrules.c index a57e3e0..7c68ce0 100644 --- a/rgmanager/src/daemons/resrules.c +++ b/rgmanager/src/daemons/resrules.c @@ -28,7 +28,7 @@ @return 0 on success or -1 if rule with same name already exists in rulelist */ -int +static int store_rule(resource_rule_t **rulelist, resource_rule_t *newrule) { resource_rule_t *curr; @@ -69,7 +69,7 @@ store_rule(resource_rule_t **rulelist, resource_rule_t *newrule) @param rr Resource rule to free. */ -void +static void destroy_resource_rule(resource_rule_t *rr) { int x; @@ -138,12 +138,12 @@ destroy_resource_rules(resource_rule_t **rules) @param base XPath prefix to search @param rr Resource rule to store new information in. */ -void +static void _get_maxparents(xmlDocPtr doc, xmlXPathContextPtr ctx, char *base, resource_rule_t *rr) { char xpath[256]; - char *ret = NULL; + char *ret; snprintf(xpath, sizeof(xpath), "%s/attributes/@maxinstances", @@ -166,12 +166,12 @@ _get_maxparents(xmlDocPtr doc, xmlXPathContextPtr ctx, char *base, @param base XPath prefix to search @param rr Resource rule to store new information in. */ -void +static void _get_rule_flag(xmlDocPtr doc, xmlXPathContextPtr ctx, char *base, - resource_rule_t *rr, char *flag, int bit) + resource_rule_t *rr, const char *flag, int bit) { char xpath[256]; - char *ret = NULL; + char *ret; snprintf(xpath, sizeof(xpath), "%s/attributes/@%s", @@ -196,12 +196,12 @@ _get_rule_flag(xmlDocPtr doc, xmlXPathContextPtr ctx, char *base, @param base XPath prefix to search @param rr Resource rule to store new information in. */ -void +static void _get_version(xmlDocPtr doc, xmlXPathContextPtr ctx, char *base, resource_rule_t *rr) { char xpath[256]; - char *ret = NULL; + char *ret; snprintf(xpath, sizeof(xpath), "%s/@version", base); ret = xpath_get_one(doc, ctx, xpath); @@ -370,8 +370,7 @@ store_action(resource_act_t **actsp, char *name, int depth, } - -void +static void _get_actions(xmlDocPtr doc, xmlXPathContextPtr ctx, char *base, resource_rule_t *rr) { @@ -389,7 +388,7 @@ _get_actions(xmlDocPtr doc, xmlXPathContextPtr ctx, char *base, snprintf(xpath, sizeof(xpath), "%s/action[%d]/@name", base, ++idx); - act = xpath_get_one(doc,ctx,xpath); + act = xpath_get_one(doc, ctx, xpath); if (!act) break; @@ -508,9 +507,9 @@ store_attribute(resource_attr_t **attrsp, char *name, char *value, int flags) @param flags set to 1 to note that it was defined inline @return 0 on success, nonzero on failure */ -int -store_childtype(resource_child_t **childp, char *name, int start, int stop, - int forbid, int flags) +static int +store_childtype(resource_child_t **childp, char *name, int start, + int stop, int forbid, int flags) { int x = 0; resource_child_t *child = *childp; @@ -683,7 +682,7 @@ children: @param rr Resource rule to store new information in. @return 0 */ -int +static int _get_rule_attrs(xmlDocPtr doc, xmlXPathContextPtr ctx, char *base, resource_rule_t *rr) { @@ -811,7 +810,7 @@ _get_rule_attrs(xmlDocPtr doc, xmlXPathContextPtr ctx, char *base, @param rr Resource rule to store new information in. @return 0 */ -int +static int _get_childtypes(xmlDocPtr doc, xmlXPathContextPtr ctx, char *base, resource_rule_t *rr) { @@ -876,7 +875,7 @@ _get_childtypes(xmlDocPtr doc, xmlXPathContextPtr ctx, char *base, /** Read a file from a stdout pipe. */ -int +static int read_pipe(int fd, char **file, size_t *length) { char buf[4096]; @@ -924,7 +923,7 @@ read_pipe(int fd, char **file, size_t *length) } -xmlDocPtr +static xmlDocPtr read_resource_agent_metadata(char *filename) { int pid; @@ -984,7 +983,7 @@ read_resource_agent_metadata(char *filename) @param rules Rule list to add new rules to @return 0 */ -int +static int load_resource_rulefile(char *filename, resource_rule_t **rules) { resource_rule_t *rr = NULL; @@ -1161,7 +1160,7 @@ load_resource_rules(const char *rpath, resource_rule_t **rules) @return Resource rule or NULL if not found. */ resource_rule_t * -find_rule_by_type(resource_rule_t **rulelist, char *type) +find_rule_by_type(resource_rule_t **rulelist, const char *type) { resource_rule_t *curr = NULL;