Here are 6 tiny, uncontroversial changes to avoid a total of almost 60 warnings:

22 totemconfig.c:112: note: expected 'char *' but argument is of type 'const 
char *'
13 mainconfig.c:68: note: expected 'char *' but argument is of type 'const char 
*'
9 logsysbench.c:73: note: expected 'char *' but argument is of type 'const char 
*'
8 totemconfig.c:91: note: expected 'char *' but argument is of type 'const char 
*'
6 votequorum.c:448: note: expected 'char *' but argument is of type 'const char 
*'



>From b869235dde8df4edc18706f9ba0caa058af5a42e Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email protected]>
Date: Mon, 23 Mar 2009 08:38:22 +0100
Subject: [PATCH 1/6] avoid compiler warnings

* lcr/lcr_ifact.c (lcr_component_register): Remove decl of unused var.
---
 lcr/lcr_ifact.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/lcr/lcr_ifact.c b/lcr/lcr_ifact.c
index c447a67..debc8a8 100644
--- a/lcr/lcr_ifact.c
+++ b/lcr/lcr_ifact.c
@@ -521,7 +521,6 @@ void lcr_component_register (struct lcr_comp *comp)
 {
        struct lcr_component_instance *instance;
        static hdb_handle_t comp_handle;
-       int res;

        hdb_handle_create (&lcr_component_instance_database,
                sizeof (struct lcr_component_instance),
--
1.6.2.rc1.285.gc5f54


>From e74d84d32855e97d34755d5296c462d00fcca2bf Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email protected]>
Date: Tue, 24 Mar 2009 11:13:17 +0100
Subject: [PATCH 2/6] avoid 22 warnings

* exec/totemconfig.c (objdb_get_int): Make "key" const.
---
 exec/totemconfig.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/exec/totemconfig.c b/exec/totemconfig.c
index 756f962..bc1779a 100644
--- a/exec/totemconfig.c
+++ b/exec/totemconfig.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2002-2005 MontaVista Software, Inc.
- * Copyright (c) 2006-2008 Red Hat, Inc.
+ * Copyright (c) 2006-2009 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -112,7 +112,7 @@ static inline int objdb_get_string (
 static inline void objdb_get_int (
        struct objdb_iface_ver0 *objdb,
        hdb_handle_t object_service_handle,
-       char *key, unsigned int *intvalue)
+       const char *key, unsigned int *intvalue)
 {
        char *value = NULL;

--
1.6.2.rc1.285.gc5f54


>From 900cd8677132d63cf47278d20e375da5b5fcfef3 Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email protected]>
Date: Tue, 24 Mar 2009 11:15:01 +0100
Subject: [PATCH 3/6] avoid 13 warnings

* exec/mainconfig.c (objdb_get_string): Make "key" const.
---
 exec/mainconfig.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/exec/mainconfig.c b/exec/mainconfig.c
index 9d4a600..6b5eb9c 100644
--- a/exec/mainconfig.c
+++ b/exec/mainconfig.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2002-2005 MontaVista Software, Inc.
- * Copyright (c) 2006-2008 Red Hat, Inc.
+ * Copyright (c) 2006-2009 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -68,7 +68,7 @@ static void add_logsys_config_notification(
 static inline int objdb_get_string (
        struct objdb_iface_ver0 *objdb,
        hdb_handle_t object_service_handle,
-       char *key, char **value)
+       const char *key, char **value)
 {
        int res;

--
1.6.2.rc1.285.gc5f54


>From c1c5b18ff17bf98c6f7a94b382ea953b98371dc9 Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email protected]>
Date: Tue, 24 Mar 2009 11:16:27 +0100
Subject: [PATCH 4/6] avoid 9 warnings

* test/logsysbench.c (bm_finish): Make parameter "const".
---
 test/logsysbench.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/logsysbench.c b/test/logsysbench.c
index edd1701..c58a9b8 100644
--- a/test/logsysbench.c
+++ b/test/logsysbench.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008 Red Hat, Inc.
+ * Copyright (c) 2008, 2009 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -70,7 +70,7 @@ void bm_start (void)
 {
         gettimeofday (&tv1, NULL);
 }
-void bm_finish (char *operation)
+void bm_finish (const char *operation)
 {
         gettimeofday (&tv2, NULL);
         timersub (&tv2, &tv1, &tv_elapsed);
--
1.6.2.rc1.285.gc5f54


>From a7b2c63769e6f621642d71a55665611a6646860e Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email protected]>
Date: Tue, 24 Mar 2009 11:18:52 +0100
Subject: [PATCH 5/6] avoid 8 warnings

* exec/totemconfig.c (objdb_get_string): Make "key" const.
---
 exec/totemconfig.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/exec/totemconfig.c b/exec/totemconfig.c
index bc1779a..5bd5949 100644
--- a/exec/totemconfig.c
+++ b/exec/totemconfig.c
@@ -91,7 +91,7 @@ static void add_totem_config_notification(
 static inline int objdb_get_string (
        struct objdb_iface_ver0 *objdb,
        hdb_handle_t object_service_handle,
-       char *key, char **value)
+       const char *key, char **value)
 {
        int res;

--
1.6.2.rc1.285.gc5f54


>From e55ce98cc23871c2618b3a29f6f40c570061cfa5 Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email protected]>
Date: Tue, 24 Mar 2009 11:19:56 +0100
Subject: [PATCH 6/6] avoid 6 warnings

* services/votequorum.c (objdb_get_int): Make "key" const.
---
 services/votequorum.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/services/votequorum.c b/services/votequorum.c
index 4ccd12b..537276d 100644
--- a/services/votequorum.c
+++ b/services/votequorum.c
@@ -445,8 +445,10 @@ static inline int objdb_get_string(struct corosync_api_v1 
*corosync, unsigned in
        return -1;
 }

-static inline void objdb_get_int(struct corosync_api_v1 *corosync, unsigned 
int object_service_handle,
-                                char *key, unsigned int *intvalue, unsigned 
int default_value)
+static inline void objdb_get_int(struct corosync_api_v1 *corosync,
+                                unsigned int object_service_handle,
+                                const char *key, unsigned int *intvalue,
+                                unsigned int default_value)
 {
        char *value = NULL;

--
1.6.2.rc1.285.gc5f54
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to