[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xine-cvslog
Subject:    [xine-cvs] HG: xine-ui: Fix XLOCK and XUNLOCK macros wrt block
From:       Darren Salt <linux () youmustbejoking ! demon ! co ! uk>
Date:       2010-07-18 12:03:09
Message-ID: 5ef9ce9770c663657e0d.1279454530 () hg ! debian ! org
[Download RAW message or body]

# HG changeset patch
# User Darren Salt <linux@youmustbejoking.demon.co.uk>
# Date 1279454530 -3600
# Node ID 5ef9ce9770c663657e0d182c3d4441a460cb0abd
# Parent  07e67ed0a9719dc3769bb29b0641d9bd11fcbe13
Fix XLOCK and XUNLOCK macros wrt block structure.

diff --git a/src/xitk/xine-toolkit/widget.h b/src/xitk/xine-toolkit/widget.h
--- a/src/xitk/xine-toolkit/widget.h
+++ b/src/xitk/xine-toolkit/widget.h
@@ -137,7 +137,7 @@
 #if 1
 
 static int displ;
-#define XLOCK(DISP) {                                                         \
+#define XLOCK(DISP) do {                                                      \
     int i;                                                                    \
     displ++;                                                                  \
     for(i = 0; i < displ; i++) printf("%d",i);                                \
@@ -147,9 +147,9 @@
     XLockDisplay(DISP);                                                       \
     printf(" %s: %s(%d) got the lock\n",                                      \
            __FILE__, __FUNCTION__, __LINE__);                                 \
-  }
+  } while (0)
 
-#define XUNLOCK(DISP) {                                                       \
+#define XUNLOCK(DISP) do {                                                    \
     int i;                                                                    \
     for(i = 0; i < displ; i++) printf("%d",i);                                \
     displ--;                                                                  \
@@ -157,37 +157,33 @@
            __FILE__, __FUNCTION__, __LINE__);                                 \
     fflush(stdout);                                                           \
     XUnlockDisplay(DISP);                                                     \
-  }
+  } while (0)
 
 #else
 
-#define XLOCK(DISP) {                                                         \
+#define XLOCK(DISP) do {                                                      \
     printf("%s: %s(%d) XLockDisplay (%d)\n",                                  \
            __FILE__, __FUNCTION__, __LINE__, DISP);                           \
     fflush(stdout);                                                           \
     XLockDisplay(DISP);                                                       \
     printf("%s: %s(%d) got the lock (%d)\n",                                  \
            __FILE__, __FUNCTION__, __LINE__, DISP);                           \
-  }
+  } while (0)
 
-#define XUNLOCK(DISP) {                                                       \
+#define XUNLOCK(DISP) do {                                                    \
     printf("%s: %s(%d) XUnlockDisplay (%d)\n",                                \
            __FILE__, __FUNCTION__, __LINE__, DISP);                           \
     fflush(stdout);                                                           \
     XUnlockDisplay(DISP);                                                     \
-  }
+  } while (0)
 
 #endif
 
 #else
 
-#define XLOCK(DISP) {                                                         \
-    XLockDisplay(DISP);                                                       \
-  }
+#define XLOCK(DISP) XLockDisplay(DISP)
 
-#define XUNLOCK(DISP) {                                                       \
-    XUnlockDisplay(DISP);                                                     \
-  }
+#define XUNLOCK(DISP) XUnlockDisplay(DISP)
 
 #endif
 

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Xine-cvslog mailing list
Xine-cvslog@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xine-cvslog
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic