[gimp] app: void * -> gpointer in GimpIdTable
- From: Martin Nordholts <martinn src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: void * -> gpointer in GimpIdTable
- Date: Wed, 4 May 2011 21:12:25 +0000 (UTC)
commit c4097d4ff4b23d3f3a60f430ff37e7a87f6063e4
Author: Martin Nordholts <martinn src gnome org>
Date: Wed May 4 23:14:21 2011 +0200
app: void * -> gpointer in GimpIdTable
app/core/gimpidtable.c | 8 ++++----
app/core/gimpidtable.h | 8 ++++----
app/tests/test-gimpidtable.c | 32 ++++++++++++++++----------------
3 files changed, 24 insertions(+), 24 deletions(-)
---
diff --git a/app/core/gimpidtable.c b/app/core/gimpidtable.c
index ab3175d..be5bc5b 100644
--- a/app/core/gimpidtable.c
+++ b/app/core/gimpidtable.c
@@ -124,7 +124,7 @@ gimp_id_table_new (void)
* Returns: The assigned ID.
**/
gint
-gimp_id_table_insert (GimpIdTable *id_table, void *data)
+gimp_id_table_insert (GimpIdTable *id_table, gpointer data)
{
gint new_id;
@@ -154,7 +154,7 @@ gimp_id_table_insert (GimpIdTable *id_table, void *data)
* Returns: The used ID if successful, -1 if it was already in use.
**/
gint
-gimp_id_table_insert_with_id (GimpIdTable *id_table, gint id, void *data)
+gimp_id_table_insert_with_id (GimpIdTable *id_table, gint id, gpointer data)
{
g_return_val_if_fail (GIMP_IS_ID_TABLE (id_table), 0);
g_return_val_if_fail (id > 0, 0);
@@ -177,7 +177,7 @@ gimp_id_table_insert_with_id (GimpIdTable *id_table, gint id, void *data)
* entry in the id table.
**/
void
-gimp_id_table_replace (GimpIdTable *id_table, gint id, void *data)
+gimp_id_table_replace (GimpIdTable *id_table, gint id, gpointer data)
{
g_return_if_fail (GIMP_IS_ID_TABLE (id_table));
g_return_if_fail (id > 0);
@@ -194,7 +194,7 @@ gimp_id_table_replace (GimpIdTable *id_table, gint id, void *data)
*
* Returns: The data, or NULL if no data with the given ID was found.
**/
-void *
+gpointer
gimp_id_table_lookup (GimpIdTable *id_table, gint id)
{
g_return_val_if_fail (GIMP_IS_ID_TABLE (id_table), NULL);
diff --git a/app/core/gimpidtable.h b/app/core/gimpidtable.h
index e5cec24..bbb0dd0 100644
--- a/app/core/gimpidtable.h
+++ b/app/core/gimpidtable.h
@@ -52,14 +52,14 @@ struct _GimpIdTableClass
GType gimp_id_table_get_type (void) G_GNUC_CONST;
GimpIdTable * gimp_id_table_new (void);
gint gimp_id_table_insert (GimpIdTable *id_table,
- void *data);
+ gpointer data);
gint gimp_id_table_insert_with_id (GimpIdTable *id_table,
gint id,
- void *data);
+ gpointer data);
void gimp_id_table_replace (GimpIdTable *id_table,
gint id,
- void *data);
-void * gimp_id_table_lookup (GimpIdTable *id_table,
+ gpointer data);
+gpointer gimp_id_table_lookup (GimpIdTable *id_table,
gint id);
gboolean gimp_id_table_remove (GimpIdTable *id_table,
gint id);
diff --git a/app/tests/test-gimpidtable.c b/app/tests/test-gimpidtable.c
index 79e0640..fb4ae1e 100644
--- a/app/tests/test-gimpidtable.c
+++ b/app/tests/test-gimpidtable.c
@@ -43,8 +43,8 @@ typedef struct
} GimpTestFixture;
-static void *data1 = (void *) 0x00000001;
-static void *data2 = (void *) 0x00000002;
+static gpointer data1 = (gpointer) 0x00000001;
+static gpointer data2 = (gpointer) 0x00000002;
static void
@@ -71,8 +71,8 @@ static void
insert_and_lookup (GimpTestFixture *f,
gconstpointer data)
{
- gint ret_id = gimp_id_table_insert (f->id_table, data1);
- void *ret_data = gimp_id_table_lookup (f->id_table, ret_id);
+ gint ret_id = gimp_id_table_insert (f->id_table, data1);
+ gpointer ret_data = gimp_id_table_lookup (f->id_table, ret_id);
g_assert (ret_data == data1);
}
@@ -86,10 +86,10 @@ static void
insert_twice (GimpTestFixture *f,
gconstpointer data)
{
- gint ret_id = gimp_id_table_insert (f->id_table, data1);
- void *ret_data = gimp_id_table_lookup (f->id_table, ret_id);
- gint ret_id2 = gimp_id_table_insert (f->id_table, data2);
- void *ret_data2 = gimp_id_table_lookup (f->id_table, ret_id2);
+ gint ret_id = gimp_id_table_insert (f->id_table, data1);
+ gpointer ret_data = gimp_id_table_lookup (f->id_table, ret_id);
+ gint ret_id2 = gimp_id_table_insert (f->id_table, data2);
+ gpointer ret_data2 = gimp_id_table_lookup (f->id_table, ret_id2);
g_assert (ret_id != ret_id2);
g_assert (ret_data == data1);
@@ -107,8 +107,8 @@ insert_with_id (GimpTestFixture *f,
{
const int id = 10;
- int ret_id = gimp_id_table_insert_with_id (f->id_table, id, data1);
- void *ret_data = gimp_id_table_lookup (f->id_table, id);
+ int ret_id = gimp_id_table_insert_with_id (f->id_table, id, data1);
+ gpointer ret_data = gimp_id_table_lookup (f->id_table, id);
g_assert (ret_id == id);
g_assert (ret_data == data1);
@@ -126,10 +126,10 @@ insert_with_id_existing (GimpTestFixture *f,
{
const int id = 10;
- int ret_id = gimp_id_table_insert_with_id (f->id_table, id, data1);
- void *ret_data = gimp_id_table_lookup (f->id_table, ret_id);
- int ret_id2 = gimp_id_table_insert_with_id (f->id_table, id, data2);
- void *ret_data2 = gimp_id_table_lookup (f->id_table, ret_id2);
+ int ret_id = gimp_id_table_insert_with_id (f->id_table, id, data1);
+ gpointer ret_data = gimp_id_table_lookup (f->id_table, ret_id);
+ int ret_id2 = gimp_id_table_insert_with_id (f->id_table, id, data2);
+ gpointer ret_data2 = gimp_id_table_lookup (f->id_table, ret_id2);
g_assert (id == ret_id);
g_assert (ret_id2 == -1);
@@ -148,7 +148,7 @@ replace (GimpTestFixture *f,
gconstpointer data)
{
int ret_id = gimp_id_table_insert (f->id_table, data1);
- void *ret_data;
+ gpointer ret_data;
gimp_id_table_replace (f->id_table, ret_id, data2);
ret_data = gimp_id_table_lookup (f->id_table, ret_id);
@@ -168,7 +168,7 @@ replace_as_insert (GimpTestFixture *f,
{
const int id = 10;
- void *ret_data;
+ gpointer ret_data;
gimp_id_table_replace (f->id_table, id, data1);
ret_data = gimp_id_table_lookup (f->id_table, id);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]