]> git.sur5r.net Git - u-boot/commitdiff
Fix printf() format issues with sizeof_t types by using %zu
authorWolfgang Denk <wd@denx.de>
Mon, 14 Jul 2008 13:06:35 +0000 (15:06 +0200)
committerWolfgang Denk <wd@denx.de>
Mon, 14 Jul 2008 13:06:35 +0000 (15:06 +0200)
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Wolfgang Denk <wd@denx.de>
common/lcd.c
cpu/mpc8xx/video.c
drivers/serial/usbtty.c
fs/jffs2/jffs2_1pass.c
fs/jffs2/jffs2_nand_1pass.c
lib_m68k/board.c
lib_mips/board.c
lib_ppc/board.c
net/bootp.c

index ebf377aa89d4e3202917268728629925ab44f051..04ef4e387711f17d15788052e99da9c8203a7de5 100644 (file)
@@ -539,7 +539,7 @@ void bitmap_plot (int x, int y)
 
        debug ("Logo: width %d  height %d  colors %d  cmap %d\n",
                BMP_LOGO_WIDTH, BMP_LOGO_HEIGHT, BMP_LOGO_COLORS,
-               sizeof(bmp_logo_palette)/(sizeof(ushort)));
+               (int)(sizeof(bmp_logo_palette)/(sizeof(ushort))));
 
        bmap = &bmp_logo_bitmap[0];
        fb   = (uchar *)(lcd_base + y * lcd_line_length + x);
index 8bf8e469ccf6c92fbb42819c96dd0233a56bf383..ef91165602df3fcad7a1902eef8a7edb74d55484 100644 (file)
@@ -833,10 +833,10 @@ static void video_encoder_init (void)
 
                puts ("[VIDEO ENCODER] Configuring the encoder...\n");
 
-               printf ("Sending %d bytes (@ %08lX) to I2C 0x%X:\n   ",
+               printf ("Sending %zu bytes (@ %08lX) to I2C 0x%lX:\n   ",
                        sizeof(video_encoder_data),
                        (ulong)video_encoder_data,
-                       VIDEO_I2C_ADDR);
+                       (ulong)VIDEO_I2C_ADDR);
                for (i=0; i<sizeof(video_encoder_data); ++i) {
                        printf(" %02X", video_encoder_data[i]);
                }
index cc2bdac479efad185d9169eabf931ac2c5abde1f..2bc5c3c83873188fd3f5e0d1b8600b65c36711cb 100644 (file)
@@ -529,8 +529,8 @@ int drv_usbtty_init (void)
        }
        snlen = strlen(sn);
        if (snlen > sizeof(serial_number) - 1) {
-               printf ("Warning: serial number %s is too long (%d > %d)\n",
-                       sn, snlen, sizeof(serial_number) - 1);
+               printf ("Warning: serial number %s is too long (%d > %lu)\n",
+                       sn, snlen, (ulong)(sizeof(serial_number) - 1));
                snlen = sizeof(serial_number) - 1;
        }
        memcpy (serial_number, sn, snlen);
