changeset 1787:fb1561fe12e7

* src/romfs.c (romfs_mount): Avoid a compiler warning about punned types.
author asl
date Tue, 05 Oct 2004 08:00:43 +0000
parents bb357fe047ed
children eb9d23483db9
files packages/fs/rom/current/ChangeLog packages/fs/rom/current/src/romfs.c
diffstat 2 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/packages/fs/rom/current/ChangeLog
+++ b/packages/fs/rom/current/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-04  Andrew Lunn  <andrew.lunn@ascom.ch>
+
+	* src/romfs.c (romfs_mount): Avoid a compiler warning about punned
+	types.
+
 2004-08-08  Bart Veer  <bartv@ecoscentric.com>
 
 	* cdl/romfs.cdl: generate both little-endian and big-endian image
--- a/packages/fs/rom/current/src/romfs.c
+++ b/packages/fs/rom/current/src/romfs.c
@@ -594,10 +594,12 @@ static int romfs_mount    ( cyg_fstab_en
     if ( !mte->data ) {
 	// If the image address was not in the MTE data word,
 	if ( mte->devname && mte->devname[0] ) {
-	    // And there's something in the 'hardware device' field,
+            char *addr;
+            // And there's something in the 'hardware device' field,
 	    // then read the address from there.
-	    sscanf( mte->devname, "%p", (char**)&disk );
-	}
+	    sscanf( mte->devname, "%p", &addr );
+            disk = (romfs_disk *) addr;
+        }
     } else {
         disk = (romfs_disk *)mte->data;
     }