[prev in list] [next in list] [prev in thread] [next in thread] 

List:       grub-devel
Subject:    fs/fat.c assumes that 0UL is the same for 32bit and 64bit archs
From:       Omniflux <omniflux+lists () omniflux ! com>
Date:       2005-02-16 8:56:10
Message-ID: 42130AAA.7030500 () omniflux ! com
[Download RAW message or body]

fs/fat.c assumes that 0UL is the same for 32bit and 64bit archs, but it
is not.

There are four locations in fs/fat.c where a 32bit unsigned int is set
equal to 0UL. This causes warnings when compiling on 64bit architectures
   as 0UL is 0xffffffffffffffff (64bits) there.

-- 
Omniflux

["0UL-fix.diff" (text/plain)]

--- grub2/fs/fat.c	2004-08-28 07:14:29.000000000 -0600
+++ grub2.modified/fs/fat.c	2005-02-16 00:39:25.271409504 -0700
@@ -243,7 +243,7 @@
   else
     {
       /* FAT12 or FAT16.  */
-      data->root_cluster = ~0UL;
+      data->root_cluster = 0xffffffff;
 
       if (data->num_clusters <= 4085 + 2)
 	{
@@ -293,7 +293,7 @@
 
   /* Start from the root directory.  */
   data->file_cluster = data->root_cluster;
-  data->cur_cluster_num = ~0UL;
+  data->cur_cluster_num = 0xffffffff;
   data->attr = GRUB_FAT_ATTR_DIRECTORY;
   return data;
 
@@ -318,7 +318,7 @@
   
   /* This is a special case. FAT12 and FAT16 doesn't have the root directory
      in clusters.  */
-  if (data->file_cluster == ~0UL)
+  if (data->file_cluster == 0xffffffff)
     {
       size = (data->num_root_sectors << GRUB_DISK_SECTOR_BITS) - offset;
       if (size > len)
@@ -613,7 +613,7 @@
   data->file_size = grub_le_to_cpu32 (dir.file_size);
   data->file_cluster = ((grub_le_to_cpu16 (dir.first_cluster_high) << 16)
 			| grub_le_to_cpu16 (dir.first_cluster_low));
-  data->cur_cluster_num = ~0UL;
+  data->cur_cluster_num = 0xffffffff;
   
   return dirp;
 }



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic