Sfoglia il codice sorgente

Clean up warnings found with -pedantic.

(Logical change 1.30)


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@94 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake 21 anni fa
parent
commit
447bfc6813
17 ha cambiato i file con 140 aggiunte e 140 eliminazioni
  1. 1 1
      exec/Makefile
  2. 4 4
      exec/aispoll.c
  3. 21 23
      exec/amf.c
  4. 38 41
      exec/ckpt.c
  5. 10 13
      exec/clm.c
  6. 13 11
      exec/gmi.c
  7. 4 5
      exec/main.c
  8. 6 4
      exec/parse.c
  9. 3 2
      exec/parse.h
  10. 0 5
      include/ais_msg.h
  11. 3 4
      include/ais_types.h
  12. 1 1
      include/list.h
  13. 1 0
      include/queue.h
  14. 4 4
      lib/amf.c
  15. 24 17
      lib/ckpt.c
  16. 4 4
      lib/clm.c
  17. 3 1
      lib/util.c

+ 1 - 1
exec/Makefile

@@ -33,7 +33,7 @@
 #LDFLAGS = 
 
 # Debug mode flags
-CFLAGS = -g -Wall 
+CFLAGS = -g -Wall
 #-DDEBUG
 LDFLAGS = -g
 

+ 4 - 4
exec/aispoll.c

