[297/906] Revert "Fix callbacks passed over XEvents on 64 bit architectures"
authorDavid Schleef <ds@schleef.org>
Wed, 11 Feb 2009 05:57:08 +0000 (21:57 -0800)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:21 +0000 (19:31 +0000)
This reverts commit 280771d09b58617b27201027de0e1194da376e72.

gst-libs/gst/gl/gstglwindow_x11.c

index 14dc124..d097f3b 100644 (file)
@@ -626,19 +626,8 @@ gst_gl_window_run_loop (GstGLWindow * window)
         /* Message sent with gst_gl_window_send_message */
         if (wm_gl != None && event.xclient.message_type == wm_gl) {
           if (priv->running) {
-#if SIZEOF_VOID_P == 8
-            GstGLWindowCB custom_cb =
-                (GstGLWindowCB) (((event.xclient.
-                        data.l[0] & 0xffffffff) << 32) | (event.xclient.
-                    data.l[1] & 0xffffffff));
-            gpointer custom_data =
-                (gpointer) (((event.xclient.
-                        data.l[2] & 0xffffffff) << 32) | (event.xclient.
-                    data.l[3] & 0xffffffff));
-#else
             GstGLWindowCB custom_cb = (GstGLWindowCB) event.xclient.data.l[0];
             gpointer custom_data = (gpointer) event.xclient.data.l[1];
-#endif
 
             if (!custom_cb || !custom_data)
               g_debug ("custom cb not initialized\n");
@@ -669,19 +658,8 @@ gst_gl_window_run_loop (GstGLWindow * window)
         /* message sent with gst_gl_window_quit_loop */
         else if (wm_quit_loop != None
             && event.xclient.message_type == wm_quit_loop) {
-#if SIZEOF_VOID_P == 8
-          GstGLWindowCB destroy_cb =
-              (GstGLWindowCB) (((event.xclient.
-                      data.l[0] & 0xffffffff) << 32) | (event.xclient.
-                  data.l[1] & 0xffffffff));
-          gpointer destroy_data =
-              (gpointer) (((event.xclient.
-                      data.l[2] & 0xffffffff) << 32) | (event.xclient.
-                  data.l[3] & 0xffffffff));
-#else
           GstGLWindowCB destroy_cb = (GstGLWindowCB) event.xclient.data.l[0];
           gpointer destroy_data = (gpointer) event.xclient.data.l[1];
-#endif
 
           g_debug ("Quit loop message %" G_GUINT64_FORMAT "\n",
               (guint64) priv->internal_win_id);
@@ -692,19 +670,10 @@ gst_gl_window_run_loop (GstGLWindow * window)
           /* make sure last pendings send message calls are executed */
           XFlush (priv->device);
           while (XCheckTypedEvent (priv->device, ClientMessage, &pending_event)) {
-#if SIZEOF_VOID_P == 8
             GstGLWindowCB custom_cb =
-                (GstGLWindowCB) (((event.xclient.
-                        data.l[0] & 0xffffffff) << 32) | (event.xclient.
-                    data.l[1] & 0xffffffff));
-            gpointer custom_data =
-                (gpointer) (((event.xclient.
-                        data.l[2] & 0xffffffff) << 32) | (event.xclient.
-                    data.l[3] & 0xffffffff));
-#else
-            GstGLWindowCB custom_cb = (GstGLWindowCB) event.xclient.data.l[0];
-            gpointer custom_data = (gpointer) event.xclient.data.l[1];
-#endif
+                (GstGLWindowCB) pending_event.xclient.data.l[0];
+            gpointer custom_data = (gpointer) pending_event.xclient.data.l[1];
+
             g_debug ("execute last pending custom x events\n");
 
             if (!custom_cb || !custom_data)
@@ -804,15 +773,8 @@ gst_gl_window_quit_loop (GstGLWindow * window, GstGLWindowCB callback,
       event.xclient.message_type =
           XInternAtom (priv->disp_send, "WM_QUIT_LOOP", True);;
       event.xclient.format = 32;
-#if SIZEOF_VOID_P == 8
-      event.xclient.data.l[0] = (((long) callback) >> 32) & 0xffffffff;
-      event.xclient.data.l[1] = (((long) callback)) & 0xffffffff;
-      event.xclient.data.l[2] = (((long) data) >> 32) & 0xffffffff;
-      event.xclient.data.l[3] = (((long) data)) & 0xffffffff;
-#else
       event.xclient.data.l[0] = (long) callback;
       event.xclient.data.l[1] = (long) data;
-#endif
 
       XSendEvent (priv->disp_send, priv->internal_win_id, FALSE, NoEventMask,
           &event);
@@ -843,15 +805,8 @@ gst_gl_window_send_message (GstGLWindow * window, GstGLWindowCB callback,
       event.xclient.message_type =
           XInternAtom (priv->disp_send, "WM_GL_WINDOW", True);
       event.xclient.format = 32;
-#if SIZEOF_VOID_P == 8
-      event.xclient.data.l[0] = (((long) callback) >> 32) & 0xffffffff;
-      event.xclient.data.l[1] = (((long) callback)) & 0xffffffff;
-      event.xclient.data.l[2] = (((long) data) >> 32) & 0xffffffff;
-      event.xclient.data.l[3] = (((long) data)) & 0xffffffff;
-#else
       event.xclient.data.l[0] = (long) callback;
       event.xclient.data.l[1] = (long) data;
-#endif
 
       XSendEvent (priv->disp_send, priv->internal_win_id, FALSE, NoEventMask,
           &event);