[2149] * commands/lsmmap.c (grub_cmd_lsmmap): Add casts to avoid printf

"David S. Miller" <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2149
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2149
Author:   davem
Date:     2009-04-30 01:18:43 +0000 (Thu, 30 Apr 2009)
Log Message:
-----------
	* commands/lsmmap.c (grub_cmd_lsmmap): Add casts to avoid printf
	warnings.
	* kern/ieee1275/openfw.c (grub_claimmap): Likewise.
	* disk/ieee1275/ofdisk.c (grub_ofdisk_open, grub_ofdisk_close,
	grub_ofdisk_read): Likewise, and deal similarly with the fact that
	ihandles have a 32-bit type but need to be stored in a "void *".

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/commands/lsmmap.c
    trunk/grub2/disk/ieee1275/ofdisk.c
    trunk/grub2/kern/ieee1275/openfw.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-04-28 13:25:09 UTC (rev 2148)
+++ trunk/grub2/ChangeLog	2009-04-30 01:18:43 UTC (rev 2149)
@@ -1,3 +1,12 @@
+2009-04-29  David S. Miller  <[email protected]>
+
+	* commands/lsmmap.c (grub_cmd_lsmmap): Add casts to avoid printf
+	warnings.
+	* kern/ieee1275/openfw.c (grub_claimmap): Likewise.
+	* disk/ieee1275/ofdisk.c (grub_ofdisk_open, grub_ofdisk_close,
+	grub_ofdisk_read): Likewise, and deal similarly with the fact that
+	ihandles have a 32-bit type but need to be stored in a "void *".
+
 2009-04-28  Pavel Roskin  <[email protected]>
 
 	* disk/fs_uuid.c (grub_fs_uuid_open): Use parent->data for dev,

Modified: trunk/grub2/commands/lsmmap.c
===================================================================
--- trunk/grub2/commands/lsmmap.c	2009-04-28 13:25:09 UTC (rev 2148)
+++ trunk/grub2/commands/lsmmap.c	2009-04-30 01:18:43 UTC (rev 2149)
@@ -30,7 +30,7 @@
   int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type)
     {
       grub_printf ("base_addr = 0x%llx, length = 0x%llx, type = 0x%x\n",
-		   addr, size, type);
+		   (long long) addr, (long long) size, type);
       return 0;
     }
   grub_machine_mmap_iterate (hook);

Modified: trunk/grub2/disk/ieee1275/ofdisk.c
===================================================================
--- trunk/grub2/disk/ieee1275/ofdisk.c	2009-04-28 13:25:09 UTC (rev 2148)
+++ trunk/grub2/disk/ieee1275/ofdisk.c	2009-04-30 01:18:43 UTC (rev 2149)
@@ -155,7 +155,8 @@
       goto fail;
     }
 
-  grub_dprintf ("disk", "Opened `%s' as handle %p.\n", op->devpath, (void *) dev_ihandle);
+  grub_dprintf ("disk", "Opened `%s' as handle %p.\n", op->devpath,
+		(void *) (unsigned long) dev_ihandle);
 
   if (grub_ieee1275_finddevice (op->devpath, &dev))
     {
@@ -185,7 +186,7 @@
 
   /* XXX: Read this, somehow.  */
   disk->has_partitions = 1;
-  disk->data = (void *) dev_ihandle;
+  disk->data = (void *) (unsigned long) dev_ihandle;
   return 0;
 
  fail:
@@ -199,7 +200,7 @@
 {
   grub_dprintf ("disk", "Closing handle %p.\n",
 		(void *) disk->data);
-  grub_ieee1275_close ((grub_ieee1275_ihandle_t) disk->data);
+  grub_ieee1275_close ((grub_ieee1275_ihandle_t) (unsigned long) disk->data);
 }
 
 static grub_err_t
@@ -211,21 +212,21 @@
 
   grub_dprintf ("disk",
 		"Reading handle %p: sector 0x%llx, size 0x%lx, buf %p.\n",
-		(void *) disk->data, sector, (long) size, buf);
+		(void *) disk->data, (long long) sector, (long) size, buf);
 
   pos = sector * 512UL;
 
-  grub_ieee1275_seek ((grub_ieee1275_ihandle_t) disk->data, (int) (pos >> 32),
-		      (int) pos & 0xFFFFFFFFUL, &status);
+  grub_ieee1275_seek ((grub_ieee1275_ihandle_t) (unsigned long) disk->data,
+		      (int) (pos >> 32), (int) pos & 0xFFFFFFFFUL, &status);
   if (status < 0)
     return grub_error (GRUB_ERR_READ_ERROR,
 		       "Seek error, can't seek block %llu",
-		       sector);
-  grub_ieee1275_read ((grub_ieee1275_ihandle_t) disk->data, buf,
-		      size * 512UL, &actual);
+		       (long long) sector);
+  grub_ieee1275_read ((grub_ieee1275_ihandle_t) (unsigned long) disk->data,
+		      buf, size * 512UL, &actual);
   if (actual != actual)
     return grub_error (GRUB_ERR_READ_ERROR, "Read error on block: %llu",
-		       sector);
+		       (long long) sector);
     
   return 0;
 }

Modified: trunk/grub2/kern/ieee1275/openfw.c
===================================================================
--- trunk/grub2/kern/ieee1275/openfw.c	2009-04-28 13:25:09 UTC (rev 2148)
+++ trunk/grub2/kern/ieee1275/openfw.c	2009-04-30 01:18:43 UTC (rev 2149)
@@ -238,7 +238,8 @@
   if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_REAL_MODE)
       && grub_map (addr, addr, size, 0x00))
     {
-      grub_printf ("map failed: address 0x%x, size 0x%x\n", addr, size);
+      grub_printf ("map failed: address 0x%llx, size 0x%llx\n",
+		   (long long) addr, (long long) size);
       grub_ieee1275_release (addr, size);
       return -1;
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.