Fix some compiler warnings emitted by gcc-4.8.0
[oweals/busybox.git] / miscutils / fbsplash.c
index 37ca6655901247f92e0d42fbeb45b4232538fcba..12a77b70f01ef6a9b4d0b2c4269ce34bf54405dd 100644 (file)
@@ -150,7 +150,7 @@ static void fb_open(const char *strfb_device)
 
        // map the device in memory
        G.addr = mmap(NULL,
-                       G.scr_var.yres * G.scr_fix.line_length,
+                       G.scr_var.yres * G.scr_fix.line_length,
                        PROT_WRITE, MAP_SHARED, fbfd, 0);
        if (G.addr == MAP_FAILED)
                bb_perror_msg_and_die("mmap");
@@ -312,8 +312,7 @@ static void fb_drawprogressbar(unsigned percent)
 
        pos_x = left_x;
        if (percent > 0) {
-               int y;
-               unsigned i;
+               int i, y;
 
                // actual progress bar
                pos_x += (unsigned)(width * percent) / 100;
@@ -325,7 +324,7 @@ static void fb_drawprogressbar(unsigned percent)
                while (i >= 0) {
                        // draw one-line thick "rectangle"
                        // top line will have gray lvl 200, bottom one 100
-                       unsigned gray_level = 100 + i*100 / height;
+                       unsigned gray_level = 100 + (unsigned)i*100 / height;
                        fb_drawfullrectangle(
                                        left_x, y, pos_x, y,
                                        gray_level, gray_level, gray_level);