[gtk+] Drop atom-related cast macros
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Drop atom-related cast macros
- Date: Thu, 14 Dec 2017 04:48:17 +0000 (UTC)
commit 84eaf3da7defcd344248c547b3de0c797d224d6c
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Dec 13 23:47:02 2017 -0500
Drop atom-related cast macros
These don't really add anything, just drop them.
gdk/gdkdevice.c | 2 +-
gdk/gdktypes.h | 17 -----------------
gdk/x11/gdkproperty-x11.c | 13 +++++--------
3 files changed, 6 insertions(+), 26 deletions(-)
---
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index 92e6a61..eca18de 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -1236,7 +1236,7 @@ gdk_device_list_axes (GdkDevice *device)
GdkAxisInfo axis_info;
axis_info = g_array_index (device->axes, GdkAxisInfo, i);
- axes = g_list_prepend (axes, GDK_ATOM_TO_POINTER (axis_info.label));
+ axes = g_list_prepend (axes, axis_info.label);
}
return g_list_reverse (axes);
diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h
index 533bdfa..d77094a 100644
--- a/gdk/gdktypes.h
+++ b/gdk/gdktypes.h
@@ -102,23 +102,6 @@ typedef cairo_rectangle_int_t GdkRectangle;
*/
typedef const char *GdkAtom;
-/**
- * GDK_ATOM_TO_POINTER:
- * @atom: a #GdkAtom.
- *
- * Converts a #GdkAtom into a pointer type.
- */
-#define GDK_ATOM_TO_POINTER(atom) ((gpointer) (atom))
-
-/**
- * GDK_POINTER_TO_ATOM:
- * @ptr: a pointer containing a #GdkAtom.
- *
- * Extracts a #GdkAtom from a pointer. The #GdkAtom must have been
- * stored in the pointer with GDK_ATOM_TO_POINTER().
- */
-#define GDK_POINTER_TO_ATOM(ptr) ((GdkAtom)(ptr))
-
/* Forward declarations of commonly used types */
typedef struct _GdkRGBA GdkRGBA;
typedef struct _GdkContentFormats GdkContentFormats;
diff --git a/gdk/x11/gdkproperty-x11.c b/gdk/x11/gdkproperty-x11.c
index 646f5e6..dc3ca81 100644
--- a/gdk/x11/gdkproperty-x11.c
+++ b/gdk/x11/gdkproperty-x11.c
@@ -47,12 +47,10 @@ insert_atom_pair (GdkDisplay *display,
display_x11->atom_to_virtual = g_hash_table_new (g_direct_hash, NULL);
}
- g_hash_table_insert (display_x11->atom_from_virtual,
- GDK_ATOM_TO_POINTER (virtual_atom),
+ g_hash_table_insert (display_x11->atom_from_virtual, (gpointer)virtual_atom,
GUINT_TO_POINTER (xatom));
g_hash_table_insert (display_x11->atom_to_virtual,
- GUINT_TO_POINTER (xatom),
- GDK_ATOM_TO_POINTER (virtual_atom));
+ GUINT_TO_POINTER (xatom), (gpointer)virtual_atom);
}
static Atom
@@ -62,8 +60,7 @@ lookup_cached_xatom (GdkDisplay *display,
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
if (display_x11->atom_from_virtual)
- return GPOINTER_TO_UINT (g_hash_table_lookup (display_x11->atom_from_virtual,
- GDK_ATOM_TO_POINTER (atom)));
+ return GPOINTER_TO_UINT (g_hash_table_lookup (display_x11->atom_from_virtual, atom));
return None;
}
@@ -192,8 +189,8 @@ gdk_x11_xatom_to_atom_for_display (GdkDisplay *display,
display_x11 = GDK_X11_DISPLAY (display);
if (display_x11->atom_to_virtual)
- virtual_atom = GDK_POINTER_TO_ATOM (g_hash_table_lookup (display_x11->atom_to_virtual,
- GUINT_TO_POINTER (xatom)));
+ virtual_atom = g_hash_table_lookup (display_x11->atom_to_virtual,
+ GUINT_TO_POINTER (xatom));
if (!virtual_atom)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]