summaryrefslogtreecommitdiff
path: root/fb
diff options
context:
space:
mode:
authorEamon Walsh <efw@eamonwalsh.com>2009-09-04 21:49:29 -0400
committerPeter Hutterer <peter.hutterer@who-t.net>2009-09-07 11:00:50 +1000
commit1bdc9ec617d357b076c9e69296018bc212d91c7d (patch)
tree2790e35b84325b973c142adce9b794e52e0c21de /fb
parent9005ec4ce19d704d5055232d2a36acee3247be67 (diff)
Fix "warning: left-hand operand of comma expression has no effect"
Signed-off-by: Eamon Walsh <efw@eamonwalsh.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'fb')
-rw-r--r--fb/fb.h44
-rw-r--r--fb/fbbltone.c2
-rw-r--r--fb/fbstipple.c2
3 files changed, 30 insertions, 18 deletions
diff --git a/fb/fb.h b/fb/fb.h
index 2d3c85d44..c35e7654b 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -487,22 +487,34 @@ extern _X_EXPORT void fbSetBits (FbStip *bits, int stride, FbStip data);
* The term "lane" comes from the hardware term "byte-lane" which
*/
-#define FbLaneCase1(n,a,o) ((n) == 0x01 ? (void) \
- WRITE((CARD8 *) ((a)+FbPatternOffset(o,CARD8)), \
- fgxor) : (void) 0)
-#define FbLaneCase2(n,a,o) ((n) == 0x03 ? (void) \
- WRITE((CARD16 *) ((a)+FbPatternOffset(o,CARD16)), \
- fgxor) : \
- ((void)FbLaneCase1((n)&1,a,o), \
- FbLaneCase1((n)>>1,a,(o)+1)))
-#define FbLaneCase4(n,a,o) ((n) == 0x0f ? (void) \
- WRITE((CARD32 *) ((a)+FbPatternOffset(o,CARD32)), \
- fgxor) : \
- ((void)FbLaneCase2((n)&3,a,o), \
- FbLaneCase2((n)>>2,a,(o)+2)))
-#define FbLaneCase8(n,a,o) ((n) == 0x0ff ? (void) (*(FbBits *) ((a)+(o)) = fgxor) : \
- ((void)FbLaneCase4((n)&15,a,o), \
- FbLaneCase4((n)>>4,a,(o)+4)))
+#define FbLaneCase1(n,a,o) \
+ if ((n) == 0x01) { \
+ WRITE((CARD8 *) ((a)+FbPatternOffset(o,CARD8)), fgxor); \
+ }
+
+#define FbLaneCase2(n,a,o) \
+ if ((n) == 0x03) { \
+ WRITE((CARD16 *) ((a)+FbPatternOffset(o,CARD16)), fgxor); \
+ } else { \
+ FbLaneCase1((n)&1,a,o) \
+ FbLaneCase1((n)>>1,a,(o)+1) \
+ }
+
+#define FbLaneCase4(n,a,o) \
+ if ((n) == 0x0f) { \
+ WRITE((CARD32 *) ((a)+FbPatternOffset(o,CARD32)), fgxor); \
+ } else { \
+ FbLaneCase2((n)&3,a,o) \
+ FbLaneCase2((n)>>2,a,(o)+2) \
+ }
+
+#define FbLaneCase8(n,a,o) \
+ if ((n) == 0x0ff) { \
+ *(FbBits *) ((a)+(o)) = fgxor; \
+ } else { \
+ FbLaneCase4((n)&15,a,o) \
+ FbLaneCase4((n)>>4,a,(o)+4) \
+ }
#if FB_SHIFT == 6
#define FbLaneCase(n,a) FbLaneCase8(n,(CARD8 *) (a),0)
diff --git a/fb/fbbltone.c b/fb/fbbltone.c
index ffe69775a..5d5d2e6bf 100644
--- a/fb/fbbltone.c
+++ b/fb/fbbltone.c
@@ -59,7 +59,7 @@
#ifndef FBNOPIXADDR
-#define LaneCases1(n,a) case n: (void)FbLaneCase(n,a); break
+#define LaneCases1(n,a) case n: FbLaneCase(n,a); break
#define LaneCases2(n,a) LaneCases1(n,a); LaneCases1(n+1,a)
#define LaneCases4(n,a) LaneCases2(n,a); LaneCases2(n+2,a)
#define LaneCases8(n,a) LaneCases4(n,a); LaneCases4(n+4,a)
diff --git a/fb/fbstipple.c b/fb/fbstipple.c
index 7d1326367..bc25e462f 100644
--- a/fb/fbstipple.c
+++ b/fb/fbstipple.c
@@ -33,7 +33,7 @@
* transparent stipple
*/
#define LaneCases1(c,a) case c: \
- while (n--) { (void)FbLaneCase(c,a); a++; } \
+ while (n--) { FbLaneCase(c,a); a++; } \
break
#define LaneCases2(c,a) LaneCases1(c,a); LaneCases1(c+1,a)
#define LaneCases4(c,a) LaneCases2(c,a); LaneCases2(c+2,a)