Przeglądaj źródła

declare many functions "static" (also avoids missing prototype warnings)

* exec/main.c (sigintr_handler, serialize_lock, serialize_unlock):
(serialize_lock, serialize_unlock):
* exec/sync.c (sync_start_init, sync_callbacks_load):
* exec/vsf_ykd.c (ykd_state_init):
* lcr/uis.c (cmd1):
* services/pload.c (send_message, token_callback, start_mcasting):
* tools/corosync-cfgtool.c (service_load_do, service_unload_do):
(shutdown_do, showaddrs_do, killnode_do, usage_do):
* tools/corosync-fplay.c (totemip_print, print_string_len):
(sync_printer_confchg_set_sync, sync_printer_set_sync_state):
(sync_printer_process_currentstate):
(sync_printer_process_get_shouldsync):
(sync_printer_checkpoint_release):
(sync_printer_checkpoint_transmit, sync_printer_section_transmit):
(sync_printer_checkpoint_receive, sync_printer_section_receive):
(sync_printer_nada, sync_printer_confchg_fn):
(printer_totemsrp_mcast, printer_totemsrp_delv):
(printer_totempg_mcast_fits, sync_printer_service_process):
* tools/corosync-objctl.c (get_child_name, get_parent_name):
(get_key):

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1980 fd59a12c-fef9-0310-b244-a6a79926bd2f
Jim Meyering 17 lat temu
rodzic
commit
9bd1a8e728
8 zmienionych plików z 42 dodań i 42 usunięć
  1. 7 6
      exec/main.c
  2. 3 3
      exec/sync.c
  3. 1 1
      exec/vsf_ykd.c
  4. 1 1
      lcr/uis.c
  5. 3 3
      services/pload.c
  6. 6 6
      tools/corosync-cfgtool.c
  7. 18 18
      tools/corosync-fplay.c
  8. 3 4
      tools/corosync-objctl.c

+ 7 - 6
exec/main.c

@@ -199,9 +199,10 @@ struct totempg_group corosync_group = {
 	.group_len	= 1
 };
 
-void sigintr_handler (int signum)
+static void sigintr_handler (int signum)
 {
-	poll_timer_add (corosync_poll_handle, 500, NULL, init_shutdown, &shutdown_handle);
+	poll_timer_add (corosync_poll_handle, 500, NULL,
+			init_shutdown, &shutdown_handle);
 }
 
 
@@ -210,22 +211,22 @@ static int pool_sizes[] = { 0, 0, 0, 0, 0, 4096, 0, 1, 0, /* 256 */
 					1, 1, 1, 1, 1, 1, 1, 1, 1 };
 
 #if defined(HAVE_PTHREAD_SPIN_LOCK)
-void serialize_lock (void)
+static void serialize_lock (void)
 {
 	pthread_spin_lock (&serialize_spin);
 }
 
-void serialize_unlock (void)
+static void serialize_unlock (void)
 {
 	pthread_spin_unlock (&serialize_spin);
 }
 #else
-void serialize_lock (void)
+static void serialize_lock (void)
 {
 	pthread_mutex_lock (&serialize_mutex);
 }
 
-void serialize_unlock (void)
+static void serialize_unlock (void)
 {
 	pthread_mutex_unlock (&serialize_mutex);
 }

+ 3 - 3
exec/sync.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2005-2006 MontaVista Software, Inc.
- * Copyright (c) 2006-2007 Red Hat, Inc.
+ * Copyright (c) 2006-2007, 2009 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -166,7 +166,7 @@ static int sync_barrier_send (struct memb_ring_id *ring_id)
 	return (res);
 }
 
