Просмотр исходного кода

continue pulling previous thread: mostly constification

* exec/apidef.c (typedef_tpg_join, typedef_tpg_leave)
(typedef_tpg_groups_mcast, typedef_tpg_groups_send_ok):
* exec/sync.c (barrier_data_process, sync_barrier_send)
(sync_start_init, sync_service_init, sync_start_process)
(sync_service_process, sync_deliver_fn, sync_request_send)
(sync_request):
* exec/sync.h (name):
* exec/totemmrp.c (totemmrp_callback_token_create):
* exec/totemmrp.h (TOTEMMRP_H_DEFINED):
* exec/totempg.c (list, app_confchg_fn)
(callback_token_received_fn, totempg_callback_token_create)
(totempg_groups_mcast_joined, totempg_groups_joined_release)
(totempg_groups_mcast_groups):
* exec/totemsrp.c (callback_fn, totemsrp_confchg_fn)
(totemsrp_initialize, totemsrp_callback_token_create):
* exec/totemsrp.h (TOTEMSRP_H_DEFINED):
* exec/vsf_ykd.c (ykd_state_send_msg, ykd_attempt_send_msg)
(ykd_confchg_fn):
* include/corosync/engine/coroapi.h (timer_add_absolute)
(totem_ifaces_print, totem_ip_print, totem_callback_token_create)
(sync_request, plugin_interface_reference):
* include/corosync/totem/totempg.h (TOTEMPG_SAFE):
* services/cpg.c (cpg_confchg_fn):
* services/pload.c (msgs_sent, pload_service_engine)
(send_message, start_mcasting):
* services/votequorum.c (conn, quorum_confchg_fn):

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2030 fd59a12c-fef9-0310-b244-a6a79926bd2f
Jim Meyering 17 лет назад
Родитель
Сommit
2eba2a6cb8
14 измененных файлов с 101 добавлено и 86 удалено
  1. 12 4
      exec/apidef.c
  2. 14 10
      exec/sync.c
  3. 1 1
      exec/sync.h
  4. 2 2
      exec/totemmrp.c
  5. 2 2
      exec/totemmrp.h
  6. 12 11
      exec/totempg.c
  7. 14 17
      exec/totemsrp.c
  8. 8 8
      exec/totemsrp.h
  9. 8 6
      exec/vsf_ykd.c
  10. 8 7
      include/corosync/engine/coroapi.h
  11. 3 3
      include/corosync/totem/totempg.h
  12. 3 1
      services/cpg.c
  13. 6 6
      services/pload.c
  14. 8 8
      services/votequorum.c

+ 12 - 4
exec/apidef.c

@@ -59,10 +59,18 @@ LOGSYS_DECLARE_SUBSYS ("APIDEF", LOG_INFO);
 /*
 /*
  * Remove compile warnings about type name changes
  * Remove compile warnings about type name changes
  */
  */
