[evolution-patches] Remove use of deprecated GLib symbols
- From: Matthew Barnes <mbarnes redhat com>
- To: evolution-patches <evolution-patches gnome org>
- Subject: [evolution-patches] Remove use of deprecated GLib symbols
- Date: Thu, 17 Aug 2006 17:40:50 -0400
I compiled evolution-2.7.91 with the G_DISABLE_DEPRECATED flag and
patched the errors. Please review the attachment.
I also tried this with evolution-data-server-1.7.91 and
evolution-connector-2.7.91, but they compiled successfully.
To reproduce: $ CFLAGS=G_DISABLE_DEPRECATED=1 ./configure; make
Deprecated Symbols
------------------
GMemChunk API
Found in: e-tree-memory.c
e-tree-sorted.c
Solution: Use GSlice API
g_strcasecmp
Found in: e-meeting-list-view.c
Solution: Use g_ascii_strcasecmp
Errors Encountered
------------------
e-tree-memory.c: In function 'e_tree_memory_class_init':
e-tree-memory.c:361: error: 'node_chunk' undeclared (first use in this
function)
e-tree-memory.c:361: error: (Each undeclared identifier is reported only
once
e-tree-memory.c:361: error: for each function it appears in.)
e-tree-memory.c:361: warning: implicit declaration of function
'g_mem_chunk_create'
e-tree-memory.c:361: error: expected expression before 'ETreeMemoryPath'
e-tree-memory.c: In function 'e_tree_memory_node_insert':
e-tree-memory.c:512: warning: implicit declaration of function
'g_chunk_new0'
e-tree-memory.c:512: error: expected expression before 'ETreeMemoryPath'
e-tree-memory.c:512: warning: assignment makes pointer from integer
without a cast
e-tree-memory.c: In function 'child_free':
e-tree-memory.c:587: warning: implicit declaration of function
'g_chunk_free'
e-tree-memory.c:587: error: 'node_chunk' undeclared (first use in this
function)
b
e-tree-sorted.c: In function 'free_path':
e-tree-sorted.c:368: warning: implicit declaration of function
'g_chunk_free'
e-tree-sorted.c:368: error: 'node_chunk' undeclared (first use in this
function)
e-tree-sorted.c:368: error: (Each undeclared identifier is reported only
once
e-tree-sorted.c:368: error: for each function it appears in.)
e-tree-sorted.c: In function 'new_path':
e-tree-sorted.c:376: warning: implicit declaration of function
'g_chunk_new0'
e-tree-sorted.c:376: error: expected expression before 'ETreeSortedPath'
e-tree-sorted.c:376: warning: assignment makes pointer from integer
without a cast
e-tree-sorted.c: In function 'e_tree_sorted_class_init':
e-tree-sorted.c:1160: error: 'node_chunk' undeclared (first use in this
function)
e-tree-sorted.c:1160: warning: implicit declaration of function
'g_mem_chunk_create'
e-tree-sorted.c:1160: error: expected expression before
'ETreeSortedPath'
e-meeting-list-view.c: In function 'process_section':
e-meeting-list-view.c:789: error: 'g_strcasecmp' undeclared (first use
in this function)
e-meeting-list-view.c:789: error: (Each undeclared identifier is
reported only once
e-meeting-list-view.c:789: error: for each function it appears in.)
--- evolution-2.7.91/widgets/table/e-tree-sorted.c.deprecated 2006-08-17 08:20:03.000000000 -0400
+++ evolution-2.7.91/widgets/table/e-tree-sorted.c 2006-08-17 08:24:38.000000000 -0400
@@ -47,12 +47,9 @@
/* maximum insertions between an idle event that we will do without scheduling an idle sort */
#define ETS_INSERT_MAX (4)
-#define TREEPATH_CHUNK_AREA_SIZE (30 * sizeof (ETreeSortedPath))
-
#define d(x)
static ETreeModel *parent_class;
-static GMemChunk *node_chunk;
enum {
NODE_RESORTED,
@@ -365,7 +362,7 @@
free_path (ETreeSortedPath *path)
{
free_children(path);
- g_chunk_free(path, node_chunk);
+ g_slice_free(ETreeSortedPath, path);
}
static ETreeSortedPath *
@@ -373,7 +370,7 @@
{
ETreeSortedPath *path;
- path = g_chunk_new0 (ETreeSortedPath, node_chunk);
+ path = g_slice_new0 (ETreeSortedPath);
path->corresponding = corresponding;
path->parent = parent;
@@ -1157,8 +1154,6 @@
parent_class = g_type_class_peek_parent (klass);
- node_chunk = g_mem_chunk_create (ETreeSortedPath, TREEPATH_CHUNK_AREA_SIZE, G_ALLOC_AND_FREE);
-
klass->node_resorted = NULL;
object_class->dispose = ets_dispose;
--- evolution-2.7.91/widgets/table/e-tree-memory.c.deprecated 2006-08-17 08:15:11.000000000 -0400
+++ evolution-2.7.91/widgets/table/e-tree-memory.c 2006-08-17 08:17:18.000000000 -0400
@@ -38,10 +38,7 @@
#include "e-tree-memory.h"
-#define TREEPATH_CHUNK_AREA_SIZE (30 * sizeof (ETreeMemoryPath))
-
static ETreeModelClass *parent_class;
-static GMemChunk *node_chunk;
enum {
FILL_IN_CHILDREN,
@@ -358,8 +355,6 @@
parent_class = g_type_class_peek_parent (klass);
- node_chunk = g_mem_chunk_create (ETreeMemoryPath, TREEPATH_CHUNK_AREA_SIZE, G_ALLOC_AND_FREE);
-
signals [FILL_IN_CHILDREN] =
g_signal_new ("fill_in_children",
E_OBJECT_CLASS_TYPE (object_class),
@@ -509,7 +504,7 @@
if (!tree_model->priv->frozen)
e_tree_model_pre_change(E_TREE_MODEL(tree_model));
- new_path = g_chunk_new0 (ETreeMemoryPath, node_chunk);
+ new_path = g_slice_new0 (ETreeMemoryPath);
new_path->node_data = node_data;
new_path->children_computed = FALSE;
@@ -584,7 +579,7 @@
etree->priv->destroy_func (node->node_data, etree->priv->destroy_user_data);
}
- g_chunk_free(node, node_chunk);
+ g_slice_free (ETreeMemoryPath, node);
}
/**
--- evolution-2.7.91/calendar/gui/e-meeting-list-view.c.deprecated 2006-08-17 08:45:20.000000000 -0400
+++ evolution-2.7.91/calendar/gui/e-meeting-list-view.c 2006-08-17 08:48:02.000000000 -0400
@@ -786,7 +786,7 @@
g_slist_free (*la);
*la = NULL;
} else
- *la = g_slist_remove_link (*la, g_slist_find_custom (*la, attendee, (GCompareFunc)g_strcasecmp));
+ *la = g_slist_remove_link (*la, g_slist_find_custom (*la, attendee, (GCompareFunc)g_ascii_strcasecmp));
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]