Skip to contentSkip to conversation

clean up some #if !defined() in drivers/video/cfb_console.c

PATCH New Andrew Dyer 2 participants 2 messages Aug 29, 2008 – Sep 6, 2008 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clean up some #if !defined() in drivers/video/cfb_console.c

rearrange some #if !defined() / #else / #endif statements to remove the negative logic.

---
 drivers/video/cfb_console.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)
drivers/video/cfb_console.c +12 -12
index 79562ec..fe418f1 100644
@@ -314,10 +314,10 @@ void	console_cursor (int state);
 #else
 #define SWAP16(x)	 (x)
 #define SWAP32(x)	 (x)
-#if !defined(VIDEO_FB_16BPP_PIXEL_SWAP)
-#define SHORTSWAP32(x)	 (x)
-#else
+#if defined(VIDEO_FB_16BPP_PIXEL_SWAP)
 #define SHORTSWAP32(x)	 ( ((x) >> 16) | ((x) << 16) )
+#else
+#define SHORTSWAP32(x)	 (x)
 #endif
 #endif
 
@@ -932,12 +932,12 @@ int video_display_bitmap (ulong bmp_image, int x, int y)
 				xcount = width;
 				while (xcount--) {
 					cte = bmp->color_table[*bmap++];
-#if !defined(VIDEO_FB_16BPP_PIXEL_SWAP)
-					FILL_15BIT_555RGB (cte.red, cte.green, cte.blue);
-#else
+#if defined(VIDEO_FB_16BPP_PIXEL_SWAP)
 					fill_555rgb_pswap (fb, xpos++, cte.red,
 							   cte.green, cte.blue);
 					fb += 2;
+#else
+					FILL_15BIT_555RGB (cte.red, cte.green, cte.blue);
 #endif
 				}
 				bmap += padded_line;
@@ -1006,12 +1006,12 @@ int video_display_bitmap (ulong bmp_image, int x, int y)
 				WATCHDOG_RESET ();
 				xcount = width;
 				while (xcount--) {
-#if !defined(VIDEO_FB_16BPP_PIXEL_SWAP)
-					FILL_15BIT_555RGB (bmap[2], bmap[1], bmap[0]);
-#else
+#if defined(VIDEO_FB_16BPP_PIXEL_SWAP)
 					fill_555rgb_pswap (fb, xpos++, bmap[2],
 							   bmap[1], bmap[0]);
 					fb += 2;
+#else
+					FILL_15BIT_555RGB (bmap[2], bmap[1], bmap[0]);
 #endif
 					bmap += 3;
 				}
@@ -1136,11 +1136,11 @@ void logo_plot (void *screen, int width, int x, int y)
 				*dest = ((r >> 5) << 5) | ((g >> 5) << 2) | (b >> 6);
 				break;
 			case GDF_15BIT_555RGB:
-#if !defined(VIDEO_FB_16BPP_PIXEL_SWAP)
+#if defined(VIDEO_FB_16BPP_PIXEL_SWAP)
+				fill_555rgb_pswap (dest, xpos++, r, g, b);
+#else
 				*(unsigned short *) dest =
 					SWAP16 ((unsigned short) (((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3)));
-#else
-				fill_555rgb_pswap (dest, xpos++, r, g, b);
 #endif
 				break;
 			case GDF_16BIT_565RGB:
Signature · 1 line
1.5.4.3
#1 lore raw

PATCH 1/1 clean up some #if !defined() in drivers/video/cfb_console.c

Dear Andrew Dyer,

Quoted 8 lines · In message <[email protected]> you wrote:

rearrange some #if !defined() / #else / #endif statements to remove the negative logic.

---
 drivers/video/cfb_console.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If a man had a child who'd gone  anti-social,  killed  perhaps,  he'd
still tend to protect that child.
	-- McCoy, "The Ultimate Computer", stardate 4731.3