Drop atom-related cast macros

These don't really add anything, just drop them.
This commit is contained in:
Matthias Clasen 2017-12-13 23:47:02 -05:00
parent 54a6273191
commit 84eaf3da7d
3 changed files with 6 additions and 26 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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)
{