This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
cluster: STABLE3 - rgmanager: Fix reslist.c complier warnings
- From: Lon Hohberger <lon at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Mon, 22 Jun 2009 13:33:07 +0000 (UTC)
- Subject: cluster: STABLE3 - rgmanager: Fix reslist.c complier warnings
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=9a6b6c07462a2cc4c70b67d1dd5883fb002d60dd
Commit: 9a6b6c07462a2cc4c70b67d1dd5883fb002d60dd
Parent: 4c8e23f2d89389591fc3b357113cc253abf81291
Author: Lon Hohberger <lhh@redhat.com>
AuthorDate: Tue Jun 16 14:01:33 2009 -0400
Committer: Lon Hohberger <lhh@redhat.com>
CommitterDate: Mon Jun 22 09:32:03 2009 -0400
rgmanager: Fix reslist.c complier warnings
Signed-off-by: Lon Hohberger <lhh@redhat.com>
---
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 <logging.h>
#endif
+#include <groups.h>
-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