Răsfoiți Sursa

cpg.h, objdb.h, coroaph.h: more const/size_t

* include/corosync/cpg.h (cpg_callbacks_t):
* include/corosync/mar_cpg.h (marshall_to_mar_cpg_name_t):
* lib/cpg.c (cpg_join, cpg_leave):
* lib/cpg.c (cpg_mcast_joined): make iovec const.
* include/corosync/cpg.h (cpg_mcast_joined): update prototype
...

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2048 fd59a12c-fef9-0310-b244-a6a79926bd2f
Jim Meyering 17 ani în urmă
părinte
comite
8ef14f11eb

+ 2 - 2
exec/objdb.c

@@ -673,7 +673,7 @@ static int object_destroy (
 static int object_valid_set (
 	hdb_handle_t object_handle,
 	struct object_valid *object_valid_list,
-	unsigned int object_valid_list_entries)
+	size_t object_valid_list_entries)
 {
 	struct object_instance *instance;
 	unsigned int res;
@@ -701,7 +701,7 @@ error_exit:
 static int object_key_valid_set (
 		hdb_handle_t object_handle,
 		struct object_key_valid *object_key_valid_list,
-		unsigned int object_key_valid_list_entries)
+		size_t object_key_valid_list_entries)
 {
 	struct object_instance *instance;
 	unsigned int res;

+ 4 - 4
include/corosync/cpg.h

@@ -130,7 +130,7 @@ cs_error_t cpg_fd_get (
 	cpg_handle_t handle,
 	int *fd);
 
-/* 
+/*
  * Get and set contexts for a CPG handle
  */
 cs_error_t cpg_context_get (
@@ -157,14 +157,14 @@ cs_error_t cpg_dispatch (
  */
 cs_error_t cpg_join (
 	cpg_handle_t handle,
-	struct cpg_name *group);
+	const struct cpg_name *group);
 
 /*
  * Leave one or more groups
  */
 cs_error_t cpg_leave (
 	cpg_handle_t handle,
-	struct cpg_name *group);
+	const struct cpg_name *group);
 
 /*
  * Multicast to groups joined with cpg_join.
@@ -174,7 +174,7 @@ cs_error_t cpg_leave (
 cs_error_t cpg_mcast_joined (
 	cpg_handle_t handle,
 	cpg_guarantee_t guarantee,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len);
 
 /*

+ 3 - 2
include/corosync/engine/coroapi.h

@@ -244,12 +244,12 @@ struct corosync_api_v1 {
 	int (*object_valid_set) (
 		hdb_handle_t object_handle,
 		struct object_valid *object_valid_list,
-		unsigned int object_valid_list_entries);
+		size_t object_valid_list_entries);
 
 	int (*object_key_valid_set) (
 		hdb_handle_t object_handle,
 		struct object_key_valid *object_key_valid_list,
-		unsigned int object_key_valid_list_entries);
+		size_t object_key_valid_list_entries);
 
 	int (*object_find_create) (
 		hdb_handle_t parent_object_handle,
@@ -415,6 +415,7 @@ struct corosync_api_v1 {
 
 	int (*totem_ring_reenable) (void);
 
+	/* FIXME: const iovec? */
 	int (*totem_mcast) (struct iovec *iovec, unsigned int iov_len, unsigned int guarantee);
 
 	int (*totem_ifaces_get) (

+ 2 - 2
include/corosync/engine/objdb.h

@@ -119,12 +119,12 @@ struct objdb_iface_ver0 {
 	int (*object_valid_set) (
 		hdb_handle_t object_handle,
 		struct object_valid *object_valid_list,
-		unsigned int object_valid_list_entries);
+		size_t object_valid_list_entries);
 
 	int (*object_key_valid_set) (
 		hdb_handle_t object_handle,
 		struct object_key_valid *object_key_valid_list,
-		unsigned int object_key_valid_list_entries);
+		size_t object_key_valid_list_entries);
 
 	int (*object_find_create) (
 		hdb_handle_t parent_object_handle,

+ 4 - 4
lib/cpg.c

@@ -1,7 +1,7 @@
 /*
  * vi: set autoindent tabstop=4 shiftwidth=4 :
  *
- * Copyright (c) 2006-2008 Red Hat, Inc.
+ * Copyright (c) 2006-2009 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -386,7 +386,7 @@ error_put:
 
 cs_error_t cpg_join (
     cpg_handle_t handle,
-    struct cpg_name *group)
+    const struct cpg_name *group)
 {
 	cs_error_t error;
 	struct cpg_inst *cpg_inst;
@@ -449,7 +449,7 @@ error_exit:
 
 cs_error_t cpg_leave (
     cpg_handle_t handle,
-    struct cpg_name *group)
+    const struct cpg_name *group)
 {
 	cs_error_t error;
 	struct cpg_inst *cpg_inst;
@@ -492,7 +492,7 @@ error_exit:
 cs_error_t cpg_mcast_joined (
 	cpg_handle_t handle,
 	cpg_guarantee_t guarantee,
-	struct iovec *iovec,
+	const struct iovec *iovec,
 	unsigned int iov_len)
 {
 	int i;