-void sync_start_init (struct memb_ring_id *ring_id)
+static void sync_start_init (struct memb_ring_id *ring_id)
 {
 	totempg_callback_token_create (
 		&sync_callback_token_handle,
@@ -207,7 +207,7 @@ static int sync_start_process (enum totem_callback_token_type type, void *data)
 	return (0);
 }
 
-void sync_callbacks_load (void)
+static void sync_callbacks_load (void)
 {
 	int res;
 

+ 1 - 1
exec/vsf_ykd.c

@@ -150,7 +150,7 @@ static void (*ykd_primary_callback_fn) (
 	int primary_designated,
 	struct memb_ring_id *ring_id) = NULL;
 
-void ykd_state_init (void)
+static void ykd_state_init (void)
 {
 	ykd_state.session_id = 0;
 	ykd_state.last_formed_entries = 0;

+ 1 - 1
lcr/uis.c

@@ -108,7 +108,7 @@ struct uis_commands {
 	void (*cmd_handler) (char *);
 };
 
-void cmd1 (char *cmd) {
+static void cmd1 (char *cmd) {
 	printf ("cmd1 executed with cmd line %s\n", cmd);
 }
 

+ 3 - 3
services/pload.c

@@ -258,7 +258,7 @@ static void req_exec_pload_mcast_endian_convert (void *msg)
 {
 }
 
-int send_message (enum totem_callback_token_type type, void *arg)
+static int send_message (enum totem_callback_token_type type, void *arg)
 {
 	struct req_exec_pload_mcast req_exec_pload_mcast;
 	struct iovec iov[2];
@@ -293,8 +293,8 @@ int send_message (enum totem_callback_token_type type, void *arg)
 	}
 }
 
-void *token_callback;
-void start_mcasting (void)
+static void *token_callback;
+static void start_mcasting (void)
 {
 	api->totem_callback_token_create (
 		&token_callback,

+ 6 - 6
tools/corosync-cfgtool.c

@@ -113,7 +113,7 @@ static void ringreenable_do (void)
 	(void)corosync_cfg_finalize (handle);
 }
 
-void service_load_do (char *service, unsigned int version)
+static void service_load_do (const char *service, unsigned int version)
 {
 	cs_error_t result;
 	corosync_cfg_handle_t handle;
@@ -131,7 +131,7 @@ void service_load_do (char *service, unsigned int version)
 	(void)corosync_cfg_finalize (handle);
 }
 
-void service_unload_do (char *service, unsigned int version)
+static void service_unload_do (const char *service, unsigned int version)
 {
 	cs_error_t result;
 	corosync_cfg_handle_t handle;
@@ -149,7 +149,7 @@ void service_unload_do (char *service, unsigned int version)
 	(void)corosync_cfg_finalize (handle);
 }
 
-void shutdown_do(void)
+static void shutdown_do(void)
 {
 	cs_error_t result;
 	corosync_cfg_handle_t handle;
@@ -172,7 +172,7 @@ void shutdown_do(void)
 	(void)corosync_cfg_finalize (handle);
 }
 
-void showaddrs_do(int nodeid)
+static void showaddrs_do(int nodeid)
 {
 	cs_error_t result;
 	corosync_cfg_handle_t handle;
@@ -211,7 +211,7 @@ void showaddrs_do(int nodeid)
 	(void)corosync_cfg_finalize (handle);
 }
 
-void killnode_do(unsigned int nodeid)
+static void killnode_do(unsigned int nodeid)
 {
 	cs_error_t result;
 	corosync_cfg_handle_t handle;
@@ -230,7 +230,7 @@ void killnode_do(unsigned int nodeid)
 }
 
 
-void usage_do (void)
+static void usage_do (void)
 {
 	printf ("corosync-cfgtool [-s] [-r] [-l] [-u] [-H] [service_name] [-v] [version] [-k] [nodeid] [-a] [nodeid]\n\n");
 	printf ("A tool for displaying and configuring active parameters within corosync.\n");

+ 18 - 18
tools/corosync-fplay.c

@@ -38,14 +38,14 @@ struct memb_ring_id {
         unsigned long long seq;
 } __attribute__((packed));
 
-const char *totemip_print(struct totem_ip_address *addr)
+static const char *totemip_print(const struct totem_ip_address *addr)
 {
 	static char buf[INET6_ADDRSTRLEN];
 
 	return inet_ntop(addr->family, addr->addr, buf, sizeof(buf));
 }
 
-char *print_string_len (unsigned char *str, unsigned int len)
+static char *print_string_len (const unsigned char *str, unsigned int len)
 {
 	unsigned int i;
 	static char buf[1024];
@@ -56,31 +56,31 @@ char *print_string_len (unsigned char *str, unsigned int len)
 	return (buf);
 }
 
-void sync_printer_confchg_set_sync (void **record)
+static void sync_printer_confchg_set_sync (void **record)
 {
 	unsigned int *my_should_sync = record[0];
 	printf ("Setting my_should_sync to %d\n", *my_should_sync);
 }
 
-void sync_printer_set_sync_state (void **record)
+static void sync_printer_set_sync_state (void **record)
 {
 	unsigned int *my_sync_state = record[0];
 	printf ("Setting my_sync_state to %d\n", *my_sync_state);
 }
 
-void sync_printer_process_currentstate (void **record)
+static void sync_printer_process_currentstate (void **record)
 {
 	unsigned int *my_sync_state = record[0];
 	printf ("Retrieving my_sync_state %d\n", *my_sync_state);
 }
 
-void sync_printer_process_get_shouldsync (void **record)
+static void sync_printer_process_get_shouldsync (void **record)
 {
 	unsigned int *my_should_sync = record[0];
 	printf ("Getting my_should_sync %d\n", *my_should_sync);
 }
 
-void sync_printer_checkpoint_release (void **record)
+static void sync_printer_checkpoint_release (void **record)
 {
 	unsigned char *name = record[0];
 	uint16_t *name_len = record[1];
@@ -94,7 +94,7 @@ void sync_printer_checkpoint_release (void **record)
 		*name_len);
 }
 
-void sync_printer_checkpoint_transmit (void **record)
+static void sync_printer_checkpoint_transmit (void **record)
 {
 	unsigned char *name = record[0];
 	uint16_t *name_len = record[1];
@@ -106,7 +106,7 @@ void sync_printer_checkpoint_transmit (void **record)
 		*ckpt_id);
 }
 
-void sync_printer_section_transmit (void **record)
+static void sync_printer_section_transmit (void **record)
 {
 	unsigned char *ckpt_name = record[0];
 	uint16_t *name_len = record[1];
@@ -121,7 +121,7 @@ void sync_printer_section_transmit (void **record)
 	printf ("section=[%s]\n",
 		print_string_len (section_name, *section_name_len));
 }
-void sync_printer_checkpoint_receive (void **record)
+static void sync_printer_checkpoint_receive (void **record)
 {
 	unsigned char *ckpt_name = record[0];
 	uint16_t *name_len = record[1];
@@ -132,7 +132,7 @@ void sync_printer_checkpoint_receive (void **record)
 		*xmit_id, print_string_len (ckpt_name, *name_len), *ckpt_id);
 }
 
-void sync_printer_section_receive (void **record)
+static void sync_printer_section_receive (void **record)
 {
 	unsigned char *ckpt_name = record[0];
 	uint16_t *name_len = record[1];
@@ -149,11 +149,11 @@ void sync_printer_section_receive (void **record)
 		print_string_len (section_name, *section_name_len));
 }
 
-void sync_printer_nada (void **record)
+static void sync_printer_nada (void **record)
 {
-printf ("nada\n");
+	printf ("nada\n");
 }
-void sync_printer_confchg_fn (void **record)
+static void sync_printer_confchg_fn (void **record)
 {
 	unsigned int i;
 
@@ -172,21 +172,21 @@ void sync_printer_confchg_fn (void **record)
 	}
 }
 
