This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: STABLE3 - cman: fix more uint -> hdb_handle_t breakage


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0b26419b4b0af310fb084e872143d988199cd648
Commit:        0b26419b4b0af310fb084e872143d988199cd648
Parent:        057dadd19515b5e64a1f184ff70a3b8d2367995d
Author:        Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate:    Thu Mar 12 17:15:50 2009 +0100
Committer:     Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Thu Mar 12 17:15:50 2009 +0100

cman: fix more uint -> hdb_handle_t breakage

also fix a build warning strict aliasing

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
 cman/daemon/cman-preconfig.c |   16 +++++++---------
 cman/daemon/nodelist.h       |   10 +++++-----
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index 948a3a9..05f9cb4 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -116,21 +116,19 @@ static char *priority_name_get (unsigned int priority)
 static int ipaddr_equal(struct sockaddr_storage *addr1, struct sockaddr_storage *addr2)
 {
 	int addrlen = 0;
-	struct sockaddr *saddr1 = (struct sockaddr *)addr1;
-	struct sockaddr *saddr2 = (struct sockaddr *)addr2;
 
-	if (saddr1->sa_family != saddr2->sa_family)
+	if (addr1->ss_family != addr2->ss_family)
 		return 0;
 
-	if (saddr1->sa_family == AF_INET) {
+	if (addr1->ss_family == AF_INET) {
 		addrlen = sizeof(struct sockaddr_in);
 	}
-	if (saddr1->sa_family == AF_INET6) {
+	if (addr1->ss_family == AF_INET6) {
 		addrlen = sizeof(struct sockaddr_in6);
 	}
 	assert(addrlen);
 
-	if (memcmp(saddr1, saddr2, addrlen) == 0)
+	if (memcmp(addr1, addr2, addrlen) == 0)
 		return 1;
 	else
 		return 0;
@@ -198,7 +196,7 @@ static int address_family(char *addr, struct sockaddr_storage *ssaddr, int famil
 /* Find the "CMAN" logger_subsys object. Or create one if it does not
    exist
 */
-static unsigned int find_cman_logger(struct objdb_iface_ver0 *objdb, unsigned int object_handle)
+static hdb_handle_t find_cman_logger(struct objdb_iface_ver0 *objdb, hdb_handle_t object_handle)
 {
 	hdb_handle_t subsys_handle;
 	hdb_handle_t find_handle;
@@ -951,7 +949,7 @@ static int set_noccs_defaults(struct objdb_iface_ver0 *objdb)
 }
 
 /* Move an object/key tree */
-static int copy_config_tree(struct objdb_iface_ver0 *objdb, unsigned int source_object, unsigned int target_parent_object, int always_create)
+static int copy_config_tree(struct objdb_iface_ver0 *objdb, hdb_handle_t source_object, hdb_handle_t target_parent_object, int always_create)
 {
 	hdb_handle_t object_handle;
 	hdb_handle_t new_object;
@@ -985,7 +983,7 @@ static int copy_config_tree(struct objdb_iface_ver0 *objdb, unsigned int source_
 	/* Create sub-objects */
 	res = objdb->object_find_create(source_object, NULL, 0, &find_handle);
 	if (res) {
-		sprintf(error_reason, "error resetting object iterator for object %d: %d\n", source_object, res);
+		sprintf(error_reason, "error resetting object iterator for object %ud: %d\n", (unsigned int)source_object, res);
 		return -1;
 	}
 
diff --git a/cman/daemon/nodelist.h b/cman/daemon/nodelist.h
index b91382f..6269f71 100644
--- a/cman/daemon/nodelist.h
+++ b/cman/daemon/nodelist.h
@@ -1,5 +1,5 @@
 /* These just make the access a little neater */
-static inline int objdb_get_string(OBJDB_API *corosync, unsigned int object_service_handle,
+static inline int objdb_get_string(OBJDB_API *corosync, hdb_handle_t object_service_handle,
 				   char *key, char **value)
 {
 	int res;
@@ -16,7 +16,7 @@ static inline int objdb_get_string(OBJDB_API *corosync, unsigned int object_serv
 	return -1;
 }
 
-static inline void objdb_get_int(OBJDB_API *corosync, unsigned int object_service_handle,
+static inline void objdb_get_int(OBJDB_API *corosync, hdb_handle_t object_service_handle,
 				 char *key, unsigned int *intvalue, unsigned int default_value)
 {
 	char *value = NULL;
@@ -33,7 +33,7 @@ static inline void objdb_get_int(OBJDB_API *corosync, unsigned int object_servic
 
 
 /* Helper functions for navigating the nodes list */
-static inline unsigned int nodeslist_init(OBJDB_API *corosync,
+static inline hdb_handle_t nodeslist_init(OBJDB_API *corosync,
 					  hdb_handle_t cluster_parent_handle,
 					  hdb_handle_t *find_handle)
 {
@@ -58,7 +58,7 @@ static inline unsigned int nodeslist_init(OBJDB_API *corosync,
 	return 0;
 }
 
-static inline unsigned int nodeslist_next(OBJDB_API *corosync, hdb_handle_t find_handle)
+static inline hdb_handle_t nodeslist_next(OBJDB_API *corosync, hdb_handle_t find_handle)
 {
         hdb_handle_t nodes_handle;
 
@@ -68,7 +68,7 @@ static inline unsigned int nodeslist_next(OBJDB_API *corosync, hdb_handle_t find
 		return 0;
 }
 
-static inline unsigned int nodelist_byname(OBJDB_API *corosync,
+static inline hdb_handle_t nodelist_byname(OBJDB_API *corosync,
 					   hdb_handle_t cluster_parent_handle,
 					   char *name)
 {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]