-typedef int (*typedef_tpg_join) (hdb_handle_t, struct corosync_tpg_group *, int);
-typedef int (*typedef_tpg_leave) (hdb_handle_t, struct corosync_tpg_group *, int);
-typedef int (*typedef_tpg_groups_mcast) (hdb_handle_t, int, struct corosync_tpg_group *, int groups_cnt, struct iovec *, int);
-typedef int (*typedef_tpg_groups_send_ok) (hdb_handle_t, struct corosync_tpg_group *, int groups_cnt, struct iovec *, int);
+typedef int (*typedef_tpg_join) (hdb_handle_t,
+				 const struct corosync_tpg_group *, size_t);
+typedef int (*typedef_tpg_leave) (hdb_handle_t,
+				  const struct corosync_tpg_group *, size_t);
+typedef int (*typedef_tpg_groups_mcast) (hdb_handle_t, int,
+					 const struct corosync_tpg_group *,
+					 size_t groups_cnt,
+					 struct iovec *, int);
+typedef int (*typedef_tpg_groups_send_ok) (hdb_handle_t,
+					   const struct corosync_tpg_group *,
+					   size_t groups_cnt,
+					   struct iovec *, int);
 
 
 static inline void _corosync_public_exit_error (cs_fatal_error_t err,
 static inline void _corosync_public_exit_error (cs_fatal_error_t err,
 						const char *file,
 						const char *file,

+ 14 - 10
exec/sync.c

@@ -94,13 +94,15 @@ static struct barrier_data barrier_data_process[PROCESSOR_COUNT_MAX];
 
 
 static struct openais_vsf_iface_ver0 *vsf_iface;
 static struct openais_vsf_iface_ver0 *vsf_iface;
 
 
-static int sync_barrier_send (struct memb_ring_id *ring_id);
+static int sync_barrier_send (const struct memb_ring_id *ring_id);
 
 
-static int sync_start_process (enum totem_callback_token_type type, void *data);
+static int sync_start_process (enum totem_callback_token_type type,
+			       const void *data);
 
 
 static void sync_service_init (struct memb_ring_id *ring_id);
 static void sync_service_init (struct memb_ring_id *ring_id);
 
 
-static int sync_service_process (enum totem_callback_token_type type, void *data);
+static int sync_service_process (enum totem_callback_token_type type,
+				 const void *data);
 
 
 static void sync_deliver_fn (
 static void sync_deliver_fn (
 	unsigned int nodeid,
 	unsigned int nodeid,
@@ -137,7 +139,7 @@ struct req_exec_sync_barrier_start {
 /*
 /*
  * Send a barrier data structure
  * Send a barrier data structure
  */
  */
-static int sync_barrier_send (struct memb_ring_id *ring_id)
+static int sync_barrier_send (const struct memb_ring_id *ring_id)
 {
 {
 	struct req_exec_sync_barrier_start req_exec_sync_barrier_start;
 	struct req_exec_sync_barrier_start req_exec_sync_barrier_start;
 	struct iovec iovec;
 	struct iovec iovec;
@@ -164,7 +166,7 @@ static void sync_start_init (const struct memb_ring_id *ring_id)
 		TOTEM_CALLBACK_TOKEN_SENT,
 		TOTEM_CALLBACK_TOKEN_SENT,
 		0, /* don't delete after callback */
 		0, /* don't delete after callback */
 		sync_start_process,
 		sync_start_process,
-		(void *)ring_id);
+		ring_id);
 }
 }
 
 
 static void sync_service_init (struct memb_ring_id *ring_id)
 static void sync_service_init (struct memb_ring_id *ring_id)
@@ -180,13 +182,14 @@ static void sync_service_init (struct memb_ring_id *ring_id)
 		TOTEM_CALLBACK_TOKEN_SENT,
 		TOTEM_CALLBACK_TOKEN_SENT,
 		0, /* don't delete after callback */
 		0, /* don't delete after callback */
 		sync_service_process,
 		sync_service_process,
-		(void *)ring_id);
+		ring_id);
 }
 }
 
 
-static int sync_start_process (enum totem_callback_token_type type, void *data)
+static int sync_start_process (enum totem_callback_token_type type,
+			       const void *data)
 {
 {
 	int res;
 	int res;
-	struct memb_ring_id *ring_id = (struct memb_ring_id *)data;
+	const struct memb_ring_id *ring_id = data;
 
 
 	res = sync_barrier_send (ring_id);
 	res = sync_barrier_send (ring_id);
 	if (res == 0) {
 	if (res == 0) {
@@ -220,10 +223,11 @@ static void sync_callbacks_load (void)
 	}
 	}
 }
 }
 
 
