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

totem: const+unsigned+size_t

* exec/totempg.c (totempg_groups_mcast_groups):
(totempg_groups_send_ok_groups):
* include/corosync/totem/totem.h (interface_count):
(private_key_len, threads, heartbeat_failures_allowed):
* include/corosync/totem/totempg.h:

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2027 fd59a12c-fef9-0310-b244-a6a79926bd2f
Jim Meyering 17 лет назад
Родитель
Сommit
e7fa045d5a
3 измененных файлов с 30 добавлено и 30 удалено
  1. 12 12
      exec/totempg.c
  2. 6 6
      include/corosync/totem/totem.h
  3. 12 12
      include/corosync/totem/totempg.h

+ 12 - 12
exec/totempg.c

@@ -1041,8 +1041,8 @@ error_exit:
 
 int totempg_groups_join (
 	hdb_handle_t handle,
-	struct totempg_group *groups,
-	int group_cnt)
+	const struct totempg_group *groups,
+	size_t group_cnt)
 {
 	struct totempg_group_instance *instance;
 	struct totempg_group *new_groups;
@@ -1076,8 +1076,8 @@ error_exit:
 
 int totempg_groups_leave (
 	hdb_handle_t handle,
-	struct totempg_group *groups,
-	int group_cnt)
+	const struct totempg_group *groups,
+	size_t group_cnt)
 {
 	struct totempg_group_instance *instance;
 	unsigned int res;
@@ -1195,10 +1195,10 @@ void totempg_groups_joined_release (int msg_count)
 int totempg_groups_mcast_groups (
 	hdb_handle_t handle,
 	int guarantee,
-	struct totempg_group *groups,
-	int groups_cnt,
-	struct iovec *iovec,
-	int iov_len)
+	const struct totempg_group *groups,
+	size_t groups_cnt,
+	const struct iovec *iovec,
+	size_t iov_len)
 {
 	struct totempg_group_instance *instance;
 	unsigned short group_len[MAX_GROUPS_PER_MSG + 1];
@@ -1243,10 +1243,10 @@ error_exit:
  */
 int totempg_groups_send_ok_groups (
 	hdb_handle_t handle,
-	struct totempg_group *groups,
-	int groups_cnt,
-	struct iovec *iovec,
-	int iov_len)
+	const struct totempg_group *groups,
+	size_t groups_cnt,
+	const struct iovec *iovec,
+	size_t iov_len)
 {
 	struct totempg_group_instance *instance;
 	unsigned int size = 0;

+ 6 - 6
include/corosync/totem/totem.h

@@ -7,7 +7,7 @@
  * All rights reserved.
  *
  * This software licensed under BSD license, the text of which follows:
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
  *
@@ -82,7 +82,7 @@ struct totem_config {
 	 * network
 	 */
 	struct totem_interface *interfaces;
-	int interface_count;
+	unsigned int interface_count;
 	unsigned int node_id;
 
 	/*
@@ -90,7 +90,7 @@ struct totem_config {
 	 */
 	unsigned char private_key[128];
 
-	int private_key_len;
+	unsigned int private_key_len;
 
 	/*
 	 * Totem configuration parameters
@@ -132,9 +132,9 @@ struct totem_config {
 	unsigned int net_mtu;
 
 	unsigned int threads;
-	
+
 	unsigned int heartbeat_failures_allowed;
-	
+
 	unsigned int max_network_delay;
 
 	unsigned int window_size;
@@ -147,7 +147,7 @@ struct totem_config {
 #define TOTEM_CONFIGURATION_TYPE
 enum totem_configuration_type {
 	TOTEM_CONFIGURATION_REGULAR,
-	TOTEM_CONFIGURATION_TRANSITIONAL	
+	TOTEM_CONFIGURATION_TRANSITIONAL
 };
 
 #define TOTEM_CALLBACK_TOKEN_TYPE

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

@@ -96,13 +96,13 @@ extern int totempg_groups_finalize (
 
 extern int totempg_groups_join (
 	hdb_handle_t handle,
-	struct totempg_group *groups,
-	int gruop_cnt);
+	const struct totempg_group *groups,
+	size_t group_cnt);
 
 extern int totempg_groups_leave (
 	hdb_handle_t handle,
-	struct totempg_group *groups,
-	int gruop_cnt);
+	const struct totempg_group *groups,
+	size_t group_cnt);
 
 extern int totempg_groups_mcast_joined (
 	hdb_handle_t handle,
@@ -121,17 +121,17 @@ extern void totempg_groups_joined_release (
 extern int totempg_groups_mcast_groups (
 	hdb_handle_t handle,
 	int guarantee,
-	struct totempg_group *groups,
-	int groups_cnt,
-	struct iovec *iovec,
-	int iov_len);
+	const struct totempg_group *groups,
+	size_t groups_cnt,
+	const struct iovec *iovec,
+	size_t iov_len);
 
 extern int totempg_groups_send_ok_groups (
 	hdb_handle_t handle,
-	struct totempg_group *groups,
-	int groups_cnt,
-	struct iovec *iovec,
-	int iov_len);
+	const struct totempg_group *groups,
+	size_t groups_cnt,
+	const struct iovec *iovec,
+	size_t iov_len);
 	
 extern int totempg_ifaces_get (
 	unsigned int nodeid,