[glib/resources] Make g_resource_new_from_data take a const pointer



commit 0a5caeb0adfcb15d1103ae6d9509d3022ac267bf
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Dec 22 11:47:21 2011 +0100

    Make g_resource_new_from_data take a const pointer
    
    This avoids warnings when linking in resources

 gio/gresource.c |    6 +++---
 gio/gresource.h |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gio/gresource.c b/gio/gresource.c
index 6f2ff79..9540acf 100644
--- a/gio/gresource.c
+++ b/gio/gresource.c
@@ -83,13 +83,13 @@ g_resource_unref (GResource *resource)
 }
 
 GResource *
-g_resource_new_from_data (void *data, gsize length,
+g_resource_new_from_data (const void *data, gsize length,
 			  GDestroyNotify free_data, GError **error)
 {
   GResource *resource;
   GvdbTable *table;
 
-  table = gvdb_table_new_from_data (data,
+  table = gvdb_table_new_from_data ((void *)data,
 				    length,
 				    TRUE,
 				    NULL,
@@ -102,7 +102,7 @@ g_resource_new_from_data (void *data, gsize length,
 
   resource = g_new0 (GResource, 1);
   resource->table = table;
-  resource->data = data;
+  resource->data = (void *)data;
   resource->free_data = free_data;
 
   return resource;
diff --git a/gio/gresource.h b/gio/gresource.h
index 9515d3b..02567db 100644
--- a/gio/gresource.h
+++ b/gio/gresource.h
@@ -34,7 +34,7 @@ G_BEGIN_DECLS
 #define G_RESOURCE_ERROR (g_resource_error_quark ())
 GQuark g_resource_error_quark (void);
 
-GResource *   g_resource_new_from_data       (void         *data,
+GResource *   g_resource_new_from_data       (const void   *data,
 					      gsize         length,
 					      GDestroyNotify free,
 					      GError      **error);



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