-static int sync_service_process (enum totem_callback_token_type type, void *data)
+static int sync_service_process (enum totem_callback_token_type type,
+				 const void *data)
 {
 {
 	int res;
 	int res;
-	struct memb_ring_id *ring_id = (struct memb_ring_id *)data;
+	const struct memb_ring_id *ring_id = data;
 
 
 
 
 	/*
 	/*

+ 1 - 1
exec/sync.h

@@ -62,6 +62,6 @@ int sync_primary_designated (void);
  *
  *
  * @return int 0 OK, error code otherwise
  * @return int 0 OK, error code otherwise
  */
  */
-extern int sync_request (char *name);
+extern int sync_request (const char *name);
 
 
 #endif /* SYNC_H_DEFINED */
 #endif /* SYNC_H_DEFINED */

+ 2 - 2
exec/totemmrp.c

@@ -176,8 +176,8 @@ int totemmrp_callback_token_create (
 	void **handle_out,
 	void **handle_out,
 	enum totem_callback_token_type type,
 	enum totem_callback_token_type type,
 	int delete,
 	int delete,
-	int (*callback_fn) (enum totem_callback_token_type type, void *),
-	void *data)
+	int (*callback_fn) (enum totem_callback_token_type type, const void *),
+	const void *data)
 {
 {
 	return totemsrp_callback_token_create (totemsrp_handle_in, handle_out, type, delete, callback_fn, data);
 	return totemsrp_callback_token_create (totemsrp_handle_in, handle_out, type, delete, callback_fn, data);
 }
 }

+ 2 - 2
exec/totemmrp.h

@@ -90,8 +90,8 @@ extern int totemmrp_callback_token_create (
 	void **handle_out,
 	void **handle_out,
 	enum totem_callback_token_type type,
 	enum totem_callback_token_type type,
 	int delete,
 	int delete,
-	int (*callback_fn) (enum totem_callback_token_type type, void *),
-	void *data);
+	int (*callback_fn) (enum totem_callback_token_type type, const void *),
+	const void *data);
 
 
 extern void totemmrp_callback_token_destroy (
 extern void totemmrp_callback_token_destroy (
 	void *handle_out);
 	void *handle_out);

+ 12 - 11
exec/totempg.c

