cluster: master - libccs: fix several build warnings

Fabio M. Di Nitto fabbione@fedoraproject.org
Mon Apr 27 12:12:00 GMT 2009


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0eaa0d1dfa4d74d67a3e29cfb1ff81592101ca3e
Commit:        0eaa0d1dfa4d74d67a3e29cfb1ff81592101ca3e
Parent:        d1956595c749902743e1f54dc4df2c16083d052a
Author:        Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate:    Mon Apr 27 14:10:50 2009 +0200
Committer:     Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Mon Apr 27 14:12:17 2009 +0200

libccs: fix several build warnings

fix shadow and const warnings.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
 config/libs/libccsconfdb/ccs_internal.h |    4 ++--
 config/libs/libccsconfdb/extras.c       |    8 ++++----
 config/libs/libccsconfdb/libccs.c       |   10 +++++-----
 config/libs/libccsconfdb/xpathlite.c    |   14 +++++++-------
 4 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/config/libs/libccsconfdb/ccs_internal.h b/config/libs/libccsconfdb/ccs_internal.h
index fd8d037..617f9e7 100644
--- a/config/libs/libccsconfdb/ccs_internal.h
+++ b/config/libs/libccsconfdb/ccs_internal.h
@@ -10,7 +10,7 @@ int get_previous_query(confdb_handle_t handle, hdb_handle_t connection_handle,
 		       char *previous_query, hdb_handle_t *query_handle)
     __attribute__ ((visibility("hidden")));
 int set_previous_query(confdb_handle_t handle, hdb_handle_t connection_handle,
-		       char *previous_query, hdb_handle_t query_handle)
+		       const char *previous_query, hdb_handle_t query_handle)
     __attribute__ ((visibility("hidden")));
 
 /* from xpathlite.c */
@@ -24,6 +24,6 @@ char *_ccs_get_fullxpath(confdb_handle_t handle, hdb_handle_t connection_handle,
     __attribute__ ((visibility("hidden")));
 int xpathfull_init(confdb_handle_t handle)
     __attribute__ ((visibility("hidden")));
-void xpathfull_finish() __attribute__ ((visibility("hidden")));
+void xpathfull_finish(void) __attribute__ ((visibility("hidden")));
 
 #endif /*  __CCS_INTERNAL_DOT_H__ */
diff --git a/config/libs/libccsconfdb/extras.c b/config/libs/libccsconfdb/extras.c
index 3dd368a..c4a75f4 100644
--- a/config/libs/libccsconfdb/extras.c
+++ b/config/libs/libccsconfdb/extras.c
@@ -223,7 +223,7 @@ static int priority_id_get(char *name)
 }
 
 /* requires string buffer to be PATH_MAX */
-static void read_string(int fd, char *path, char *string)
+static void read_string(int fd, const char *path, char *string)
 {
 	char *str;
 	int error;
@@ -239,7 +239,7 @@ static void read_string(int fd, char *path, char *string)
 	free(str);
 }
 
-static void read_yesno(int fd, char *path, int *yes, int *no)
+static void read_yesno(int fd, const char *path, int *yes, int *no)
 {
 	char *str;
 	int error;
@@ -259,7 +259,7 @@ static void read_yesno(int fd, char *path, int *yes, int *no)
 	free(str);
 }
 
-static void read_onoff(int fd, char *path, int *on, int *off)
+static void read_onoff(int fd, const char *path, int *on, int *off)
 {
 	char *str;
 	int error;
@@ -280,7 +280,7 @@ static void read_onoff(int fd, char *path, int *on, int *off)
 }
 
 /* requires path buffer to be PATH_MAX */
