From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32616 invoked by alias); 27 Apr 2009 12:12:51 -0000 Received: (qmail 32610 invoked by alias); 27 Apr 2009 12:12:51 -0000 X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63,J_CHICKENPOX_64,J_CHICKENPOX_83,J_CHICKENPOX_84,SPF_HELO_PASS X-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63,J_CHICKENPOX_64,J_CHICKENPOX_83,J_CHICKENPOX_84,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: master - libccs: fix several build warnings To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: d1956595c749902743e1f54dc4df2c16083d052a X-Git-Newrev: 0eaa0d1dfa4d74d67a3e29cfb1ff81592101ca3e From: "Fabio M. Di Nitto" Message-Id: <20090427121225.014031202D2@lists.fedorahosted.org> Date: Mon, 27 Apr 2009 12:12: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/msg00112.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0eaa0d1dfa4d74d67a3e29cfb1ff81592101ca3e Commit: 0eaa0d1dfa4d74d67a3e29cfb1ff81592101ca3e Parent: d1956595c749902743e1f54dc4df2c16083d052a Author: Fabio M. Di Nitto AuthorDate: Mon Apr 27 14:10:50 2009 +0200 Committer: Fabio M. Di Nitto 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 --- 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),