summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorChe-Liang Chiou <clchiou@chromium.org>2011-06-22 17:22:29 -0700
committerSimon Glass <sjg@chromium.org>2011-08-29 10:39:32 -0700
commitf7cf3607b101d8264eb8f7c3ff4d332ff6eda262 (patch)
tree0da1b8cae70ba7886ddf16a8bd4cf98a8d4d2c95 /common
parentab88299c8c458b706192a332915cb6b03f4cc69c (diff)
fix compiler warning of common/lcd.c
BUG=chromium-os:16508 TEST=build w/o warnings Change-Id: I91c776da1929de52c2b5a405c2f42196fbe38e7e Reviewed-on: http://gerrit.chromium.org/gerrit/3064 Tested-by: Che-Liang Chiou <clchiou@chromium.org> Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/lcd.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/common/lcd.c b/common/lcd.c
index f829d9ad882..9627e979b32 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -637,36 +637,38 @@ void bitmap_plot (int x, int y)
#define BMP_RLE8_EOBMP 1
#define BMP_RLE8_DELTA 2
-static void draw_unencoded_bitmap(ushort **fbp, uchar *bmap, ushort *cmap,
+static uchar *draw_unencoded_bitmap(uchar *fb, uchar *bmap, ushort *cmap,
int cnt)
{
+ ushort *fb_short = (ushort *)fb;
while (cnt > 0) {
- *(*fbp)++ = cmap[*bmap++];
+ *fb_short++ = cmap[*bmap++];
cnt--;
}
+ return (uchar *)fb_short;
}
-static void draw_encoded_bitmap(ushort **fbp, ushort c, int cnt)
+static uchar *draw_encoded_bitmap(uchar *fb, ushort c, int cnt)
{
- ushort *fb = *fbp;
+ ushort *fb_short = (ushort *)fb;
int cnt_8copy = cnt >> 3;
cnt -= cnt_8copy << 3;
while (cnt_8copy > 0) {
- *fb++ = c;
- *fb++ = c;
- *fb++ = c;
- *fb++ = c;
- *fb++ = c;
- *fb++ = c;
- *fb++ = c;
- *fb++ = c;
+ *fb_short++ = c;
+ *fb_short++ = c;
+ *fb_short++ = c;
+ *fb_short++ = c;
+ *fb_short++ = c;
+ *fb_short++ = c;
+ *fb_short++ = c;
+ *fb_short++ = c;
cnt_8copy--;
}
while (cnt > 0) {
- *fb++ = c;
+ *fb_short++ = c;
cnt--;
}
- (*fbp) = fb;
+ return (uchar *)fb_short;
}
/* Do not call this function directly, must be called from
@@ -722,8 +724,7 @@ static int lcd_display_rle8_bitmap(bmp_image_t *bmp, ushort *cmap, uchar *fb,
cnt = width - x;
else
cnt = runlen;
- draw_unencoded_bitmap(
- (ushort **)&fb,
+ fb = draw_unencoded_bitmap(fb,
bmap, cmap, cnt);
}
x += runlen;
@@ -748,7 +749,7 @@ static int lcd_display_rle8_bitmap(bmp_image_t *bmp, ushort *cmap, uchar *fb,
cnt = width - x;
else
cnt = runlen;
- draw_encoded_bitmap((ushort **)&fb,
+ fb = draw_encoded_bitmap(fb,
cmap[bmap[1]], cnt);
}
x += runlen;