@@ -172,10 +172,10 @@ int handle_convert (
  * All instances in one database
  */
 static struct handle_database poll_instance_database = {
-        handle_count: 0,
-        handles: 0,
-        generation: 0,
-        mutex: PTHREAD_MUTEX_INITIALIZER
+        .handle_count	= 0,
+        .handles		= 0,
+        .generation		= 0,
+        .mutex			= PTHREAD_MUTEX_INITIALIZER
 };
 
 poll_handle poll_create (void)

+ 21 - 23
exec/amf.c

@@ -32,12 +32,10 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/types.h>
+#include <sys/uio.h>
 #include <sys/socket.h>
 #include <sys/un.h>
-#include <sys/sysinfo.h>
 #include <netinet/in.h>
-#include <linux/if.h>
-#include <linux/sockios.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <stdlib.h>
@@ -113,13 +111,13 @@ enum amfDisabledLockedState {
 	AMF_DISABLED_LOCKED_QUIESCED_REQUESTED,
 	AMF_DISABLED_LOCKED_QUIESCED_COMPLETED,
 	AMF_DISABLED_LOCKED_OUT_OF_SERVICE_REQUESTED
-	AMF_DISABLED_LOCKED_OUT_OF_SERVICE_COMPLETED,
+	AMF_DISABLED_LOCKED_OUT_OF_SERVICE_COMPLETED
 };
 
 enum amfEnabledStoppingState {
 	AMF_ENABLED_STOPPING_INITIAL,
 	AMF_ENABLED_STOPPING_STOPPING_REQUESTED,
-	AMF_ENABLED_STOPPING_STOPPING_COMPLETED,
+	AMF_ENABLED_STOPPING_STOPPING_COMPLETED
 };
 
 /*
@@ -291,14 +289,14 @@ int (*amf_aisexec_handler_fns[]) (void *) = {
  * Exports the interface for the service
  */
 struct service_handler amf_service_handler = {
-	libais_handler_fns:			amf_libais_handler_fns,
-	libais_handler_fns_count:	sizeof (amf_libais_handler_fns) / sizeof (int (*)),
-	aisexec_handler_fns:		amf_aisexec_handler_fns,
-	aisexec_handler_fns_count:	sizeof (amf_aisexec_handler_fns) / sizeof (int (*)),
-	confchg_fn:					0,
-	libais_init_fn:				message_handler_req_amf_init,
-	libais_exit_fn:				amf_exit_fn,
-	aisexec_init_fn:			amfExecutiveInitialize
+	.libais_handler_fns			=	amf_libais_handler_fns,
+	.libais_handler_fns_count	= sizeof (amf_libais_handler_fns) / sizeof (int (*)),
+	.aisexec_handler_fns		= amf_aisexec_handler_fns,
+	.aisexec_handler_fns_count	= sizeof (amf_aisexec_handler_fns) / sizeof (int (*)),
+	.confchg_fn					= 0,
+	.libais_init_fn				= message_handler_req_amf_init,
+	.libais_exit_fn				= amf_exit_fn,
+	.aisexec_init_fn			= amfExecutiveInitialize
 };
 
 static void grow_amf_track_table (struct conn_info *conn_info, int growby)
@@ -407,7 +405,7 @@ void componentUnregister (
 		&component->name,
 		sizeof (SaNameT));
 
-	iovecs[0].iov_base = &req_exec_amf_componentunregister;
+	iovecs[0].iov_base = (char *)&req_exec_amf_componentunregister;
 	iovecs[0].iov_len = sizeof (req_exec_amf_componentunregister);
 
 	gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
@@ -631,7 +629,7 @@ void haStateSetCluster (
 	log_printf (LOG_LEVEL_DEBUG, "Sending ha state to cluster for component %s\n", getSaNameT (&component->name));
 	log_printf (LOG_LEVEL_DEBUG, "ha state is %d\n", haState);
 
-	iovecs[0].iov_base = &req_exec_amf_hastateset;
+	iovecs[0].iov_base = (char *)&req_exec_amf_hastateset;
 	iovecs[0].iov_len = sizeof (req_exec_amf_hastateset);
 
 	gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
@@ -724,7 +722,7 @@ void readinessStateSetCluster (
 		getSaNameT (&component->name));
 	log_printf (LOG_LEVEL_DEBUG, "readiness state is %d\n", readinessState);
 
-	iovecs[0].iov_base = &req_exec_amf_readinessstateset;
+	iovecs[0].iov_base = (char *)&req_exec_amf_readinessstateset;
 	iovecs[0].iov_len = sizeof (req_exec_amf_readinessstateset);
 
 	gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
@@ -1243,7 +1241,7 @@ void errorReport (
 		sizeof (SaNameT));
 	req_exec_amf_errorreport.req_lib_amf_errorreport.errorDescriptor.probableCause = probableCause;
 
-	iovecs[0].iov_base = &req_exec_amf_errorreport;
+	iovecs[0].iov_base = (char *)&req_exec_amf_errorreport;
 	iovecs[0].iov_len = sizeof (req_exec_amf_errorreport);
 
 	gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
@@ -1926,7 +1924,7 @@ static int message_handler_req_amf_componentregister (struct conn_info *conn_inf
 		req_lib_amf_componentregister,
 		sizeof (struct req_lib_amf_componentregister));
 
-	iovecs[0].iov_base = &req_exec_amf_componentregister;
+	iovecs[0].iov_base = (char *)&req_exec_amf_componentregister;
 	iovecs[0].iov_len = sizeof (req_exec_amf_componentregister);
 
 	result = gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
@@ -1956,7 +1954,7 @@ static int message_handler_req_amf_componentunregister (struct conn_info *conn_i
 	if (component && component->registered && component->local) {
 		component->probableCause = SA_AMF_NOT_RESPONDING;
 	}
-	iovecs[0].iov_base = &req_exec_amf_componentunregister;
+	iovecs[0].iov_base = (char *)&req_exec_amf_componentunregister;
 	iovecs[0].iov_len = sizeof (req_exec_amf_componentunregister);
 
 	result = gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
@@ -2133,11 +2131,11 @@ static int message_handler_req_amf_errorreport (struct conn_info *conn_info, voi
 		req_lib_amf_errorreport,
 		sizeof (struct req_lib_amf_errorreport));
 
-	iovecs[0].iov_base = &req_exec_amf_errorreport;
+	iovecs[0].iov_base = (char *)&req_exec_amf_errorreport;
 	iovecs[0].iov_len = sizeof (req_exec_amf_errorreport);
 //	iovecs[0].iov_len = sizeof (req_exec_amf_errorreport) - sizeof (req_lib_amf_errorreport);
 
-//	iovecs[1].iov_base = &req_lib_amf_errorreport;
+//	iovecs[1].iov_base = (char *)&req_lib_amf_errorreport;
 //	iovecs[1].iov_len = sizeof (req_lib_amf_errorreport);
 
 	result = gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
@@ -2163,11 +2161,11 @@ static int message_handler_req_amf_errorcancelall (struct conn_info *conn_info,
 		req_lib_amf_errorcancelall,
 		sizeof (struct req_lib_amf_errorcancelall));
 
-	iovecs[0].iov_base = &req_exec_amf_errorcancelall;
+	iovecs[0].iov_base = (char *)&req_exec_amf_errorcancelall;
 	iovecs[0].iov_len = sizeof (req_exec_amf_errorcancelall);
 //	iovecs[0].iov_len = sizeof (req_exec_amf_errorcancelall) - sizeof (req_lib_amf_errorcancelall);
 
-//	iovecs[1].iov_base = &req_lib_amf_errorcancelall;
+//	iovecs[1].iov_base = (char *)&req_lib_amf_errorcancelall;
 //	iovecs[1].iov_len = sizeof (req_lib_amf_errorcancelall);
 
 	result = gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);

+ 38 - 41
exec/ckpt.c

@@ -32,12 +32,10 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/types.h>
+#include <sys/uio.h>
 #include <sys/socket.h>
 #include <sys/un.h>
-#include <sys/sysinfo.h>
 #include <netinet/in.h>
-#include <linux/if.h>
-#include <linux/sockios.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <stdlib.h>
@@ -144,14 +142,14 @@ int (*ckpt_aisexec_handler_fns[]) (void *) = {
  * exported service
  */
 struct service_handler ckpt_service_handler = {
-	libais_handler_fns:			ckpt_libais_handler_fns,
-	libais_handler_fns_count:	sizeof (ckpt_libais_handler_fns) / sizeof (int (*)),
-	aisexec_handler_fns:		ckpt_aisexec_handler_fns ,
-	aisexec_handler_fns_count:	sizeof (ckpt_aisexec_handler_fns) / sizeof (int (*)),
-	confchg_fn:					0, /* ckpt service handler is not distributed */
-	libais_init_fn:				message_handler_req_lib_ckpt_init,
-	libais_exit_fn:				0,
-	aisexec_init_fn:			0
+	.libais_handler_fns			= ckpt_libais_handler_fns,
+	.libais_handler_fns_count	= sizeof (ckpt_libais_handler_fns) / sizeof (int (*)),
+	.aisexec_handler_fns		= ckpt_aisexec_handler_fns ,
+	.aisexec_handler_fns_count	= sizeof (ckpt_aisexec_handler_fns) / sizeof (int (*)),
+	.confchg_fn					= 0, /* ckpt service handler is not distributed */
+	.libais_init_fn				= message_handler_req_lib_ckpt_init,
+	.libais_exit_fn				= 0,
+	.aisexec_init_fn			= 0
 };
 
 static int (*ckpt_checkpoint_libais_handler_fns[]) (struct conn_info *conn_info, void *) = {
@@ -186,14 +184,14 @@ static int (*ckpt_checkpoint_aisexec_handler_fns[]) (void *msg) = {
 };
 
 struct service_handler ckpt_checkpoint_service_handler = {
-	libais_handler_fns:			ckpt_checkpoint_libais_handler_fns,
-	libais_handler_fns_count:	sizeof (ckpt_checkpoint_libais_handler_fns) / sizeof (int (*)),
-	aisexec_handler_fns:		ckpt_checkpoint_aisexec_handler_fns ,
-	aisexec_handler_fns_count:	sizeof (ckpt_checkpoint_aisexec_handler_fns) / sizeof (int (*)),
-	confchg_fn:					ckptConfChg,
-	libais_init_fn:				message_handler_req_lib_ckpt_checkpoint_init,
-	libais_exit_fn:				ckptCheckpointApiFinalize,
-	aisexec_init_fn:			0
+	.libais_handler_fns			= ckpt_checkpoint_libais_handler_fns,
+	.libais_handler_fns_count	= sizeof (ckpt_checkpoint_libais_handler_fns) / sizeof (int (*)),
+	.aisexec_handler_fns		= ckpt_checkpoint_aisexec_handler_fns ,
+	.aisexec_handler_fns_count	= sizeof (ckpt_checkpoint_aisexec_handler_fns) / sizeof (int (*)),
+	.confchg_fn					= ckptConfChg,
+	.libais_init_fn				= message_handler_req_lib_ckpt_checkpoint_init,
+	.libais_exit_fn				= ckptCheckpointApiFinalize,
+	.aisexec_init_fn			= 0
 };
 
 static int (*ckpt_sectioniterator_libais_handler_fns[]) (struct conn_info *conn_info, void *) = {
@@ -206,14 +204,14 @@ static int (*ckpt_sectioniterator_aisexec_handler_fns[]) (void *msg) = {
 };
 
 struct service_handler ckpt_sectioniterator_service_handler = {
-	libais_handler_fns:			ckpt_sectioniterator_libais_handler_fns,
-	libais_handler_fns_count:	sizeof (ckpt_sectioniterator_libais_handler_fns) / sizeof (int (*)),
-	aisexec_handler_fns:		ckpt_sectioniterator_aisexec_handler_fns ,
-	aisexec_handler_fns_count:	sizeof (ckpt_sectioniterator_aisexec_handler_fns) / sizeof (int (*)),
-	confchg_fn:					0, /* Section Iterators are not distributed */
-	libais_init_fn:				message_handler_req_lib_ckpt_sectioniterator_init,
-	libais_exit_fn:				ckptSectionIteratorApiFinalize,
-	aisexec_init_fn:			0
+	.libais_handler_fns			= ckpt_sectioniterator_libais_handler_fns,
+	.libais_handler_fns_count	= sizeof (ckpt_sectioniterator_libais_handler_fns) / sizeof (int (*)),
+	.aisexec_handler_fns		= ckpt_sectioniterator_aisexec_handler_fns ,
+	.aisexec_handler_fns_count	= sizeof (ckpt_sectioniterator_aisexec_handler_fns) / sizeof (int (*)),
+	.confchg_fn					= 0, /* Section Iterators are not distributed */
+	.libais_init_fn				= message_handler_req_lib_ckpt_sectioniterator_init,
+	.libais_exit_fn				= ckptSectionIteratorApiFinalize,
+	.aisexec_init_fn			= 0
 };
 
 static struct saCkptCheckpoint *findCheckpoint (SaNameT *name)
@@ -279,7 +277,7 @@ void sendCkptCheckpointClose (struct saCkptCheckpoint *checkpoint) {
 		&checkpoint->name,
 		sizeof (SaNameT));
 
-	iovecs[0].iov_base = &req_exec_ckpt_checkpointclose;
+	iovecs[0].iov_base = (char *)&req_exec_ckpt_checkpointclose;
 	iovecs[0].iov_len = sizeof (req_exec_ckpt_checkpointclose);
 
 	result = gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
@@ -729,7 +727,6 @@ error_exit:
 	return (0);
 }
 
-int exec_section_write = 0;
 static int message_handler_req_exec_ckpt_sectionwrite (void *message) {
 	struct req_exec_ckpt_sectionwrite *req_exec_ckpt_sectionwrite = (struct req_exec_ckpt_sectionwrite *)message;
 	struct req_lib_ckpt_sectionwrite *req_lib_ckpt_sectionwrite = (struct req_lib_ckpt_sectionwrite *)&req_exec_ckpt_sectionwrite->req_lib_ckpt_sectionwrite;
@@ -740,7 +737,7 @@ static int message_handler_req_exec_ckpt_sectionwrite (void *message) {
 	void *sectionData;
 	SaErrorT error = SA_OK;
 
-	log_printf (LOG_LEVEL_DEBUG, "Executive request to section write. %d\n", exec_section_write++);
+	log_printf (LOG_LEVEL_DEBUG, "Executive request to section write.\n");
 	ckptCheckpoint = findCheckpoint (&req_exec_ckpt_sectionwrite->checkpointName);
 	if (ckptCheckpoint == 0) {
 printf ("can't find checkpoint\n"); // TODO
@@ -1067,7 +1064,7 @@ static int message_handler_req_lib_ckpt_checkpointopen (struct conn_info *conn_i
 		req_lib_ckpt_checkpointopen,
 		sizeof (struct req_lib_ckpt_checkpointopen));
 
-	iovecs[0].iov_base = &req_exec_ckpt_checkpointopen;
+	iovecs[0].iov_base = (char *)&req_exec_ckpt_checkpointopen;
 	iovecs[0].iov_len = sizeof (req_exec_ckpt_checkpointopen);
 
 	result = gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
@@ -1100,7 +1097,7 @@ static int message_handler_req_lib_ckpt_checkpointunlink (struct conn_info *conn
 		req_lib_ckpt_checkpointunlink,
 		sizeof (struct req_lib_ckpt_checkpointunlink));
 
-	iovecs[0].iov_base = &req_exec_ckpt_checkpointunlink;
+	iovecs[0].iov_base = (char *)&req_exec_ckpt_checkpointunlink;
 	iovecs[0].iov_len = sizeof (req_exec_ckpt_checkpointunlink);
 
 	result = gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
@@ -1123,7 +1120,7 @@ static int message_handler_req_lib_ckpt_checkpointretentiondurationset (struct c
 		sizeof (SaNameT));
 	req_exec_ckpt_checkpointretentiondurationset.retentionDuration = req_lib_ckpt_checkpointretentiondurationset->retentionDuration;
 
-	iovecs[0].iov_base = &req_exec_ckpt_checkpointretentiondurationset;
+	iovecs[0].iov_base = (char *)&req_exec_ckpt_checkpointretentiondurationset;
 	iovecs[0].iov_len = sizeof (req_exec_ckpt_checkpointretentiondurationset);
 
 	gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
@@ -1223,7 +1220,7 @@ static int message_handler_req_lib_ckpt_sectioncreate (struct conn_info *conn_in
 	req_exec_ckpt_sectioncreate.source.conn_info = conn_info;
 	req_exec_ckpt_sectioncreate.source.in_addr.s_addr = this_ip.sin_addr.s_addr;
 
-	iovecs[0].iov_base = &req_exec_ckpt_sectioncreate;
+	iovecs[0].iov_base = (char *)&req_exec_ckpt_sectioncreate;
 	iovecs[0].iov_len = sizeof (req_exec_ckpt_sectioncreate);
 	/*
 	 * Send section name and initial data in message
@@ -1236,10 +1233,10 @@ printf ("LIBRARY SECTIONCREATE string is %s len is %d\n", (unsigned char *)iovec
 	iovecs[1].iov_len);
 printf ("|\n");
 { int i;
-	char *suck = iovecs[1].iov_base;
+	char *abc = iovecs[1].iov_base;
 for (i = 0; i < 14;i++) {
 
-	printf ("%c ", suck[i]);
+	printf ("%c ", abc[i]);
 }
 }
 printf ("|\n");
@@ -1277,7 +1274,7 @@ static int message_handler_req_lib_ckpt_sectiondelete (struct conn_info *conn_in
 	req_exec_ckpt_sectiondelete.source.conn_info = conn_info;
 	req_exec_ckpt_sectiondelete.source.in_addr.s_addr = this_ip.sin_addr.s_addr;
 
-	iovecs[0].iov_base = &req_exec_ckpt_sectiondelete;
+	iovecs[0].iov_base = (char *)&req_exec_ckpt_sectiondelete;
 	iovecs[0].iov_len = sizeof (req_exec_ckpt_sectiondelete);
 
 	/*
@@ -1318,7 +1315,7 @@ static int message_handler_req_lib_ckpt_sectionexpirationtimeset (struct conn_in
 	req_exec_ckpt_sectionexpirationtimeset.source.conn_info = conn_info;
 	req_exec_ckpt_sectionexpirationtimeset.source.in_addr.s_addr = this_ip.sin_addr.s_addr;
 
-	iovecs[0].iov_base = &req_exec_ckpt_sectionexpirationtimeset;
+	iovecs[0].iov_base = (char *)&req_exec_ckpt_sectionexpirationtimeset;
 	iovecs[0].iov_len = sizeof (req_exec_ckpt_sectionexpirationtimeset);
 
 	/*
@@ -1379,7 +1376,7 @@ static int message_handler_req_lib_ckpt_sectionwrite (struct conn_info *conn_inf
 	req_exec_ckpt_sectionwrite.source.conn_info = conn_info;
 	req_exec_ckpt_sectionwrite.source.in_addr.s_addr = this_ip.sin_addr.s_addr;
 
-	iovecs[0].iov_base = &req_exec_ckpt_sectionwrite;
+	iovecs[0].iov_base = (char *)&req_exec_ckpt_sectionwrite;
 	iovecs[0].iov_len = sizeof (req_exec_ckpt_sectionwrite);
 	/*
 	 * Send section name and data to write in message
@@ -1437,7 +1434,7 @@ static int message_handler_req_lib_ckpt_sectionoverwrite (struct conn_info *conn
 	req_exec_ckpt_sectionoverwrite.source.conn_info = conn_info;
 	req_exec_ckpt_sectionoverwrite.source.in_addr.s_addr = this_ip.sin_addr.s_addr;
 
-	iovecs[0].iov_base = &req_exec_ckpt_sectionoverwrite;
+	iovecs[0].iov_base = (char *)&req_exec_ckpt_sectionoverwrite;
 	iovecs[0].iov_len = sizeof (req_exec_ckpt_sectionoverwrite);
 	/*
 	 * Send section name and data to overwrite in message
@@ -1494,7 +1491,7 @@ static int message_handler_req_lib_ckpt_sectionread (struct conn_info *conn_info
 	req_exec_ckpt_sectionread.source.conn_info = conn_info;
 	req_exec_ckpt_sectionread.source.in_addr.s_addr = this_ip.sin_addr.s_addr;
 
-	iovecs[0].iov_base = &req_exec_ckpt_sectionread;
+	iovecs[0].iov_base = (char *)&req_exec_ckpt_sectionread;
 	iovecs[0].iov_len = sizeof (req_exec_ckpt_sectionread);
 	/*
 	 * Send section name and data to overwrite in message

+ 10 - 13
exec/clm.c

@@ -37,8 +37,7 @@
 #include <sys/sysinfo.h>
 #include <sys/ioctl.h>
 #include <netinet/in.h>
-#include <linux/if.h>
-#include <linux/sockios.h>
+#include <sys/uio.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <stdlib.h>
@@ -46,8 +45,6 @@
 #include <errno.h>
 #include <signal.h>
 #include <time.h>
-
-
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
@@ -115,14 +112,14 @@ static int (*clm_aisexec_handler_fns[]) (void *) = {
 };
 	
 struct service_handler clm_service_handler = {
-	libais_handler_fns:			clm_libais_handler_fns,
-	libais_handler_fns_count:	sizeof (clm_libais_handler_fns) / sizeof (int (*)),
-	aisexec_handler_fns:		clm_aisexec_handler_fns ,
-	aisexec_handler_fns_count:	sizeof (clm_aisexec_handler_fns) / sizeof (int (*)),
-	confchg_fn:					clmConfChg,
-	libais_init_fn:				message_handler_req_clm_init,
-	libais_exit_fn:				clm_exit_fn,
-	aisexec_init_fn:			clmExecutiveInitialize
+	.libais_handler_fns			= clm_libais_handler_fns,
+	.libais_handler_fns_count	= sizeof (clm_libais_handler_fns) / sizeof (int (*)),
+	.aisexec_handler_fns		= clm_aisexec_handler_fns ,
+	.aisexec_handler_fns_count	= sizeof (clm_aisexec_handler_fns) / sizeof (int (*)),
+	.confchg_fn					= clmConfChg,
+	.libais_init_fn				= message_handler_req_clm_init,
+	.libais_exit_fn				= clm_exit_fn,
+	.aisexec_init_fn			= clmExecutiveInitialize
 };
 
 static int clmExecutiveInitialize (void)
@@ -320,7 +317,7 @@ static int clmNodeJoinSend (void)
 	memcpy (&req_exec_clm_nodejoin.clusterNode, &thisClusterNode,
 		sizeof (SaClmClusterNodeT));
 	
-	req_exec_clm_iovec.iov_base = &req_exec_clm_nodejoin;
+	req_exec_clm_iovec.iov_base = (char *)&req_exec_clm_nodejoin;
 	req_exec_clm_iovec.iov_len = sizeof (req_exec_clm_nodejoin);
 
 	result = gmi_mcast (&aisexec_groupname, &req_exec_clm_iovec, 1, GMI_PRIO_HIGH);

+ 13 - 11
exec/gmi.c

@@ -334,8 +334,8 @@ static struct memb_form_token memb_form_token;
 static char iov_buffer[MESSAGE_SIZE_MAX];
 
 static struct iovec gmi_iov_recv = {
-	iov_base:	iov_buffer,
-	iov_len:	sizeof (iov_buffer)
+	.iov_base	= iov_buffer,
+	.iov_len	= sizeof (iov_buffer)
 };
 
 struct message_handlers {
@@ -879,7 +879,9 @@ int orf_token_remcast (int seqid) {
 	int res;
 	struct mcast *mcast;
 
-//printf ("remulticasting %d\n", seqid);
+#ifdef DEBUG
+printf ("remulticasting %d\n", seqid);
+#endif
 	/*
 	 * Get RTR item at seqid, if not available, return
 	 */
@@ -887,12 +889,12 @@ int orf_token_remcast (int seqid) {
 	if (res != 0) {
 		return -1;
 	}
-	mcast = gmi_rtr_item->iovec[0].iov_base;
+	mcast = (struct mcast *)gmi_rtr_item->iovec[0].iov_base;
 
 	/*
 	 * Build multicast message
 	 */
-	msg_mcast.msg_name = &sockaddr_in_mcast;
+	msg_mcast.msg_name = (caddr_t)&sockaddr_in_mcast;
 	msg_mcast.msg_namelen = sizeof (struct sockaddr_in);
 	msg_mcast.msg_iov = gmi_rtr_item->iovec;
 	msg_mcast.msg_iovlen = gmi_rtr_item->iov_len;
@@ -1564,10 +1566,10 @@ static int orf_token_send (
 	poll_timer_add (*gmi_poll_handle, TIMEOUT_TOKEN, 0,
 		orf_timer_function_token_timeout, &timer_orf_token_timeout);
 
-	iovec_orf_token.iov_base = orf_token;
+	iovec_orf_token.iov_base = (char *)orf_token;
 	iovec_orf_token.iov_len = sizeof (struct orf_token);
 
-	msg_orf_token.msg_name = &memb_next;
+	msg_orf_token.msg_name = (caddr_t)&memb_next;
 	msg_orf_token.msg_namelen = sizeof (struct sockaddr_in);
 	msg_orf_token.msg_iov = &iovec_orf_token;
 	msg_orf_token.msg_iovlen = 1;
@@ -1650,10 +1652,10 @@ static int memb_join_send (void)
 		sizeof (struct in_addr) * memb_failed_list_entries);
 	memb_join.failed_rep_list_entries = memb_failed_list_entries;
 
-	iovec_join.iov_base = &memb_join;
+	iovec_join.iov_base = (char *)&memb_join;
 	iovec_join.iov_len = sizeof (struct memb_join);
 
-	msghdr_join.msg_name = &sockaddr_in_mcast;
+	msghdr_join.msg_name = (caddr_t)&sockaddr_in_mcast;
 	msghdr_join.msg_namelen = sizeof (struct sockaddr_in);
 	msghdr_join.msg_iov = &iovec_join;
 	msghdr_join.msg_iovlen = 1;
@@ -2039,10 +2041,10 @@ static int memb_form_token_send (
 	/*
 	 * Build message for sendmsg
 	 */
-	iovec_form_token.iov_base = form_token;
+	iovec_form_token.iov_base = (char *)form_token;
 	iovec_form_token.iov_len = sizeof (struct memb_form_token);
 
-	msg_form_token.msg_name = &memb_next;
+	msg_form_token.msg_name = (caddr_t)&memb_next;
 	msg_form_token.msg_namelen = sizeof (struct sockaddr_in);
 	msg_form_token.msg_iov = &iovec_form_token;
 	msg_form_token.msg_iovlen = 1;

+ 4 - 5
exec/main.c

@@ -34,16 +34,15 @@
 #include <assert.h>
 #include <pwd.h>
 #include <grp.h>
+#include <sys/types.h>
 #include <sys/poll.h>
+#include <sys/uio.h>
 #include <sys/mman.h>
-#include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/sysinfo.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
-#include <linux/if.h>
-#include <linux/sockios.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <stdlib.h>
@@ -242,7 +241,7 @@ static int poll_handler_libais_accept (
 	int revent,
 	void *data)
 {
-	int addrlen;
+	socklen_t addrlen;
 	struct conn_info *conn_info;
 	struct sockaddr_un un_addr;
 	int new_fd;
@@ -490,7 +489,7 @@ static void deliver_fn (
 		}
 		header = (struct message_header *)delivery_data;
 	} else {
-		header = iovec[0].iov_base;
+		header = (struct message_header *)iovec[0].iov_base;
 	}
 	res = aisexec_handler_fns[header->id](header);
 }

+ 6 - 4
exec/parse.c

@@ -56,8 +56,8 @@ typedef enum {
 
 
 void setSaNameT (SaNameT *name, char *str) {
-	strncpy (name->value, str, SA_MAX_NAME_LENGTH);
-	if (strlen (name->value) > SA_MAX_NAME_LENGTH) {
+	strncpy ((char *)name->value, str, SA_MAX_NAME_LENGTH);
+	if (strlen ((char *)name->value) > SA_MAX_NAME_LENGTH) {
 		name->length = SA_MAX_NAME_LENGTH;
 	} else {
 		name->length = strlen (str);
@@ -66,7 +66,8 @@ void setSaNameT (SaNameT *name, char *str) {
 
 int SaNameTisEqual (SaNameT *str1, char *str2) {
 	if (str1->length == strlen (str2)) {
-		return ((strncmp (str1->value, str2, str1->length)) == 0);
+		return ((strncmp ((char *)str1->value, (char *)str2,
+			str1->length)) == 0);
 	} else {
 		return 0;
 	}
@@ -74,7 +75,8 @@ int SaNameTisEqual (SaNameT *str1, char *str2) {
 
 int SaNameTisNameT (SaNameT *name1, SaNameT *name2) {
 	if (name1->length == name2->length) {
-		return ((strncmp (name1->value, name2->value, name1->length)) == 0);
+		return ((strncmp ((char *)name1->value, (char *)name2->value,
+			name1->length)) == 0);
 	} else {
 		return 0;
 	}

+ 3 - 2
exec/parse.h

@@ -99,7 +99,7 @@ enum amfEnabledUnlockedState {
 	AMF_ENABLED_UNLOCKED_ACTIVE_REQUESTED,
 	AMF_ENABLED_UNLOCKED_ACTIVE_COMPLETED,
 	AMF_ENABLED_UNLOCKED_STANDBY_REQUESTED,
-	AMF_ENABLED_UNLOCKED_STANDBY_COMPLETED,
+	AMF_ENABLED_UNLOCKED_STANDBY_COMPLETED
 };
 
 enum amfDisabledUnlockedState {
@@ -122,8 +122,9 @@ enum amfDisabledLockedState {
 enum amfEnabledStoppingState {
 	AMF_ENABLED_STOPPING_INITIAL = 0,
 	AMF_ENABLED_STOPPING_STOPPING_REQUESTED,
-	AMF_ENABLED_STOPPING_STOPPING_COMPLETED,
+	AMF_ENABLED_STOPPING_STOPPING_COMPLETED
 };
+
 struct saAmfComponent {
 	int registered;
 	int local;

+ 0 - 5
include/ais_msg.h

@@ -186,11 +186,6 @@ struct message_source {
 	struct in_addr in_addr;
 };
 
-struct message_temp {
-	struct message_header header;
-	char message_data[0];
-};
-
 struct req_execauth_xmit_authkey {
 	struct message_header header;
 	int authModule;

+ 3 - 4
include/ais_types.h

@@ -149,7 +149,7 @@ typedef enum {
 	SA_AMF_HEARTBEAT = 1,
 	SA_AMF_HEALTHCHECK_LEVEL1 = 2,
 	SA_AMF_HEALTHCHECK_LEVEL2 = 3,
-	SA_AMF_HEALTHCHECK_LEVEL3 = 4,
+	SA_AMF_HEALTHCHECK_LEVEL3 = 4
 } SaAmfHealthcheckT;
 
 typedef enum {
@@ -171,7 +171,7 @@ typedef enum {
 	SA_AMF_COMPONENT_CAPABILITY_1_ACTIVE_OR_1_STANDBY = 4,
 	SA_AMF_COMPONENT_CAPABILITY_X_ACTIVE = 5,
 	SA_AMF_COMPONENT_CAPABILITY_1_ACTIVE = 6,
-	SA_AMF_COMPONENT_CAPABILITY_NO_ACTIVE = 7,
+	SA_AMF_COMPONENT_CAPABILITY_NO_ACTIVE = 7
 } SaAmfComponentCapabilityModelT;
 
 #define SA_AMF_CSI_ADD_NEW_ISTANCE 0x01
@@ -357,10 +357,9 @@ typedef enum {
 	SA_CKPT_SECTIONS_LEQ_EXPIRATION_TIME = 2,
 	SA_CKPT_SECTIONS_GEQ_EXPIRATION_TIME = 3,
 	SA_CKPT_SECTIONS_CORRUPTED = 4,
-	SA_CKPT_SECTIONS_ANY = 5,
+	SA_CKPT_SECTIONS_ANY = 5
 } SaCkptSectionsChosenT;
 
-// SaOffsetT is not defined in the specification ERRATA
 typedef SaUint32T SaOffsetT;
 
 typedef struct {

+ 1 - 1
include/list.h

@@ -50,7 +50,7 @@ static void inline list_init (struct list_head *head)
 {
 	head->next = head;
 	head->prev = head;
-};
+}
 
 static void inline list_add (struct list_head *new, struct list_head *head)
 {

+ 1 - 0
include/queue.h

@@ -34,6 +34,7 @@
 #ifndef QUEUE_H_DEFINED
 #define QUEUE_H_DEFINED
 
+#include <string.h>
 #include "assert.h"
 
 struct queue {

+ 4 - 4
lib/amf.c

@@ -74,10 +74,10 @@ static void amfHandleInstanceDestructor (void *);
  * All instances in one database
  */
 static struct saHandleDatabase amfHandleDatabase = {
-	handleCount: 0,
-	handles: 0,
-	mutex: PTHREAD_MUTEX_INITIALIZER,
-	handleInstanceDestructor: amfHandleInstanceDestructor
+	.handleCount				= 0,
+	.handles					= 0,
+	.mutex						= PTHREAD_MUTEX_INITIALIZER,
+	.handleInstanceDestructor	= amfHandleInstanceDestructor
 };
 
 /*

+ 24 - 17
lib/ckpt.c

@@ -39,6 +39,7 @@
 #include <errno.h>
 #include <pthread.h>
 #include <sys/types.h>
+#include <sys/uio.h>
 #include <sys/socket.h>
 #include <sys/select.h>
 #include <sys/un.h>
@@ -87,30 +88,30 @@ void ckptSectionIteratorHandleInstanceDestructor (void *instance);
  * All CKPT instances in this database
  */
 static struct saHandleDatabase ckptHandleDatabase = {
-	handleCount: 0,
-	handles: 0,
-	mutex: PTHREAD_MUTEX_INITIALIZER,
-	handleInstanceDestructor: ckptHandleInstanceDestructor
+	.handleCount				= 0,
+	.handles					= 0,
+	.mutex						= PTHREAD_MUTEX_INITIALIZER,
+	.handleInstanceDestructor	= ckptHandleInstanceDestructor
 };
 
 /*
  *  All Checkpoint instances in this database
  */
 static struct saHandleDatabase checkpointHandleDatabase = {
-	handleCount: 0,
-	handles: 0,
-	mutex: PTHREAD_MUTEX_INITIALIZER,
-	handleInstanceDestructor: checkpointHandleInstanceDestructor
+	.handleCount				= 0,
+	.handles					= 0,
+	.mutex						= PTHREAD_MUTEX_INITIALIZER,
+	.handleInstanceDestructor	= checkpointHandleInstanceDestructor
 };
 
 /*
  * All section iterators in this database
  */
 static struct saHandleDatabase ckptSectionIteratorHandleDatabase = {
-	handleCount: 0,
-	handles: 0,
-	mutex: PTHREAD_MUTEX_INITIALIZER,
-	handleInstanceDestructor: ckptSectionIteratorHandleInstanceDestructor
+	.handleCount				= 0,
+	.handles					= 0,
+	.mutex						= PTHREAD_MUTEX_INITIALIZER,
+	.handleInstanceDestructor	= ckptSectionIteratorHandleInstanceDestructor
 };
 
 /*
@@ -388,7 +389,7 @@ saCkptDispatch (
 
 #endif
 		default:
-			// TODO
+			/* TODO */
 			break;
 		}
 		/*
@@ -1156,8 +1157,8 @@ saCkptCheckpointWrite (
 		req_lib_ckpt_sectionwrite.idLen = ioVector[i].sectionId.idLen;
 
 		iov_len = 0;
-// TODO check for zero length stuff
-		iov[0].iov_base = &req_lib_ckpt_sectionwrite;
+/* TODO check for zero length stuff */
+		iov[0].iov_base = (char *)&req_lib_ckpt_sectionwrite;
 		iov[0].iov_len = sizeof (struct req_lib_ckpt_sectionwrite);
 		iov[1].iov_base = ioVector[i].sectionId.id;
 		iov[1].iov_len = ioVector[i].sectionId.idLen;
@@ -1289,7 +1290,7 @@ saCkptCheckpointRead (
 		req_lib_ckpt_sectionread.dataOffset = ioVector[i].dataOffset;
 		req_lib_ckpt_sectionread.dataSize = ioVector[i].dataSize;
 
-		iov[0].iov_base = &req_lib_ckpt_sectionread;
+		iov[0].iov_base = (char *)&req_lib_ckpt_sectionread;
 		iov[0].iov_len = sizeof (struct req_lib_ckpt_sectionread);
 		iov[1].iov_base = ioVector[i].sectionId.id;
 		iov[1].iov_len = ioVector[i].sectionId.idLen;
@@ -1386,6 +1387,11 @@ saCkptCheckpointSynchronizeAsync (
 	SaInvocationT invocation,
 	const SaCkptCheckpointHandleT *checkpointHandle)
 {
+
+	return (SA_OK);
+
+/* TODO not implemented in executive
+
 	struct ckptInstance *ckptInstance;
 	struct ckptCheckpointInstance *ckptCheckpointInstance;
 	SaErrorT error;
@@ -1400,7 +1406,7 @@ saCkptCheckpointSynchronizeAsync (
 
 	req_lib_ckpt_checkpointsynchronizeasync.header.magic = MESSAGE_MAGIC;
 	req_lib_ckpt_checkpointsynchronizeasync.header.size = sizeof (struct req_lib_ckpt_checkpointsynchronizeasync);
-	req_lib_ckpt_checkpointsynchronizeasync.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTOPENASYNC;
+	req_lib_ckpt_checkpointsynchronizeasync.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTSYNCHRONIZEASYNC;
 	req_lib_ckpt_checkpointsynchronizeasync.invocation = invocation;
 
 	pthread_mutex_lock (&ckptCheckpointInstance->mutex);
@@ -1417,4 +1423,5 @@ saCkptCheckpointSynchronizeAsync (
 	saHandleInstancePut (&checkpointHandleDatabase, *checkpointHandle);
 
 	return (error);
+*/
 }

+ 4 - 4
lib/clm.c

@@ -64,10 +64,10 @@ struct clmInstance {
 static void clmHandleInstanceDestructor (void *);
 
 static struct saHandleDatabase clmHandleDatabase = {
-	handleCount: 0,
-	handles: 0,
-	mutex: PTHREAD_MUTEX_INITIALIZER,
-	handleInstanceDestructor: clmHandleInstanceDestructor
+	.handleCount				= 0,
+	.handles					= 0,
+	.mutex						= PTHREAD_MUTEX_INITIALIZER,
+	.handleInstanceDestructor	= clmHandleInstanceDestructor
 };
 
 /*

+ 3 - 1
lib/util.c

@@ -39,6 +39,7 @@
 #include <errno.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
+#include <sys/uio.h>
 #include <sys/socket.h>
 #include <sys/select.h>
 #include <sys/un.h>
@@ -422,9 +423,10 @@ saHandleInstancePut (
 	struct saHandleDatabase *handleDatabase,
 	unsigned int handle)
 {
-	pthread_mutex_lock (&handleDatabase->mutex);
 	void *instance;
 
+	pthread_mutex_lock (&handleDatabase->mutex);
+
 	handleDatabase->handles[handle].refCount -= 1;
 	assert (handleDatabase->handles[handle].refCount >= 0);