-static void create_daemon_path(char *name, char *field, char *path)
+static void create_daemon_path(const char *name, const char *field, char *path)
 {
 	memset(path, 0, PATH_MAX);
 	snprintf(path, PATH_MAX,
diff --git a/config/libs/libccsconfdb/libccs.c b/config/libs/libccsconfdb/libccs.c
index 05d08c3..1d62b4b 100644
--- a/config/libs/libccsconfdb/libccs.c
+++ b/config/libs/libccsconfdb/libccs.c
@@ -219,7 +219,7 @@ static int config_reload(confdb_handle_t handle,
 }
 
 static hdb_handle_t create_ccs_handle(confdb_handle_t handle, int ccs_handle,
-				      int fullxpath)
+				      int xpath)
 {
 	hdb_handle_t libccs_handle = 0, connection_handle = 0;
 	char buf[128];
@@ -260,7 +260,7 @@ static hdb_handle_t create_ccs_handle(confdb_handle_t handle, int ccs_handle,
 	}
 
 	memset(buf, 0, sizeof(buf));
-	snprintf(buf, sizeof(buf), "%d", fullxpath);
+	snprintf(buf, sizeof(buf), "%d", xpath);
 	if (confdb_key_create
 	    (handle, connection_handle, "fullxpath", strlen("fullxpath"), buf,
 	     strlen(buf) + 1) != CS_OK) {
@@ -273,7 +273,7 @@ static hdb_handle_t create_ccs_handle(confdb_handle_t handle, int ccs_handle,
 }
 
 static hdb_handle_t get_ccs_handle(confdb_handle_t handle, int *ccs_handle,
-				   int fullxpath)
+				   int xpath)
 {
 	unsigned int next_handle;
 	hdb_handle_t libccs_handle = 0;
@@ -286,7 +286,7 @@ static hdb_handle_t get_ccs_handle(confdb_handle_t handle, int *ccs_handle,
 	if (confdb_key_increment
 	    (handle, libccs_handle, "next_handle", strlen("next_handle"),
 	     &next_handle) == CS_OK) {
-		ret = create_ccs_handle(handle, (int)next_handle, fullxpath);
+		ret = create_ccs_handle(handle, (int)next_handle, xpath);
 		if (ret == -1) {
 			*ccs_handle = -1;
 			return ret;
@@ -321,7 +321,7 @@ int get_previous_query(confdb_handle_t handle, hdb_handle_t connection_handle,
 }
 
 int set_previous_query(confdb_handle_t handle, hdb_handle_t connection_handle,
-		       char *previous_query, hdb_handle_t query_handle)
+		       const char *previous_query, hdb_handle_t query_handle)
 {
 	char temp[PATH_MAX];
 	size_t templen = 0;
diff --git a/config/libs/libccsconfdb/xpathlite.c b/config/libs/libccsconfdb/xpathlite.c
index 0c3a46d..0a21f85 100644
--- a/config/libs/libccsconfdb/xpathlite.c
+++ b/config/libs/libccsconfdb/xpathlite.c
@@ -12,7 +12,7 @@
 
 static int tokenizer(char *current_query)
 {
-	int index = 0;
+	int tokens = 0;
 	char *curpos = current_query;
 	char *next = NULL;
 	char *end;
@@ -20,7 +20,7 @@ static int tokenizer(char *current_query)
 	end = current_query + strlen(current_query);
 
 	while (curpos <= end) {
-		index++;
+		tokens++;
 
 		if (strncmp(curpos, "/", 1)) {
 			errno = EINVAL;
@@ -37,7 +37,7 @@ static int tokenizer(char *current_query)
 		}
 
 		if (!next)
-			return index;
+			return tokens;
 
 		if ((strstr(curpos, "[") > next) || !strstr(curpos, "["))
 			curpos = next;
@@ -109,7 +109,7 @@ static int path_dive(confdb_handle_t handle, hdb_handle_t *query_handle,
 			memset(end, 0, 1);
 
 			if (!strcmp(pos, "child::*")) {
-				int val, i;
+				int val, j;
 
 				val = atoi(middle);
 
@@ -120,7 +120,7 @@ static int path_dive(confdb_handle_t handle, hdb_handle_t *query_handle,
 				    (handle, *query_handle) != CS_OK)
 					goto fail;
 
-				for (i = 1; i <= val; i++) {
+				for (j = 1; j <= val; j++) {
 					if (confdb_object_iter
 					    (handle, *query_handle,
 					     &new_obj_handle, data,
@@ -135,14 +135,14 @@ static int path_dive(confdb_handle_t handle, hdb_handle_t *query_handle,
 
 			} else if (!strstr(middle, "@")) {
 				/* lookup something with index num = int */
-				int val, i;
+				int val, j;
 
 				val = atoi(middle);
 
 				if (val < 1)
 					goto fail;
 
-				for (i = 1; i <= val; i++) {
+				for (j = 1; j <= val; j++) {
 					if (confdb_object_find
 					    (handle, *query_handle, pos,
 					     strlen(pos),



More information about the Cluster-cvs mailing list