Here are a few more.

>From 052f43f2c3ec1a1a7d6a2e9038ee1fb0e7d222e9 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyer...@redhat.com>
Date: Thu, 2 Apr 2009 22:18:51 +0200
Subject: [PATCH 1/2] 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
...
---
 exec/objdb.c                      |    4 ++--
 include/corosync/cpg.h            |    8 ++++----
 include/corosync/engine/coroapi.h |    5 +++--
 include/corosync/engine/objdb.h   |    4 ++--
 lib/cpg.c                         |    8 ++++----
 5 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/exec/objdb.c b/exec/objdb.c
index 609fe5d..d04f959 100644
--- a/exec/objdb.c
+++ b/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;
diff --git a/include/corosync/cpg.h b/include/corosync/cpg.h
index 6e849d3..8093dfb 100644
--- a/include/corosync/cpg.h
+++ b/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);

 /*
diff --git a/include/corosync/engine/coroapi.h 
b/include/corosync/engine/coroapi.h
index 6f6c69d..2537557 100644
--- a/include/corosync/engine/coroapi.h
+++ b/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) (
diff --git a/include/corosync/engine/objdb.h b/include/corosync/engine/objdb.h
index 56cd8a7..ce401a9 100644
--- a/include/corosync/engine/objdb.h
+++ b/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,
diff --git a/lib/cpg.c b/lib/cpg.c
index 74b0e2f..5ac3555 100644
--- a/lib/cpg.c
+++ b/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;
-- 
1.6.2.rc1.285.gc5f54


>From 3b8203561bb4709e4151b6bc456d27ec9d4e5f95 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyer...@redhat.com>
Date: Thu, 9 Apr 2009 19:51:30 +0200
Subject: [PATCH 2/2] coroapi.h: Make totem_mcast's *iovec param const.

* include/corosync/engine/coroapi.h (struct corosync_api_v1):
[totem_mcast]: Make *iovec param const.
---
 exec/main.c                       |    2 +-
 exec/main.h                       |    4 ++--
 include/corosync/engine/coroapi.h |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/exec/main.c b/exec/main.c
index 548f709..b0d0461 100644
--- a/exec/main.c
+++ b/exec/main.c
@@ -473,7 +473,7 @@ void main_get_config_modules(struct config_iface_ver0 
***modules, int *num)
 }

 int main_mcast (
-        struct iovec *iovec,
+        const struct iovec *iovec,
         unsigned int iov_len,
         unsigned int guarantee)
 {
diff --git a/exec/main.h b/exec/main.h
index 5588513..3035200 100644
--- a/exec/main.h
+++ b/exec/main.h
@@ -7,7 +7,7 @@
  * Author: Steven Dake (sd...@redhat.com)
  *
  * 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:
  *
@@ -56,7 +56,7 @@ extern unsigned long long *(*main_clm_get_by_nodeid) 
(unsigned int node_id);
 extern void main_get_config_modules(struct config_iface_ver0 ***modules, int 
*num);

 extern int main_mcast (
-       struct iovec *iovec,
+       const struct iovec *iovec,
        unsigned int iov_len,
        unsigned int guarantee);

diff --git a/include/corosync/engine/coroapi.h 
b/include/corosync/engine/coroapi.h
index 2537557..13e07ad 100644
--- a/include/corosync/engine/coroapi.h
+++ b/include/corosync/engine/coroapi.h
@@ -415,8 +415,8 @@ 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_mcast) (const struct iovec *iovec,
+                           unsigned int iov_len, unsigned int guarantee);

        int (*totem_ifaces_get) (
                unsigned int nodeid,
-- 
1.6.2.rc1.285.gc5f54

_______________________________________________
Openais mailing list
Openais@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to