warning-reducing patch



To get rid of some warnings, I added const in a few places. And made one or two other minor changes. OK to commit?

Index: backends/bdb-backend.c
===================================================================
RCS file: /cvs/gnome/gconf/backends/bdb-backend.c,v
retrieving revision 1.3
diff -p -u -r1.3 bdb-backend.c
--- backends/bdb-backend.c	2001/07/13 14:49:50	1.3
+++ backends/bdb-backend.c	2001/07/13 16:09:17
@@ -84,7 +84,7 @@ static GConfMetaInfo *vtable_bdb_query_m

 static void vtable_bdb_set_value (GConfSource * source,
 				  const gchar * key,
-				  GConfValue * value, GError ** err);
+				  const GConfValue * value, GError ** err);

 static GSList *vtable_bdb_all_entries (GConfSource * source,
 				       const gchar * dir,
@@ -359,7 +359,7 @@ vtable_bdb_query_metainfo (GConfSource *
  */
 static void
 vtable_bdb_set_value (GConfSource * source, const gchar * key,
-		      GConfValue * value, GError ** err)
+		      const GConfValue * value, GError ** err)
 {
   BDBSource *xs = (BDBSource *) source;

Index: backends/bdb.c
===================================================================
RCS file: /cvs/gnome/gconf/backends/bdb.c,v
retrieving revision 1.3
diff -p -u -r1.3 bdb.c
--- backends/bdb.c	2001/07/13 14:49:50	1.3
+++ backends/bdb.c	2001/07/13 16:09:17
@@ -900,7 +900,7 @@ bdb_query_value (BDB_Store * bdb,

 void
 bdb_put_value (BDB_Store * bdb, const char *key,
-	       GConfValue * val, GError ** err)
+	       const GConfValue * val, GError ** err)
 {
   size_t len;
   char *buf = bdb_serialize_value (val, &len);
Index: backends/bdb.h
===================================================================
RCS file: /cvs/gnome/gconf/backends/bdb.h,v
retrieving revision 1.3
diff -p -u -r1.3 bdb.h
--- backends/bdb.h	2001/07/13 14:49:50	1.3
+++ backends/bdb.h	2001/07/13 16:09:17
@@ -171,7 +171,7 @@ extern GSList *bdb_all_dirs (BDB_Store *
 			     GError ** err);
 extern GSList *bdb_all_entries (BDB_Store * bdb, const char *dirpath,
 				GSList * inlist, GError ** err);
-extern void bdb_put_value (BDB_Store * bdb, const char *key, GConfValue * val, +extern void bdb_put_value (BDB_Store * bdb, const char *key, const GConfValue * val,
 			   GError ** err);
 extern GSList *bdb_all_subdirs (BDB_Store * bdb, const char *dirname,
 				GError ** err);
Index: backends/val-encode.c
===================================================================
RCS file: /cvs/gnome/gconf/backends/val-encode.c,v
retrieving revision 1.1
diff -p -u -r1.1 val-encode.c
--- backends/val-encode.c	2000/10/06 17:26:24	1.1
+++ backends/val-encode.c	2001/07/13 16:09:17
@@ -209,10 +209,10 @@ bdb_size_value (const GConfValue * val)
  * serialized string back to a value
  */
 char *
-bdb_serialize_value (GConfValue * val, size_t * lenp)
+bdb_serialize_value (const GConfValue * val, size_t * lenp)
 {
   char *buf = tbuf;
-  char *t;
+  const char *t;
   size_t len = 0;
   g_assert (val != 0);
   switch (val->type)
Index: backends/val-encode.h
===================================================================
RCS file: /cvs/gnome/gconf/backends/val-encode.h,v
retrieving revision 1.1
diff -p -u -r1.1 val-encode.h
--- backends/val-encode.h	2000/10/06 17:26:24	1.1
+++ backends/val-encode.h	2001/07/13 16:09:18
@@ -30,7 +30,7 @@
  * encodes a GConfValue as a string, bdb_restore_value() decodes a
  * serialized string back to a value
  */
-extern char *bdb_serialize_value (GConfValue * val, size_t * lenp);
+extern char *bdb_serialize_value (const GConfValue * val, size_t * lenp);

 extern GConfValue *bdb_restore_value (const char *srz);

Index: backends/xml-backend.c
===================================================================
RCS file: /cvs/gnome/gconf/backends/xml-backend.c,v
retrieving revision 1.74
diff -p -u -r1.74 xml-backend.c
--- backends/xml-backend.c	2001/03/23 11:13:26	1.74
+++ backends/xml-backend.c	2001/07/13 16:09:19
@@ -169,7 +169,7 @@ static GConfMetaInfo*query_metainfo  (GC

 static void          set_value       (GConfSource* source,
                                       const gchar* key,
-                                      GConfValue* value,
+                                      const GConfValue* value,
                                       GError** err);

 static GSList*       all_entries    (GConfSource* source,
@@ -485,7 +485,7 @@ query_metainfo  (GConfSource* source, co
 }

 static void
-set_value (GConfSource* source, const gchar* key, GConfValue* value,
+set_value (GConfSource* source, const gchar* key, const GConfValue* value,
            GError** err)
 {
   XMLSource* xs = (XMLSource*)source;
Index: backends/xml-dir.c
===================================================================
RCS file: /cvs/gnome/gconf/backends/xml-dir.c,v
retrieving revision 1.19
diff -p -u -r1.19 xml-dir.c
--- backends/xml-dir.c	2001/03/23 11:13:26	1.19
+++ backends/xml-dir.c	2001/07/13 16:09:19
@@ -418,7 +418,7 @@ dir_sync        (Dir* d, GError** err)

 void
 dir_set_value   (Dir* d, const gchar* relative_key,
-                 GConfValue* value, GError** err)
+                 const GConfValue* value, GError** err)
 {
   Entry* e;

Index: backends/xml-dir.h
===================================================================
RCS file: /cvs/gnome/gconf/backends/xml-dir.h,v
retrieving revision 1.7
diff -p -u -r1.7 xml-dir.h
--- backends/xml-dir.h	2001/03/23 11:13:26	1.7
+++ backends/xml-dir.h	2001/07/13 16:09:19
@@ -45,7 +45,7 @@ const gchar*   dir_get_name        (Dir
 /* key should have no slashes in it */
 void           dir_set_value       (Dir          *d,
                                     const gchar  *relative_key,
-                                    GConfValue   *value,
+                                    const GConfValue *value,
                                     GError  **err);
 GConfValue*    dir_get_value       (Dir          *d,
                                     const gchar  *relative_key,
Index: backends/xml-entry.c
===================================================================
RCS file: /cvs/gnome/gconf/backends/xml-entry.c,v
retrieving revision 1.23
diff -p -u -r1.23 xml-entry.c
--- backends/xml-entry.c	2001/07/04 12:37:47	1.23
+++ backends/xml-entry.c	2001/07/13 16:09:20
@@ -25,7 +25,7 @@
 #include <libxml/xmlmemory.h>

 static void
-entry_sync_if_needed(Entry* e, GConfValue* val);
+entry_sync_if_needed(Entry* e);
 static GConfValue*
 node_extract_value(xmlNodePtr node, const gchar** locales, GError** err);
 static xmlNodePtr
@@ -134,7 +134,7 @@ entry_get_value(Entry* e, const gchar**
       GConfValue* newval;
       GError* error = NULL;

-      entry_sync_if_needed(e, NULL);
+      entry_sync_if_needed(e);

       newval = node_extract_value(e->node, locales, &error);
       if (newval != NULL)
@@ -160,11 +160,11 @@ entry_get_value(Entry* e, const gchar**
 }

 void
-entry_set_value(Entry* e, GConfValue* value)
+entry_set_value(Entry* e, const GConfValue* value)
 {
   g_return_if_fail(e != NULL);

-  entry_sync_if_needed(e, value);
+  entry_sync_if_needed(e);

   if (e->cached_value)
     gconf_value_free(e->cached_value);
@@ -291,7 +291,7 @@ entry_set_mod_user (Entry *e,
  */

 static void
-entry_sync_if_needed(Entry* e, GConfValue* val)
+entry_sync_if_needed(Entry* e)
 {
   if (!e->dirty)
     return;
@@ -353,7 +353,7 @@ entry_fill_from_node(Entry* e)
   else
     e->mod_user = NULL;

-  entry_sync_if_needed(e, NULL);
+  entry_sync_if_needed(e);

   if (e->cached_value != NULL)
     gconf_value_free(e->cached_value);
Index: backends/xml-entry.h
===================================================================
RCS file: /cvs/gnome/gconf/backends/xml-entry.h,v
retrieving revision 1.6
diff -p -u -r1.6 xml-entry.h
--- backends/xml-entry.h	2001/03/23 11:13:26	1.6
+++ backends/xml-entry.h	2001/07/13 16:09:20
@@ -42,7 +42,7 @@ GConfValue*    entry_get_value       (En
                                       const gchar **locales,
                                       GError  **err);
 void           entry_set_value       (Entry        *entry,
-                                      GConfValue   *value);
+                                      const GConfValue *value);
 gboolean       entry_unset_value     (Entry        *entry,
                                       const gchar  *locale);
 GConfMetaInfo* entry_get_metainfo    (Entry        *entry);
Index: gconf/gconf-backend.c
===================================================================
RCS file: /cvs/gnome/gconf/gconf/gconf-backend.c,v
retrieving revision 1.19
diff -p -u -r1.19 gconf-backend.c
--- gconf/gconf-backend.c	2000/09/11 21:58:47	1.19
+++ gconf/gconf-backend.c	2001/07/13 16:09:20
@@ -225,7 +225,7 @@ gconf_get_backend(const gchar* address,

           if (module == NULL)
             {
-              gchar* error = g_module_error();
+              const gchar* error = g_module_error();
               gconf_set_error(err,
GCONF_ERROR_FAILED, _("Error opening module `%s': %s\n"),
                               name, error);
Index: gconf/gconf-backend.h
===================================================================
RCS file: /cvs/gnome/gconf/gconf/gconf-backend.h,v
retrieving revision 1.28
diff -p -u -r1.28 gconf-backend.h
--- gconf/gconf-backend.h	2000/09/13 16:37:35	1.28
+++ gconf/gconf-backend.h	2001/07/13 16:09:21
@@ -85,7 +85,7 @@ struct _GConfBackendVTable {

   void                (* set_value)       (GConfSource* source,
                                            const gchar* key,
-                                           GConfValue* value,
+                                           const GConfValue* value,
                                            GError** err);

   /* Returns list of GConfEntry with key set to a relative
Index: gconf/gconf-internals.c
===================================================================
RCS file: /cvs/gnome/gconf/gconf/gconf-internals.c,v
retrieving revision 1.86
diff -p -u -r1.86 gconf-internals.c
--- gconf/gconf-internals.c	2001/05/11 14:57:44	1.86
+++ gconf/gconf-internals.c	2001/07/13 16:09:23
@@ -287,7 +287,7 @@ gconf_value_from_corba_value(const Confi
 }

 void
-fill_corba_value_from_gconf_value(GConfValue* value,
+fill_corba_value_from_gconf_value(const GConfValue* value,
                                    ConfigValue* cv)
 {
   if (value == NULL)
@@ -405,7 +405,7 @@ fill_corba_value_from_gconf_value(GConfV
 }

 ConfigValue*
-corba_value_from_gconf_value(GConfValue* value)
+corba_value_from_gconf_value(const GConfValue* value)
 {
   ConfigValue* cv;

@@ -511,7 +511,7 @@ gconf_type_from_corba_type(ConfigValueTy
 }

 void
-fill_corba_schema_from_gconf_schema(GConfSchema* sc,
+fill_corba_schema_from_gconf_schema(const GConfSchema* sc,
                                      ConfigSchema* cs)
 {
   cs->value_type = corba_type_from_gconf_type(sc->type);
@@ -546,7 +546,7 @@ fill_corba_schema_from_gconf_schema(GCon
 }

 ConfigSchema*
-corba_schema_from_gconf_schema(GConfSchema* sc)
+corba_schema_from_gconf_schema(const GConfSchema* sc)
 {
   ConfigSchema* cs;

Index: gconf/gconf-internals.h
===================================================================
RCS file: /cvs/gnome/gconf/gconf/gconf-internals.h,v
retrieving revision 1.56
diff -p -u -r1.56 gconf-internals.h
--- gconf/gconf-internals.h	2001/05/11 15:33:00	1.56
+++ gconf/gconf-internals.h	2001/07/13 16:09:23
@@ -46,8 +46,8 @@ gboolean gconf_file_test   (const gchar*
 gboolean gconf_file_exists (const gchar* filename);

 GConfValue*  gconf_value_from_corba_value      (const ConfigValue *value)
;
-ConfigValue* corba_value_from_gconf_value      (GConfValue        *value)
;
-void         fill_corba_value_from_gconf_value (GConfValue        *value,
+ConfigValue* corba_value_from_gconf_value      (const GConfValue  *value)
;
+void         fill_corba_value_from_gconf_value (const GConfValue  *value,
                                                 ConfigValue       *dest);
 ConfigValue* invalid_corba_value               (void);

@@ -55,9 +55,9 @@ ConfigValue* invalid_corba_value
 gchar* gconf_object_to_string (CORBA_Object obj,
                                GError **err);

-void          fill_corba_schema_from_gconf_schema (GConfSchema        *sc,
+void          fill_corba_schema_from_gconf_schema (const GConfSchema  *sc,
ConfigSchema *dest);
-ConfigSchema* corba_schema_from_gconf_schema      (GConfSchema        *sc)
;
+ConfigSchema* corba_schema_from_gconf_schema      (const GConfSchema  *sc)
;
 GConfSchema*  gconf_schema_from_corba_schema      (const ConfigSchema *cs)
;

 const gchar*   gconf_value_type_to_string   (GConfValueType  type);
Index: gconf/gconf-sources.c
===================================================================
RCS file: /cvs/gnome/gconf/gconf/gconf-sources.c,v
retrieving revision 1.32
diff -p -u -r1.32 gconf-sources.c
--- gconf/gconf-sources.c	2000/12/12 16:52:45	1.32
+++ gconf/gconf-sources.c	2001/07/13 16:09:24
@@ -150,7 +150,7 @@ gconf_source_query_metainfo      (GConfS
 static gboolean
 gconf_source_set_value        (GConfSource* source,
                                const gchar* key,
-                               GConfValue* value,
+                               const GConfValue* value,
                                GError** err)
 {
   g_return_val_if_fail(source != NULL, FALSE);
@@ -535,7 +535,7 @@ gconf_sources_query_value (GConfSources*
 void
 gconf_sources_set_value   (GConfSources* sources,
                            const gchar* key,
-                           GConfValue* value,
+                           const GConfValue* value,
                            GError** err)
 {
   GList* tmp;
Index: gconf/gconf-sources.h
===================================================================
RCS file: /cvs/gnome/gconf/gconf/gconf-sources.h,v
retrieving revision 1.17
diff -p -u -r1.17 gconf-sources.h
--- gconf/gconf-sources.h	2000/12/12 16:52:45	1.17
+++ gconf/gconf-sources.h	2001/07/13 16:09:25
@@ -80,7 +80,7 @@ GConfValue*   gconf_sources_query_value
                                                 GError   **err);
 void          gconf_sources_set_value          (GConfSources  *sources,
                                                 const gchar   *key,
-                                                GConfValue    *value,
+                                                const GConfValue *value,
                                                 GError   **err);
 void          gconf_sources_unset_value        (GConfSources  *sources,
                                                 const gchar   *key,
Index: gconf/gconf-value.c
===================================================================
RCS file: /cvs/gnome/gconf/gconf/gconf-value.c,v
retrieving revision 1.28
diff -p -u -r1.28 gconf-value.c
--- gconf/gconf-value.c	2001/04/28 20:28:54	1.28
+++ gconf/gconf-value.c	2001/07/13 16:09:25
@@ -637,17 +637,13 @@ gconf_value_to_string(const GConfValue*
 }

 static GSList*
-copy_value_list(GSList* list)
+copy_value_list(const GSList* list)
 {
   GSList* copy = NULL;
-  GSList* tmp = list;
+  const GSList* tmp;

-  while (tmp != NULL)
-    {
-      copy = g_slist_prepend(copy, gconf_value_copy(tmp->data));
-
-      tmp = g_slist_next(tmp);
-    }
+  for (tmp = list; tmp != NULL; tmp = tmp->next)
+    copy = g_slist_prepend(copy, gconf_value_copy(tmp->data));

   copy = g_slist_reverse(copy);

Index: gconf/gconf.c
===================================================================
RCS file: /cvs/gnome/gconf/gconf/gconf.c,v
retrieving revision 1.114
diff -p -u -r1.114 gconf.c
--- gconf/gconf.c	2001/04/28 20:28:54	1.114
+++ gconf/gconf.c	2001/07/13 16:09:27
@@ -911,7 +911,7 @@ gconf_engine_get_default_from_schema (GC

 gboolean
 gconf_engine_set (GConfEngine* conf, const gchar* key,
-                  GConfValue* value, GError** err)
+                  const GConfValue* value, GError** err)
 {
   ConfigValue* cv;
   CORBA_Environment ev;
Index: gconf/gconf.h
===================================================================
RCS file: /cvs/gnome/gconf/gconf/gconf.h,v
retrieving revision 1.63
diff -p -u -r1.63 gconf.h
--- gconf/gconf.h	2001/04/28 20:28:54	1.63
+++ gconf/gconf.h	2001/07/13 16:09:28
@@ -83,7 +83,7 @@ GConfValue* gconf_engine_get_default_fro
                                                   GError  **err);
 gboolean    gconf_engine_set                     (GConfEngine  *conf,
                                                   const gchar  *key,
-                                                  GConfValue   *value,
+                                                  const GConfValue *value,
                                                   GError  **err);
 gboolean    gconf_engine_unset                   (GConfEngine  *conf,
                                                   const gchar  *key,
Index: gconf/gconftool.c
===================================================================
RCS file: /cvs/gnome/gconf/gconf/gconftool.c,v
retrieving revision 1.56
diff -p -u -r1.56 gconftool.c
--- gconf/gconftool.c	2001/07/04 12:37:47	1.56
+++ gconf/gconftool.c	2001/07/13 16:09:29
@@ -48,7 +48,7 @@ static char* short_desc = NULL;
 static char* long_desc = NULL;
 static char* owner = NULL;
 static char* schema_file = NULL;
-static char* config_source = NULL;
+static const char* config_source = NULL;
 static int use_local_source = FALSE;
 static int makefile_install_mode = FALSE;
 static int break_key_mode = FALSE;
@@ -319,7 +319,7 @@ main (int argc, char** argv)
   LIBXML_TEST_VERSION;
   xmlKeepBlanksDefault(1);

-  ctx = poptGetContext("gconftool", argc, argv, options, 0);
+ ctx = poptGetContext("gconftool", argc, (const char **) argv, options, 0);

   poptReadDefaultConfig(ctx, TRUE);

===================================================================

    -- Darin




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]