@@ -175,7 +175,7 @@ struct assembly {
 static void assembly_deref (struct assembly *assembly);
 static void assembly_deref (struct assembly *assembly);
 
 
 static int callback_token_received_fn (enum totem_callback_token_type type,
 static int callback_token_received_fn (enum totem_callback_token_type type,
-	void *data);
+	const void *data);
 
 
 enum throw_away_mode_t {
 enum throw_away_mode_t {
 	THROW_AWAY_INACTIVE,
 	THROW_AWAY_INACTIVE,
@@ -306,10 +306,10 @@ static void assembly_deref (struct assembly *assembly)
 
 
 static inline void app_confchg_fn (
 static inline void app_confchg_fn (
 	enum totem_configuration_type configuration_type,
 	enum totem_configuration_type configuration_type,
-	unsigned int *member_list, int member_list_entries,
-	unsigned int *left_list, int left_list_entries,
-	unsigned int *joined_list, int joined_list_entries,
-	struct memb_ring_id *ring_id)
+	const unsigned int *member_list, size_t member_list_entries,
+	const unsigned int *left_list, size_t left_list_entries,
+	const unsigned int *joined_list, size_t joined_list_entries,
+	const struct memb_ring_id *ring_id)
 {
 {
 	int i;
 	int i;
 	struct totempg_group_instance *instance;
 	struct totempg_group_instance *instance;
@@ -660,7 +660,7 @@ static void totempg_deliver_fn (
 void *callback_token_received_handle;
 void *callback_token_received_handle;
 
 
 int callback_token_received_fn (enum totem_callback_token_type type,
 int callback_token_received_fn (enum totem_callback_token_type type,
-	void *data)
+				const void *data)
 {
 {
 	struct totempg_mcast mcast;
 	struct totempg_mcast mcast;
 	struct iovec iovecs[3];
 	struct iovec iovecs[3];
@@ -962,8 +962,8 @@ int totempg_callback_token_create (
 	void **handle_out,
 	void **handle_out,
 	enum totem_callback_token_type type,
 	enum totem_callback_token_type type,
 	int delete,
 	int delete,
-	int (*callback_fn) (enum totem_callback_token_type type, void *),
-	void *data)
+	int (*callback_fn) (enum totem_callback_token_type type, const void *),
+	const void *data)
 {
 {
 	unsigned int res;
 	unsigned int res;
 	pthread_mutex_lock (&callback_token_mutex);
 	pthread_mutex_lock (&callback_token_mutex);
@@ -1125,7 +1125,7 @@ int totempg_groups_mcast_joined (
 	for (i = 0; i < instance->groups_cnt; i++) {
 	for (i = 0; i < instance->groups_cnt; i++) {
 		group_len[i + 1] = instance->groups[i].group_len;
 		group_len[i + 1] = instance->groups[i].group_len;
 		iovec_mcast[i + 1].iov_len = instance->groups[i].group_len;
 		iovec_mcast[i + 1].iov_len = instance->groups[i].group_len;
-		iovec_mcast[i + 1].iov_base = instance->groups[i].group;
+		iovec_mcast[i + 1].iov_base = (void *) instance->groups[i].group;
 	}
 	}
 	iovec_mcast[0].iov_len = (instance->groups_cnt + 1) * sizeof (unsigned short);
 	iovec_mcast[0].iov_len = (instance->groups_cnt + 1) * sizeof (unsigned short);
 	iovec_mcast[0].iov_base = group_len;
 	iovec_mcast[0].iov_base = group_len;
@@ -1183,13 +1183,14 @@ error_exit:
 }
 }
 
 
 
 
-void totempg_groups_joined_release (int msg_count)
+int totempg_groups_joined_release (int msg_count)
 {
 {
 	pthread_mutex_lock (&totempg_mutex);
 	pthread_mutex_lock (&totempg_mutex);
 	pthread_mutex_lock (&mcast_msg_mutex);
 	pthread_mutex_lock (&mcast_msg_mutex);
 	send_release (msg_count);
 	send_release (msg_count);
 	pthread_mutex_unlock (&mcast_msg_mutex);
 	pthread_mutex_unlock (&mcast_msg_mutex);
 	pthread_mutex_unlock (&totempg_mutex);
 	pthread_mutex_unlock (&totempg_mutex);
+	return 0;
 }
 }
 
 
 int totempg_groups_mcast_groups (
 int totempg_groups_mcast_groups (
@@ -1220,7 +1221,7 @@ int totempg_groups_mcast_groups (
 	for (i = 0; i < groups_cnt; i++) {
 	for (i = 0; i < groups_cnt; i++) {
 		group_len[i + 1] = groups[i].group_len;
 		group_len[i + 1] = groups[i].group_len;
 		iovec_mcast[i + 1].iov_len = groups[i].group_len;
 		iovec_mcast[i + 1].iov_len = groups[i].group_len;
-		iovec_mcast[i + 1].iov_base = groups[i].group;
+		iovec_mcast[i + 1].iov_base = (void *) groups[i].group;
 	}
 	}
 	iovec_mcast[0].iov_len = (groups_cnt + 1) * sizeof (unsigned short);
 	iovec_mcast[0].iov_len = (groups_cnt + 1) * sizeof (unsigned short);
 	iovec_mcast[0].iov_base = group_len;
 	iovec_mcast[0].iov_base = group_len;

+ 14 - 17
exec/totemsrp.c

@@ -1,6 +1,6 @@
 /*
 /*
  * Copyright (c) 2003-2006 MontaVista Software, Inc.
  * Copyright (c) 2003-2006 MontaVista Software, Inc.
- * Copyright (c) 2006-2008 Red Hat, Inc.
+ * Copyright (c) 2006-2009 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *
@@ -160,7 +160,7 @@ struct consensus_list_item {
 
 
 struct token_callback_instance {
 struct token_callback_instance {
 	struct list_head list;
 	struct list_head list;
-	int (*callback_fn) (enum totem_callback_token_type type, void *);
+	int (*callback_fn) (enum totem_callback_token_type type, const void *);
 	enum totem_callback_token_type callback_type;
 	enum totem_callback_token_type callback_type;
 	int delete;
 	int delete;
 	void *data;
 	void *data;
@@ -463,10 +463,10 @@ struct totemsrp_instance {
 
 
 	void (*totemsrp_confchg_fn) (
 	void (*totemsrp_confchg_fn) (
 		enum totem_configuration_type configuration_type,
 		enum totem_configuration_type configuration_type,
-		unsigned int *member_list, int member_list_entries,
-		unsigned int *left_list, int left_list_entries,
-		unsigned int *joined_list, int joined_list_entries,
-		struct memb_ring_id *ring_id);
+		const unsigned int *member_list, size_t member_list_entries,
+		const unsigned int *left_list, size_t left_list_entries,
+		const unsigned int *joined_list, size_t joined_list_entries,
+		const struct memb_ring_id *ring_id);
 
 
 	int global_seqno;
 	int global_seqno;
 
 
@@ -699,10 +699,10 @@ int totemsrp_initialize (
 
 
 	void (*confchg_fn) (
 	void (*confchg_fn) (
 		enum totem_configuration_type configuration_type,
 		enum totem_configuration_type configuration_type,
-		unsigned int *member_list, int member_list_entries,
-		unsigned int *left_list, int left_list_entries,
-		unsigned int *joined_list, int joined_list_entries,
-		struct memb_ring_id *ring_id))
+		const unsigned int *member_list, size_t member_list_entries,
+		const unsigned int *left_list, size_t left_list_entries,
+		const unsigned int *joined_list, size_t joined_list_entries,
+		const struct memb_ring_id *ring_id))
 {
 {
 	struct totemsrp_instance *instance;
 	struct totemsrp_instance *instance;
 	unsigned int res;
 	unsigned int res;
@@ -3005,8 +3005,8 @@ int totemsrp_callback_token_create (
 	void **handle_out,
 	void **handle_out,
 	enum totem_callback_token_type type,
 	enum totem_callback_token_type type,
 	int delete,
 	int delete,
-	int (*callback_fn) (enum totem_callback_token_type type, void *),
-	void *data)
+	int (*callback_fn) (enum totem_callback_token_type type, const void *),
+	const void *data)
 {
 {
 	struct token_callback_instance *callback_handle;
 	struct token_callback_instance *callback_handle;
 	struct totemsrp_instance *instance;
 	struct totemsrp_instance *instance;
@@ -3020,14 +3020,14 @@ int totemsrp_callback_token_create (
 
 
 	token_hold_cancel_send (instance);
 	token_hold_cancel_send (instance);
 
 
-	callback_handle = (struct token_callback_instance *)malloc (sizeof (struct token_callback_instance));
+	callback_handle = malloc (sizeof (struct token_callback_instance));
 	if (callback_handle == 0) {
 	if (callback_handle == 0) {
 		return (-1);
 		return (-1);
 	}
 	}
 	*handle_out = (void *)callback_handle;
 	*handle_out = (void *)callback_handle;
 	list_init (&callback_handle->list);
 	list_init (&callback_handle->list);
 	callback_handle->callback_fn = callback_fn;
 	callback_handle->callback_fn = callback_fn;
-	callback_handle->data = data;
+	callback_handle->data = (void *) data;
 	callback_handle->callback_type = type;
 	callback_handle->callback_type = type;
 	callback_handle->delete = delete;
 	callback_handle->delete = delete;
 	switch (type) {
 	switch (type) {
@@ -4208,6 +4208,3 @@ void main_iface_change_fn (
 void totemsrp_net_mtu_adjust (struct totem_config *totem_config) {
 void totemsrp_net_mtu_adjust (struct totem_config *totem_config) {
 	totem_config->net_mtu -= sizeof (struct mcast);
 	totem_config->net_mtu -= sizeof (struct mcast);
 }
 }
-
-
-

+ 8 - 8
exec/totemsrp.h

@@ -1,13 +1,13 @@
 /*
 /*
  * Copyright (c) 2003-2005 MontaVista Software, Inc.
  * Copyright (c) 2003-2005 MontaVista Software, Inc.
- * Copyright (c) 2006-2007 Red Hat, Inc.
+ * Copyright (c) 2006-2007, 2009 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *
  * Author: Steven Dake (sdake@redhat.com)
  * Author: Steven Dake (sdake@redhat.com)
  *
  *
  * This software licensed under BSD license, the text of which follows:
  * This software licensed under BSD license, the text of which follows:
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
  * modification, are permitted provided that the following conditions are met:
  *
  *
@@ -58,10 +58,10 @@ int totemsrp_initialize (
 		int endian_conversion_required),
 		int endian_conversion_required),
 	void (*confchg_fn) (
 	void (*confchg_fn) (
 		enum totem_configuration_type configuration_type,
 		enum totem_configuration_type configuration_type,
-		unsigned int *member_list, int member_list_entries,
-		unsigned int *left_list, int left_list_entries,
-		unsigned int *joined_list, int joined_list_entries,
-		struct memb_ring_id *ring_id));
+		const unsigned int *member_list, size_t member_list_entries,
+		const unsigned int *left_list, size_t left_list_entries,
+		const unsigned int *joined_list, size_t joined_list_entries,
+		const struct memb_ring_id *ring_id));
 
 
 void totemsrp_finalize (hdb_handle_t handle);
 void totemsrp_finalize (hdb_handle_t handle);
 
 
@@ -84,8 +84,8 @@ int totemsrp_callback_token_create (
 	void **handle_out,
 	void **handle_out,
 	enum totem_callback_token_type type,
 	enum totem_callback_token_type type,
 	int delete,
 	int delete,
-	int (*callback_fn) (enum totem_callback_token_type type, void *),
-	void *data);
+	int (*callback_fn) (enum totem_callback_token_type type, const void *),
+	const void *data);
 
 
 void totemsrp_callback_token_destroy (
 void totemsrp_callback_token_destroy (
 	hdb_handle_t handle,
 	hdb_handle_t handle,

+ 8 - 6
exec/vsf_ykd.c

@@ -159,7 +159,8 @@ static void ykd_state_init (void)
 	ykd_state.last_primary.member_list_entries = 0;
 	ykd_state.last_primary.member_list_entries = 0;
 }
 }
 
 
-static int ykd_state_send_msg (enum totem_callback_token_type type, void *context)
+static int ykd_state_send_msg (enum totem_callback_token_type type,
+			       const void *context)
 {
 {
 	struct iovec iovec[2];
 	struct iovec iovec[2];
 	struct ykd_header header;
 	struct ykd_header header;
@@ -188,7 +189,8 @@ static void ykd_state_send (void)
                 NULL);
                 NULL);
 }
 }
 
 
-static int ykd_attempt_send_msg (enum totem_callback_token_type type, void *context)
+static int ykd_attempt_send_msg (enum totem_callback_token_type type,
+				 const void *context)
 {
 {
 	struct iovec iovec;
 	struct iovec iovec;
 	struct ykd_header header;
 	struct ykd_header header;
@@ -450,10 +452,10 @@ static void ykd_deliver_fn (
 int first_run = 1;
 int first_run = 1;
 static void ykd_confchg_fn (
 static void ykd_confchg_fn (
 	enum totem_configuration_type configuration_type,
 	enum totem_configuration_type configuration_type,
-	unsigned int *member_list, int member_list_entries,
-	unsigned int *left_list, int left_list_entries,
-	unsigned int *joined_list, int joined_list_entries,
-	struct memb_ring_id *ring_id)
+	const unsigned int *member_list, size_t member_list_entries,
+	const unsigned int *left_list, size_t left_list_entries,
+	const unsigned int *joined_list, size_t joined_list_entries,
+	const struct memb_ring_id *ring_id)
 {
 {
 	int i;
 	int i;
 
 

+ 8 - 7
include/corosync/engine/coroapi.h

@@ -373,7 +373,7 @@ struct corosync_api_v1 {
 		void *data,
 		void *data,
 		void (*timer_fn) (void *data),
 		void (*timer_fn) (void *data),
 		corosync_timer_handle_t *handle);
 		corosync_timer_handle_t *handle);
-	
+
 	void (*timer_delete) (
 	void (*timer_delete) (
 		corosync_timer_handle_t timer_handle);
 		corosync_timer_handle_t timer_handle);
 
 
@@ -422,17 +422,18 @@ struct corosync_api_v1 {
 		char ***status,
 		char ***status,
 		unsigned int *iface_count);
 		unsigned int *iface_count);
 
 
-	char *(*totem_ifaces_print) (unsigned int nodeid);
+	const char *(*totem_ifaces_print) (unsigned int nodeid);
 
 
-	char *(*totem_ip_print) (struct totem_ip_address *addr);
+	const char *(*totem_ip_print) (const struct totem_ip_address *addr);
 
 
 
 
 	int (*totem_callback_token_create) (
 	int (*totem_callback_token_create) (
 		void **handle_out,
 		void **handle_out,
 		enum totem_callback_token_type type,
 		enum totem_callback_token_type type,
 		int delete,
 		int delete,
-		int (*callback_fn) (enum totem_callback_token_type type, void *),
-		void *data);
+		int (*callback_fn) (enum totem_callback_token_type type,
+				    const void *),
+		const void *data);
 
 
 	/*
 	/*
 	 * Totem open process groups API for those service engines
 	 * Totem open process groups API for those service engines
@@ -503,7 +504,7 @@ struct corosync_api_v1 {
 		int reserved_msgs);
 		int reserved_msgs);
 
 
 	int (*sync_request) (
 	int (*sync_request) (
-		char *service_name);
+		const char *service_name);
 
 
 	/*
 	/*
 	 * User plugin-callable functions for quorum
 	 * User plugin-callable functions for quorum
@@ -521,7 +522,7 @@ struct corosync_api_v1 {
 	 * Plugin loading and unloading
 	 * Plugin loading and unloading
 	 */
 	 */
 	int (*plugin_interface_reference) (
 	int (*plugin_interface_reference) (
-		hdb_handle_t *handle, 
+		hdb_handle_t *handle,
 		const char *iface_name,
 		const char *iface_name,
 		int version,
 		int version,
 		void **interface,
 		void **interface,

+ 3 - 3
include/corosync/totem/totempg.h

@@ -67,8 +67,8 @@ extern void totempg_finalize (void);
 extern int totempg_callback_token_create (void **handle_out,
 extern int totempg_callback_token_create (void **handle_out,
 	enum totem_callback_token_type type,
 	enum totem_callback_token_type type,
 	int delete,
 	int delete,
-	int (*callback_fn) (enum totem_callback_token_type type, void *),
-	void *data);
+	int (*callback_fn) (enum totem_callback_token_type type, const void *),
+	const void *data);
 
 
 extern void totempg_callback_token_destroy (void *handle);
 extern void totempg_callback_token_destroy (void *handle);
 
 
@@ -115,7 +115,7 @@ extern int totempg_groups_joined_reserve (
 	const struct iovec *iovec,
 	const struct iovec *iovec,
 	int iov_len);
 	int iov_len);
 
 
-extern void totempg_groups_joined_release (
+extern int totempg_groups_joined_release (
 	int msg_count);
 	int msg_count);
 	
 	
 extern int totempg_groups_mcast_groups (
 extern int totempg_groups_mcast_groups (

+ 3 - 1
services/cpg.c

@@ -661,7 +661,9 @@ static void cpg_confchg_fn (
 			for (i = 0; i < left_list_entries; i++) {
 			for (i = 0; i < left_list_entries; i++) {
 				req_exec_cpg_downlist.nodeids[i] = left_list[i];
 				req_exec_cpg_downlist.nodeids[i] = left_list[i];
 			}
 			}
-			log_printf(LOG_LEVEL_DEBUG, "confchg, build downlist: %d nodes\n", left_list_entries);
+			log_printf(LOG_LEVEL_DEBUG,
+				   "confchg, build downlist: %lu nodes\n",
+				   (long unsigned int) left_list_entries);
 		}
 		}
 	}
 	}
 
 

+ 6 - 6
services/pload.c

@@ -6,7 +6,7 @@
  * Author: Steven Dake (sdake@redhat.com)
  * Author: Steven Dake (sdake@redhat.com)
  *
  *
  * This software licensed under BSD license, the text of which follows:
  * This software licensed under BSD license, the text of which follows:
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
  * modification, are permitted provided that the following conditions are met:
  *
  *
@@ -109,7 +109,7 @@ static unsigned int msg_code = 1;
 
 
 static unsigned int msgs_sent = 0;
 static unsigned int msgs_sent = 0;
 
 
-	
+
 static struct corosync_api_v1 *api;
 static struct corosync_api_v1 *api;
 
 
 struct req_exec_pload_start {
 struct req_exec_pload_start {
@@ -151,7 +151,7 @@ struct corosync_service_engine pload_service_engine = {
 	.name			= "corosync profile loading service",
 	.name			= "corosync profile loading service",
 	.id			= PLOAD_SERVICE,
 	.id			= PLOAD_SERVICE,
 	.private_data_size	= 0,
 	.private_data_size	= 0,
-	.flow_control		= CS_LIB_FLOW_CONTROL_REQUIRED, 
+	.flow_control		= CS_LIB_FLOW_CONTROL_REQUIRED,
 	.lib_init_fn		= pload_lib_init_fn,
 	.lib_init_fn		= pload_lib_init_fn,
 	.lib_exit_fn		= pload_lib_exit_fn,
 	.lib_exit_fn		= pload_lib_exit_fn,
 	.lib_engine		= pload_lib_engine,
 	.lib_engine		= pload_lib_engine,
@@ -258,7 +258,7 @@ static void req_exec_pload_mcast_endian_convert (void *msg)
 {
 {
 }
 }
 
 
-static int send_message (enum totem_callback_token_type type, void *arg)
+static int send_message (enum totem_callback_token_type type, const void *arg)
 {
 {
 	struct req_exec_pload_mcast req_exec_pload_mcast;
 	struct req_exec_pload_mcast req_exec_pload_mcast;
 	struct iovec iov[2];
 	struct iovec iov[2];
@@ -300,9 +300,9 @@ static void start_mcasting (void)
 		&token_callback,
 		&token_callback,
 		TOTEM_CALLBACK_TOKEN_RECEIVED,
 		TOTEM_CALLBACK_TOKEN_RECEIVED,
 		1,
 		1,
-		send_message,	
+		send_message,
 		&token_callback);
 		&token_callback);
-} 
+}
 
 
 static void message_handler_req_exec_pload_start (
 static void message_handler_req_exec_pload_start (
 	const void *msg,
 	const void *msg,

+ 8 - 8
services/votequorum.c

@@ -173,10 +173,10 @@ static void votequorum_init(struct corosync_api_v1 *api,
 
 
 static void quorum_confchg_fn (
 static void quorum_confchg_fn (
 	enum totem_configuration_type configuration_type,
 	enum totem_configuration_type configuration_type,
-	unsigned int *member_list, int member_list_entries,
-	unsigned int *left_list, int left_list_entries,
-	unsigned int *joined_list, int joined_list_entries,
-	struct memb_ring_id *ring_id);
+	const unsigned int *member_list, size_t member_list_entries,
+	const unsigned int *left_list, size_t left_list_entries,
+	const unsigned int *joined_list, size_t joined_list_entries,
+	const struct memb_ring_id *ring_id);
 
 
 static void quorum_deliver_fn(unsigned int nodeid, struct iovec *iovec, int iov_len,
 static void quorum_deliver_fn(unsigned int nodeid, struct iovec *iovec, int iov_len,
 			      int endian_conversion_required);
 			      int endian_conversion_required);
@@ -910,10 +910,10 @@ static int quorum_exec_send_killnode(int nodeid, unsigned int reason)
 
 
 static void quorum_confchg_fn (
 static void quorum_confchg_fn (
 	enum totem_configuration_type configuration_type,
 	enum totem_configuration_type configuration_type,
-	unsigned int *member_list, int member_list_entries,
-	unsigned int *left_list, int left_list_entries,
-	unsigned int *joined_list, int joined_list_entries,
-	struct memb_ring_id *ring_id)
+	const unsigned int *member_list, size_t member_list_entries,
+	const unsigned int *left_list, size_t left_list_entries,
+	const unsigned int *joined_list, size_t joined_list_entries,
+	const struct memb_ring_id *ring_id)
 {
 {
 	int i;
 	int i;
 	int leaving = 0;
 	int leaving = 0;