[beryl-commits] r1467 - branches/beryl-3d-plugin

roico at server.beryl-project.org roico at server.beryl-project.org
Sat Dec 2 00:22:29 CET 2006


Author: roico
Date: 2006-12-02 00:22:27 +0100 (Sat, 02 Dec 2006)
New Revision: 1467

Modified:
   branches/beryl-3d-plugin/3d.c
Log:
fixed macros...


Modified: branches/beryl-3d-plugin/3d.c
===================================================================
--- branches/beryl-3d-plugin/3d.c	2006-11-30 16:32:56 UTC (rev 1466)
+++ branches/beryl-3d-plugin/3d.c	2006-12-01 23:22:27 UTC (rev 1467)
@@ -236,14 +236,14 @@
 	return FALSE;
 }
 
-#define VIEWPORT(x, s) ( ( ( ((x>=0)?x: x + s->hsize * s->width) ) / (s->width)) % (s->hsize) )
-#define SCREEN(x, s) (x / s->outputDev[0].width)
+#define VIEWPORT(x, s) ( ( ( ((x >= 0)? x: x + (s)->hsize * (s)->width) ) / ((s)->width)) % ((s)->hsize) )
+#define SCREEN(x, s) ( (x) / (s)->outputDev[0].width )
 
-#define RIGHT_VIEWPORT(w) VIEWPORT(w->attrib.x + w->attrib.width -1, w->screen)
-#define LEFT_VIEWPORT(w) VIEWPORT(w->attrib.x + 1, w->screen)
+#define RIGHT_VIEWPORT(w) VIEWPORT( (w)->attrib.x + (w)->attrib.width -1, (w)->screen)
+#define LEFT_VIEWPORT(w) VIEWPORT( (w)->attrib.x + 1, (w)->screen)
 
-#define RIGHT_SCREEN(w) SCREEN(w->attrib.x + w->attrib.width -1, w->screen)
-#define LEFT_SCREEN(w) SCREEN(w->attrib.x + 1, w->screen)
+#define RIGHT_SCREEN(w) SCREEN( (w)->attrib.x + (w)->attrib.width -1, (w)->screen)
+#define LEFT_SCREEN(w) SCREEN((w)->attrib.x + 1, (w)->screen)
 
 #define IS_IN_VIEWPORT(w, i) ( ( LEFT_VIEWPORT(w) > RIGHT_VIEWPORT(w) && !(LEFT_VIEWPORT(w) > i && i > RIGHT_VIEWPORT(w)) ) \
                                 || ( LEFT_VIEWPORT(w) <= i && i <= RIGHT_VIEWPORT(w) ) )




More information about the commits mailing list