From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29373 invoked by alias); 22 Jun 2009 16:55:09 -0000 Received: (qmail 29367 invoked by alias); 22 Jun 2009 16:55:08 -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: rgmanager: master - rgmanager: Fix reslist.c complier warnings To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: rgmanager.git X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 6bdd86e067057fe2ce85bfb200a94bf74994fefe X-Git-Newrev: 00d81b51749d0ea23a5b5111ca1f4d277f55152b From: Lon Hohberger Message-Id: <20090622165422.268D412020D@lists.fedorahosted.org> Date: Mon, 22 Jun 2009 16:55: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/msg00643.txt.bz2 Gitweb: http://git.fedorahosted.org/git/rgmanager.git?p=rgmanager.git;a=commitdiff;h=00d81b51749d0ea23a5b5111ca1f4d277f55152b Commit: 00d81b51749d0ea23a5b5111ca1f4d277f55152b Parent: 6bdd86e067057fe2ce85bfb200a94bf74994fefe Author: Lon Hohberger AuthorDate: Tue Jun 16 14:01:33 2009 -0400 Committer: Lon Hohberger CommitterDate: Mon Jun 22 12:51:41 2009 -0400 rgmanager: Fix reslist.c complier warnings Signed-off-by: Lon Hohberger --- rgmanager/src/daemons/reslist.c | 35 ++++++++++++++++------------------- 1 files changed, 16 insertions(+), 19 deletions(-) diff --git a/rgmanager/src/daemons/reslist.c b/rgmanager/src/daemons/reslist.c index 1a1f0dc..f663de5 100644 --- a/rgmanager/src/daemons/reslist.c +++ b/rgmanager/src/daemons/reslist.c @@ -15,11 +15,9 @@ #ifndef NO_CCS #include #endif +#include -char *attr_value(resource_node_t *node, char *attrname); -char *rg_attr_value(resource_node_t *node, char *attrname); - void res_build_name(char *buf, size_t buflen, resource_t *res) { @@ -34,7 +32,7 @@ res_build_name(char *buf, size_t buflen, resource_t *res) @param attrname Attribute to retrieve. @return value of attribute or NULL if not found */ -char * +const char * res_attr_value(resource_t *res, const char *attrname) { resource_attr_t *ra; @@ -67,7 +65,7 @@ res_attr_value(resource_t *res, const char *attrname) @return value of attribute or NULL if not found */ static char * -_attr_value(resource_node_t *node, char *attrname, char *ptype) +_attr_value(resource_node_t *node, const char *attrname, const char *ptype) { resource_t *res; resource_attr_t *ra; @@ -118,8 +116,8 @@ _attr_value(resource_node_t *node, char *attrname, char *ptype) } -char * -attr_value(resource_node_t *node, char *attrname) +const char * +attr_value(resource_node_t *node, const char *attrname) { return _attr_value(node, attrname, NULL); } @@ -129,15 +127,15 @@ attr_value(resource_node_t *node, char *attrname) Run to the top of the tree. Used to determine certain attributes of the resource group in-line, during resource tree operations. */ -char * -rg_attr_value(resource_node_t *node, char *attrname) +const char * +rg_attr_value(resource_node_t *node, const char *attrname) { for (; node->rn_parent; node = node->rn_parent); return res_attr_value(node->rn_resource, attrname); } -char * +const char * primary_attr_value(resource_t *res) { int x; @@ -156,7 +154,6 @@ primary_attr_value(resource_t *res) } - /** Compare two resources. @@ -257,7 +254,7 @@ rescmp(resource_t *left, resource_t *right) @return Resource matching type/ref or NULL if none. */ resource_t * -find_resource_by_ref(resource_t **reslist, char *type, char *ref) +find_resource_by_ref(resource_t **reslist, const char *type, const char *ref) { resource_t *curr; int x; @@ -300,7 +297,7 @@ find_root_by_ref(resource_t **reslist, const char *ref) resource_t *curr; char ref_buf[128]; char *type; - char *name = ref; + char *name = (char *)ref; int x; snprintf(ref_buf, sizeof(ref_buf), "%s", ref); @@ -311,8 +308,8 @@ find_root_by_ref(resource_t **reslist, const char *ref) name++; } else { /* Default type */ - type = "service"; - name = ref; + type = (char *)"service"; + name = (char *)ref; } list_do(reslist, curr) { @@ -431,9 +428,9 @@ store_resource(resource_t **reslist, resource_t *newres) @param query Query to execute. @return newly allocated pointer to value or NULL if not found. */ -char * +const char * xpath_get_one(xmlDocPtr __attribute__ ((unused)) doc, - xmlXPathContextPtr ctx, char *query) + xmlXPathContextPtr ctx, const char *query) { char *val = NULL, *ret = NULL; xmlXPathObjectPtr obj; @@ -605,7 +602,7 @@ print_resource(resource_t *res) } -void * +static void * act_dup(resource_act_t *acts) { int x; @@ -627,7 +624,7 @@ act_dup(resource_act_t *acts) /* Copied from resrules.c -- _get_actions */ -void +static void #ifndef NO_CCS _get_actions_ccs(int ccsfd, char *base, resource_t *res) #else