index 5c1d2652550043558169d80ee029308bc06e5130..8a06777ae2a91d70027a04cae4ac2d0c39b24bff 100644 (file)
@@ -1213,16 +1213,18 @@ jffs2_1pass_build_lists(struct part_info * part)
                        } else if (node->nodetype == JFFS2_NODETYPE_CLEANMARKER) {
                                if (node->totlen != sizeof(struct jffs2_unknown_node))
                                        printf("OOPS Cleanmarker has bad size "
-                                               "%d != %u\n", node->totlen,
+                                               "%d != %zu\n",
+                                               node->totlen,
                                                sizeof(struct jffs2_unknown_node));
                        } else if (node->nodetype == JFFS2_NODETYPE_PADDING) {
                                if (node->totlen < sizeof(struct jffs2_unknown_node))
                                        printf("OOPS Padding has bad size "
-                                               "%d < %u\n", node->totlen,
+                                               "%d < %zu\n",
+                                               node->totlen,
                                                sizeof(struct jffs2_unknown_node));
                        } else {
-                               printf("Unknown node type: %x len %d "
-                                       "offset 0x%x\n", node->nodetype,
+                               printf("Unknown node type: %x len %d offset 0x%x\n",
+                                       node->nodetype,
                                        node->totlen, offset);
                        }
                        offset += ((node->totlen + 3) & ~3);
index d95f5513b97a5f089e260430879593951d29af02..3ce9c982552f77c2e2e2c18450c4a1618f537efb 100644 (file)
@@ -864,16 +864,18 @@ jffs2_1pass_build_lists(struct part_info * part)
                        } else if (node->nodetype == JFFS2_NODETYPE_CLEANMARKER) {
                                if (node->totlen != sizeof(struct jffs2_unknown_node))
                                        printf("OOPS Cleanmarker has bad size "
-                                               "%d != %d\n", node->totlen,
+                                               "%d != %zu\n",
+                                               node->totlen,
                                                sizeof(struct jffs2_unknown_node));
                        } else if (node->nodetype == JFFS2_NODETYPE_PADDING) {
                                if (node->totlen < sizeof(struct jffs2_unknown_node))
                                        printf("OOPS Padding has bad size "
-                                               "%d < %d\n", node->totlen,
+                                               "%d < %zu\n",
+                                               node->totlen,
                                                sizeof(struct jffs2_unknown_node));
                        } else {
-                               printf("Unknown node type: %x len %d "
-                                       "offset 0x%x\n", node->nodetype,
+                               printf("Unknown node type: %x len %d offset 0x%x\n",
+                                       node->nodetype,
                                        node->totlen, offset);
                        }
                        offset += ((node->totlen + 3) & ~3);
index d27c89c645006cacaa4735bdd7c65b0dc57c49e3..a13ea2682bb0867b609da151e277c32535273da5 100644 (file)
@@ -347,11 +347,11 @@ board_init_f (ulong bootflag)
        addr_sp -= sizeof (bd_t);
        bd = (bd_t *) addr_sp;
        gd->bd = bd;
-       debug ("Reserving %d Bytes for Board Info at: %08lx\n",
+       debug ("Reserving %zu Bytes for Board Info at: %08lx\n",
                        sizeof (bd_t), addr_sp);
        addr_sp -= sizeof (gd_t);
        id = (gd_t *) addr_sp;
-       debug ("Reserving %d Bytes for Global Data at: %08lx\n",
+       debug ("Reserving %zu Bytes for Global Data at: %08lx\n",
                        sizeof (gd_t), addr_sp);
 
        /* Reserve memory for boot params. */
index 532550b603b1d1a8c99be23934c006f2681c83d6..09b8b3bb3cacd9833f6ddf76da4ab384abea0702 100644 (file)
@@ -242,12 +242,12 @@ void board_init_f(ulong bootflag)
        addr_sp -= sizeof(bd_t);
        bd = (bd_t *)addr_sp;
        gd->bd = bd;
-       debug ("Reserving %d Bytes for Board Info at: %08lx\n",
+       debug ("Reserving %zu Bytes for Board Info at: %08lx\n",
                        sizeof(bd_t), addr_sp);
 
        addr_sp -= sizeof(gd_t);
        id = (gd_t *)addr_sp;
-       debug ("Reserving %d Bytes for Global Data at: %08lx\n",
+       debug ("Reserving %zu Bytes for Global Data at: %08lx\n",
                        sizeof (gd_t), addr_sp);
 
        /* Reserve memory for boot params.
index 1bc2f46d462e746222550f411e84cc75867d2b8a..71a70db504a8c47176cd49a629f455a7cbf2295c 100644 (file)
@@ -524,11 +524,11 @@ void board_init_f (ulong bootflag)
        addr_sp -= sizeof (bd_t);
        bd = (bd_t *) addr_sp;
        gd->bd = bd;
-       debug ("Reserving %d Bytes for Board Info at: %08lx\n",
+       debug ("Reserving %zu Bytes for Board Info at: %08lx\n",
                        sizeof (bd_t), addr_sp);
        addr_sp -= sizeof (gd_t);
        id = (gd_t *) addr_sp;
-       debug ("Reserving %d Bytes for Global Data at: %08lx\n",
+       debug ("Reserving %zu Bytes for Global Data at: %08lx\n",
                        sizeof (gd_t), addr_sp);
 
        /*
index 3c0614c5cfad691ec373c60b89f36c1a1b4a0e37..f48744abfd128b97c8b71172cde6c0a3b7e15f82 100644 (file)
@@ -313,7 +313,7 @@ BootpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len)
        Bootp_t *bp;
        char    *s;
 
-       debug ("got BOOTP packet (src=%d, dst=%d, len=%d want_len=%d)\n",
+       debug ("got BOOTP packet (src=%d, dst=%d, len=%d want_len=%zu)\n",
                src, dest, len, sizeof (Bootp_t));
 
        bp = (Bootp_t *)pkt;