inserted casts for C++.

Mon Sep  8 00:31:10 2003  Stefan Westerfeld  <stefan@space.twc.de>

        * glib/gbsearcharray.h: inserted casts for C++.
This commit is contained in:
Stefan Westerfeld 2003-09-07 22:36:58 +00:00 committed by Tim Janik
parent 558507bc5a
commit 896d38706b
7 changed files with 31 additions and 7 deletions

View File

@ -1,3 +1,7 @@
Mon Sep 8 00:31:10 2003 Stefan Westerfeld <stefan@space.twc.de>
* glib/gbsearcharray.h: inserted casts for C++.
2003-08-28 Matthias Clasen <maclas@gmx.de> 2003-08-28 Matthias Clasen <maclas@gmx.de>
* tests/patterntest.c (verbose): Fix a C99ism. (#120821, Thomas * tests/patterntest.c (verbose): Fix a C99ism. (#120821, Thomas

View File

@ -1,3 +1,7 @@
Mon Sep 8 00:31:10 2003 Stefan Westerfeld <stefan@space.twc.de>
* glib/gbsearcharray.h: inserted casts for C++.
2003-08-28 Matthias Clasen <maclas@gmx.de> 2003-08-28 Matthias Clasen <maclas@gmx.de>
* tests/patterntest.c (verbose): Fix a C99ism. (#120821, Thomas * tests/patterntest.c (verbose): Fix a C99ism. (#120821, Thomas

View File

@ -1,3 +1,7 @@
Mon Sep 8 00:31:10 2003 Stefan Westerfeld <stefan@space.twc.de>
* glib/gbsearcharray.h: inserted casts for C++.
2003-08-28 Matthias Clasen <maclas@gmx.de> 2003-08-28 Matthias Clasen <maclas@gmx.de>
* tests/patterntest.c (verbose): Fix a C99ism. (#120821, Thomas * tests/patterntest.c (verbose): Fix a C99ism. (#120821, Thomas

View File

@ -1,3 +1,7 @@
Mon Sep 8 00:31:10 2003 Stefan Westerfeld <stefan@space.twc.de>
* glib/gbsearcharray.h: inserted casts for C++.
2003-08-28 Matthias Clasen <maclas@gmx.de> 2003-08-28 Matthias Clasen <maclas@gmx.de>
* tests/patterntest.c (verbose): Fix a C99ism. (#120821, Thomas * tests/patterntest.c (verbose): Fix a C99ism. (#120821, Thomas

View File

@ -1,3 +1,7 @@
Mon Sep 8 00:31:10 2003 Stefan Westerfeld <stefan@space.twc.de>
* glib/gbsearcharray.h: inserted casts for C++.
2003-08-28 Matthias Clasen <maclas@gmx.de> 2003-08-28 Matthias Clasen <maclas@gmx.de>
* tests/patterntest.c (verbose): Fix a C99ism. (#120821, Thomas * tests/patterntest.c (verbose): Fix a C99ism. (#120821, Thomas

View File

@ -1,3 +1,7 @@
Mon Sep 8 00:31:10 2003 Stefan Westerfeld <stefan@space.twc.de>
* glib/gbsearcharray.h: inserted casts for C++.
2003-08-28 Matthias Clasen <maclas@gmx.de> 2003-08-28 Matthias Clasen <maclas@gmx.de>
* tests/patterntest.c (verbose): Fix a C99ism. (#120821, Thomas * tests/patterntest.c (verbose): Fix a C99ism. (#120821, Thomas

View File

@ -133,7 +133,7 @@ g_bsearch_array_create (const GBSearchConfig *bconfig)
size = sizeof (GBSearchArray) + bconfig->sizeof_node; size = sizeof (GBSearchArray) + bconfig->sizeof_node;
if (bconfig->flags & G_BSEARCH_ARRAY_ALIGN_POWER2) if (bconfig->flags & G_BSEARCH_ARRAY_ALIGN_POWER2)
size = G_BSEARCH_UPPER_POWER2 (size); size = G_BSEARCH_UPPER_POWER2 (size);
barray = g_realloc (NULL, size); barray = (GBSearchArray *) g_realloc (NULL, size);
memset (barray, 0, sizeof (GBSearchArray)); memset (barray, 0, sizeof (GBSearchArray));
return barray; return barray;
@ -210,10 +210,10 @@ g_bsearch_array_grow (GBSearchArray *barray,
new_size = G_BSEARCH_UPPER_POWER2 (sizeof (GBSearchArray) + new_size); new_size = G_BSEARCH_UPPER_POWER2 (sizeof (GBSearchArray) + new_size);
old_size = G_BSEARCH_UPPER_POWER2 (sizeof (GBSearchArray) + old_size); old_size = G_BSEARCH_UPPER_POWER2 (sizeof (GBSearchArray) + old_size);
if (old_size != new_size) if (old_size != new_size)
barray = g_realloc (barray, new_size); barray = (GBSearchArray *) g_realloc (barray, new_size);
} }
else else
barray = g_realloc (barray, sizeof (GBSearchArray) + new_size); barray = (GBSearchArray *) g_realloc (barray, sizeof (GBSearchArray) + new_size);
node = G_BSEARCH_ARRAY_NODES (barray) + index * bconfig->sizeof_node; node = G_BSEARCH_ARRAY_NODES (barray) + index * bconfig->sizeof_node;
g_memmove (node + bconfig->sizeof_node, node, (barray->n_nodes - index) * bconfig->sizeof_node); g_memmove (node + bconfig->sizeof_node, node, (barray->n_nodes - index) * bconfig->sizeof_node);
barray->n_nodes += 1; barray->n_nodes += 1;
@ -233,7 +233,7 @@ g_bsearch_array_insert (GBSearchArray *barray,
} }
else else
{ {
node = g_bsearch_array_lookup_insertion (barray, bconfig, key_node); node = (guint8 *) g_bsearch_array_lookup_insertion (barray, bconfig, key_node);
if (G_LIKELY (node)) if (G_LIKELY (node))
{ {
guint index = g_bsearch_array_get_index (barray, bconfig, node); guint index = g_bsearch_array_get_index (barray, bconfig, node);
@ -253,7 +253,7 @@ g_bsearch_array_replace (GBSearchArray *barray,
const GBSearchConfig *bconfig, const GBSearchConfig *bconfig,
gconstpointer key_node) gconstpointer key_node)
{ {
guint8 *node = g_bsearch_array_lookup (barray, bconfig, key_node); guint8 *node = (guint8 *) g_bsearch_array_lookup (barray, bconfig, key_node);
if (G_LIKELY (node)) /* expected path */ if (G_LIKELY (node)) /* expected path */
memcpy (node, key_node, bconfig->sizeof_node); memcpy (node, key_node, bconfig->sizeof_node);
else /* revert to insertion */ else /* revert to insertion */
@ -282,10 +282,10 @@ g_bsearch_array_remove (GBSearchArray *barray,
new_size = G_BSEARCH_UPPER_POWER2 (sizeof (GBSearchArray) + new_size); new_size = G_BSEARCH_UPPER_POWER2 (sizeof (GBSearchArray) + new_size);
old_size = G_BSEARCH_UPPER_POWER2 (sizeof (GBSearchArray) + old_size); old_size = G_BSEARCH_UPPER_POWER2 (sizeof (GBSearchArray) + old_size);
if (old_size != new_size) if (old_size != new_size)
barray = g_realloc (barray, new_size); barray = (GBSearchArray *) g_realloc (barray, new_size);
} }
else else
barray = g_realloc (barray, sizeof (GBSearchArray) + new_size); barray = (GBSearchArray *) g_realloc (barray, sizeof (GBSearchArray) + new_size);
} }
return barray; return barray;
} }