diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2005-11-02 01:21:21 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2005-11-02 01:21:21 +0800 |
commit | ae67ff7c049ce8c86c6241b4299e7a9d65802670 (patch) | |
tree | dee30998d00ac05623bdc907ae30199887d813a1 /lib/egg/egg-toolbars-model.c | |
parent | ac160bd5b4143c52f8a75c049a27f56136ce1bae (diff) | |
download | gsoc2013-epiphany-ae67ff7c049ce8c86c6241b4299e7a9d65802670.tar gsoc2013-epiphany-ae67ff7c049ce8c86c6241b4299e7a9d65802670.tar.gz gsoc2013-epiphany-ae67ff7c049ce8c86c6241b4299e7a9d65802670.tar.bz2 gsoc2013-epiphany-ae67ff7c049ce8c86c6241b4299e7a9d65802670.tar.lz gsoc2013-epiphany-ae67ff7c049ce8c86c6241b4299e7a9d65802670.tar.xz gsoc2013-epiphany-ae67ff7c049ce8c86c6241b4299e7a9d65802670.tar.zst gsoc2013-epiphany-ae67ff7c049ce8c86c6241b4299e7a9d65802670.zip |
Use GINT_TO_POINTER/GPOINTER_TO_INT when stuffing ints into pointers, and
2005-11-01 Christian Persch <chpe@cvs.gnome.org>
* lib/egg/egg-toolbars-model.c: (item_node_new), (item_node_free),
(egg_toolbars_model_get_n_avail), (egg_toolbars_model_set_n_avail):
Use GINT_TO_POINTER/GPOINTER_TO_INT when stuffing ints into pointers,
and fix gcc 2.95 issues.
Diffstat (limited to 'lib/egg/egg-toolbars-model.c')
-rwxr-xr-x | lib/egg/egg-toolbars-model.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/egg/egg-toolbars-model.c b/lib/egg/egg-toolbars-model.c index 1d8c59476..a00c75328 100755 --- a/lib/egg/egg-toolbars-model.c +++ b/lib/egg/egg-toolbars-model.c @@ -254,17 +254,18 @@ static GNode * item_node_new (const char *name, EggToolbarsModel *model) { EggToolbarsItem *item; + int count; g_return_val_if_fail (name != NULL, NULL); item = g_new (EggToolbarsItem, 1); item->name = g_strdup (name); - gint count = (gint) g_hash_table_lookup (model->priv->avail, item->name); + count = GPOINTER_TO_INT (g_hash_table_lookup (model->priv->avail, item->name)); if (count > G_MININT && count < G_MAXINT) g_hash_table_insert (model->priv->avail, g_strdup (item->name), - (gpointer) (count-1)); + GINT_TO_POINTER (count - 1)); return g_node_new (item); } @@ -273,12 +274,13 @@ static void item_node_free (GNode *item_node, EggToolbarsModel *model) { EggToolbarsItem *item = item_node->data; + int count; - gint count = (gint) g_hash_table_lookup (model->priv->avail, item->name); - if (count < G_MAXINT-1) + count = GPOINTER_TO_INT (g_hash_table_lookup (model->priv->avail, item->name)); + if (count < G_MAXINT - 1) g_hash_table_insert (model->priv->avail, g_strdup (item->name), - (gpointer) (count+1)); + GINT_TO_POINTER (count + 1)); g_free (item->name); g_free (item); @@ -839,11 +841,11 @@ egg_toolbars_model_get_avail (EggToolbarsModel *model) gint egg_toolbars_model_get_n_avail (EggToolbarsModel *model, const char *name) { - return (gint) g_hash_table_lookup (model->priv->avail, name); + return GPOINTER_TO_INT (g_hash_table_lookup (model->priv->avail, name)); } void egg_toolbars_model_set_n_avail (EggToolbarsModel *model, const char *name, gint count) { - g_hash_table_insert (model->priv->avail, g_strdup (name), (gpointer) count); + g_hash_table_insert (model->priv->avail, g_strdup (name), GINT_TO_POINTER (count)); } |