-void printer_totemsrp_mcast (void **record)
+static void printer_totemsrp_mcast (void **record)
 {
 	unsigned int *msgid = record[0];
 
 	printf ("totemsrp_mcast %d\n", *msgid);
 }
 
-void printer_totemsrp_delv (void **record)
+static void printer_totemsrp_delv (void **record)
 {
 	unsigned int *msgid = record[0];
 
 	printf ("totemsrp_delv %d\n", *msgid);
 }
 
-void printer_totempg_mcast_fits (void **record)
+static void printer_totempg_mcast_fits (void **record)
 {
 	unsigned int *index = record[0];
 	unsigned int *iov_len = record[1];
@@ -200,7 +200,7 @@ void printer_totempg_mcast_fits (void **record)
 	*index, *iov_len, *copy_len, *fragment_size, *max_packet_size, *copy_base, *next_fragment);
 }
 
-void sync_printer_service_process (void **record)
+static void sync_printer_service_process (void **record)
 {
 	struct memb_ring_id *ring_id = record[0];
 	struct memb_ring_id *sync_ring_id = record[1];

+ 3 - 4
tools/corosync-objctl.c

@@ -203,7 +203,7 @@ static cs_error_t validate_name(char * obj_name_pt)
 		return CS_ERR_INVALID_PARAM;
 }
 
-void get_child_name(char * name_pt, char * child_name)
+static void get_child_name(const char * name_pt, char * child_name)
 {
 	char * tmp;
 	char str_copy[OBJ_NAME_SIZE];
@@ -220,7 +220,7 @@ void get_child_name(char * name_pt, char * child_name)
 	strcpy(child_name, tmp+1);
 }
 
-void get_parent_name(char * name_pt, char * parent_name)
+static void get_parent_name(const char * name_pt, char * parent_name)
 {
 	char * tmp;
 	strcpy(parent_name, name_pt);
@@ -234,7 +234,7 @@ void get_parent_name(char * name_pt, char * parent_name)
 	if (tmp != NULL) *tmp = '\0';
 }
 
-void get_key(char * name_pt, char * key_name, char * key_value)
+static void get_key(const char * name_pt, const char * key_name, char * key_value)
 {
 	char * tmp;
 	char str_copy[OBJ_NAME_SIZE];
@@ -648,4 +648,3 @@ int main (int argc, char *argv[]) {
 
 	return 0;
 }
-