pygtk r3028 - in trunk: . gtk



Author: paulp
Date: Thu Aug 28 19:29:51 2008
New Revision: 3028
URL: http://svn.gnome.org/viewvc/pygtk?rev=3028&view=rev

Log:
2008-08-28  Paul Pogonyshev  <pogonyshev gmx net>

	Bug 534658 â Avoid warning when compiling against Python 2.5 or
	older

	* gtk/gtk.override (pygtk_main_watch_prepare): Avoid GCC warning.


Modified:
   trunk/ChangeLog
   trunk/gtk/gtk.override

Modified: trunk/gtk/gtk.override
==============================================================================
--- trunk/gtk/gtk.override	(original)
+++ trunk/gtk/gtk.override	Thu Aug 28 19:29:51 2008
@@ -1069,8 +1069,6 @@
 pygtk_main_watch_prepare(GSource *source,
 			 int     *timeout)
 {
-    PySignalWatchSource *real_source = (PySignalWatchSource *)source;
-
     /* Python only invokes signal handlers from the main thread,
      * so if a thread other than the main thread receives the signal
      * from the kernel, PyErr_CheckSignals() from that thread will
@@ -1087,24 +1085,27 @@
 #endif
 
 #ifdef HAVE_PYSIGNAL_SETWAKEUPFD
-    if (real_source->fds[0] != 0)
-	return FALSE;
+    {
+        PySignalWatchSource *real_source = (PySignalWatchSource *)source;
 
-    /* Unfortunately we need to create a new pipe here instead of
-     * reusing the pipe inside the GMainContext.
-     * Ideally an api should be added to GMainContext which allows us
-     * to reuse that pipe which would suit us perfectly fine.     
-     */
-    if (pipe(real_source->fds) < 0)
-	g_error("Cannot create main loop pipe: %s\n",
-		g_strerror(errno));
-
-    real_source->fd.fd = real_source->fds[0];
-    real_source->fd.events = G_IO_IN | G_IO_HUP | G_IO_ERR;
-    g_source_add_poll(source, &real_source->fd);
+        if (real_source->fds[0] != 0)
+            return FALSE;
 
-    PySignal_SetWakeupFd(real_source->fds[1]);
+        /* Unfortunately we need to create a new pipe here instead of
+         * reusing the pipe inside the GMainContext.  Ideally an api
+         * should be added to GMainContext which allows us to reuse
+         * that pipe which would suit us perfectly fine.
+         */
+        if (pipe(real_source->fds) < 0)
+            g_error("Cannot create main loop pipe: %s\n",
+                    g_strerror(errno));
+
+        real_source->fd.fd = real_source->fds[0];
+        real_source->fd.events = G_IO_IN | G_IO_HUP | G_IO_ERR;
+        g_source_add_poll(source, &real_source->fd);
 
+        PySignal_SetWakeupFd(real_source->fds[1]);
+    }
 #else /* !HAVE_PYSIGNAL_SETWAKEUPFD */
     /* If we're using 2.5 or an earlier version of python we
      * will default to a timeout every second, be aware,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]