[atomix/wip/kill-libxml] Fixed GQuark to pointer conversion warnings on x86_64
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [atomix/wip/kill-libxml] Fixed GQuark to pointer conversion warnings on x86_64
- Date: Mon, 30 Mar 2015 11:11:30 +0000 (UTC)
commit e3c35bc14667b344685f8bd23d28b35ee792e09d
Author: Robert Roth <robert roth off gmail com>
Date: Mon Mar 30 14:11:13 2015 +0300
Fixed GQuark to pointer conversion warnings on x86_64
src/theme.c | 10 +++++-----
src/tile.c | 3 ---
src/tile.h | 3 +++
3 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/theme.c b/src/theme.c
index bc37605..45f3086 100644
--- a/src/theme.c
+++ b/src/theme.c
@@ -224,7 +224,7 @@ static GdkPixbuf *create_sub_images (Theme *theme, Tile *tile,
for (; elem != NULL; elem = elem->next)
{
- ti = g_datalist_id_get_data (&priv->images, (GQuark) elem->data);
+ ti = g_datalist_id_get_data (&priv->images, GPOINTER_TO_QUARK (elem->data));
if (ti == NULL)
continue;
@@ -233,7 +233,7 @@ static GdkPixbuf *create_sub_images (Theme *theme, Tile *tile,
{
#ifdef DEBUG
g_warning ("Couldn't load sub image: %s",
- g_quark_to_string ((GQuark) elem->data));
+ g_quark_to_string (GPOINTER_TO_QUARK (elem->data)));
#endif
continue;
}
@@ -275,8 +275,8 @@ gboolean theme_apply_decoration (Theme *theme, Tile *tile)
return FALSE;
n_decorations = g_slist_length (ti->decorations);
- decor_id = (GQuark) g_slist_nth_data (ti->decorations,
- counter++ % n_decorations);
+ decor_id = GPOINTER_TO_QUARK (g_slist_nth_data (ti->decorations,
+ counter++ % n_decorations));
tile_add_sub_id (tile, decor_id, TILE_SUB_OVERLAY);
return TRUE;
@@ -460,5 +460,5 @@ void theme_add_image_decoration (Theme *theme, GQuark base, GQuark decor)
if (ti == NULL)
return;
- ti->decorations = g_slist_append (ti->decorations, (gpointer) decor);
+ ti->decorations = g_slist_append (ti->decorations, GQUARK_TO_POINTER (decor));
}
diff --git a/src/tile.c b/src/tile.c
index a6d3536..8cdad69 100644
--- a/src/tile.c
+++ b/src/tile.c
@@ -22,9 +22,6 @@
#include "tile.h"
#include "xml-util.h"
-#define GPOINTER_TO_QUARK(p) ((GQuark) (p))
-#define GQUARK_TO_POINTER(p) ((gpointer) (p))
-
static GObjectClass *parent_class = NULL;
static void tile_class_init (GObjectClass *class);
diff --git a/src/tile.h b/src/tile.h
index 856f941..9c4d4d6 100644
--- a/src/tile.h
+++ b/src/tile.h
@@ -22,6 +22,9 @@
#include <glib-object.h>
+#define GPOINTER_TO_QUARK(p) ((GQuark) GPOINTER_TO_INT (p))
+#define GQUARK_TO_POINTER(p) ((gpointer) GINT_TO_POINTER (p))
+
#define TILE_TYPE (tile_get_type ())
#define TILE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TILE_TYPE, Tile))
#define TILE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), TILE_TYPE, TileClass))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]