From: Jim Meyering <meyer...@redhat.com>

I'd suspected this would be necessary, but until now hadn't
found a case in which it actually was.  That case:
totemconfig.c's totem_key_change_notify.
It has a priv_data_pt parameter that is used like this:

  struct totem_config *totem_config = priv_data_pt;

and totem_config is in turn passed as arg #2 to
totem_volatile_config_read, where it is decidedly non-const.

git grep -l 'const void \*priv' \
  |xargs perl -pi -e 's,const (void \*priv_data_pt),$1,'
---
 include/corosync/engine/coroapi.h |    8 ++++----
 include/corosync/engine/objdb.h   |    2 +-
 services/votequorum.c             |    4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/corosync/engine/coroapi.h 
b/include/corosync/engine/coroapi.h
index 55470b5..0c05e49 100644
--- a/include/corosync/engine/coroapi.h
+++ b/include/corosync/engine/coroapi.h
@@ -171,18 +171,18 @@ typedef void (*object_key_change_notify_fn_t)(
        const void *object_name_pt, size_t object_name_len,
        const void *key_name_pt, size_t key_len,
        const void *key_value_pt, size_t key_value_len,
-       const void *priv_data_pt);
+       void *priv_data_pt);

 typedef void (*object_create_notify_fn_t) (
        hdb_handle_t parent_object_handle,
        hdb_handle_t object_handle,
        const uint8_t *name_pt, size_t name_len,
-       const void *priv_data_pt);
+       void *priv_data_pt);

 typedef void (*object_destroy_notify_fn_t) (
        hdb_handle_t parent_object_handle,
        const uint8_t *name_pt, size_t name_len,
-       const void *priv_data_pt);
+       void *priv_data_pt);

 typedef void (*object_notify_callback_fn_t)(
        hdb_handle_t object_handle,
@@ -194,7 +194,7 @@ typedef void (*object_notify_callback_fn_t)(
 typedef void (*object_reload_notify_fn_t) (
        objdb_reload_notify_type_t,
        int flush,
-       const void *priv_data_pt);
+       void *priv_data_pt);

 #endif /* OBJECT_PARENT_HANDLE_DEFINED */

diff --git a/include/corosync/engine/objdb.h b/include/corosync/engine/objdb.h
index 2eac2fe..9ef6b0d 100644
--- a/include/corosync/engine/objdb.h
+++ b/include/corosync/engine/objdb.h
@@ -66,7 +66,7 @@ typedef void (*object_key_change_notify_fn_t)(
        const void *object_name_pt, size_t object_name_len,
        const void *key_name_pt, size_t key_len,
        const void *key_value_pt, size_t key_value_len,
-       const void *priv_data_pt);
+       void *priv_data_pt);

 typedef void (*object_create_notify_fn_t) (unsigned int parent_object_handle,
 hdb_handle_t object_handle,
diff --git a/services/votequorum.c b/services/votequorum.c
index 635b983..dc0fc08 100644
--- a/services/votequorum.c
+++ b/services/votequorum.c
@@ -1629,7 +1629,7 @@ static void quorum_key_change_notify(object_change_type_t 
change_type,
                                     size_t object_name_len,
                                     const void *key_name_pt, size_t key_len,
                                     const void *key_value_pt, size_t 
key_value_len,
-                                    const void *priv_data_pt)
+                                    void *priv_data_pt)
 {
        if (memcmp(object_name_pt, "quorum", object_name_len) == 0)
                reread_config(object_handle);
@@ -1639,7 +1639,7 @@ static void quorum_key_change_notify(object_change_type_t 
change_type,
 /* Called when the objdb is reloaded */
 static void votequorum_objdb_reload_notify(
        objdb_reload_notify_type_t type, int flush,
-       const void *priv_data_pt)
+       void *priv_data_pt)
 {
        /*
         * A new quorum {} key might exist, cancel the
-- 
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