Index: rtems-rfs-buffer-bdbuf.c
===================================================================
RCS file: /usr1/CVS/rtems/cpukit/libfs/src/rfs/rtems-rfs-buffer-bdbuf.c,v
retrieving revision 1.2
diff -p -u -u -r1.2 rtems-rfs-buffer-bdbuf.c
--- rtems-rfs-buffer-bdbuf.c	27 Mar 2010 04:04:40 -0000	1.2
+++ rtems-rfs-buffer-bdbuf.c	11 Apr 2010 05:29:55 -0000
@@ -67,7 +67,7 @@ rtems_rfs_buffer_bdbuf_release (rtems_rf
 
   if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_RELEASE))
     printf ("rtems-rfs: bdbuf-release: block=%lu bdbuf=%lu %s\n",
-            (rtems_rfs_buffer_block) buffer->user,
+            (rtems_rfs_buffer_block) ((intptr_t) buffer->user),
             buffer->block, modified ? "(modified)" : "");
 
   if (modified)
Index: rtems-rfs-buffer.c
===================================================================
RCS file: /usr1/CVS/rtems/cpukit/libfs/src/rfs/rtems-rfs-buffer.c,v
retrieving revision 1.4
diff -p -u -u -r1.4 rtems-rfs-buffer.c
--- rtems-rfs-buffer.c	27 Mar 2010 04:04:40 -0000	1.4
+++ rtems-rfs-buffer.c	11 Apr 2010 05:29:55 -0000
@@ -51,12 +51,13 @@ rtems_rfs_scan_chain (rtems_chain_contro
     buffer = (rtems_rfs_buffer*) node;
 
     if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
-      printf ("%lu ", (rtems_rfs_buffer_block) buffer->user);
+      printf ("%lu ", (rtems_rfs_buffer_block) ((intptr_t)(buffer->user)));
 
-    if (((rtems_rfs_buffer_block) buffer->user) == block)
+    if (((rtems_rfs_buffer_block) ((intptr_t)(buffer->user))) == block)
     {
       if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
-        printf (": found block=%lu\n", (rtems_rfs_buffer_block) buffer->user);
+        printf (": found block=%lu\n",
+                (rtems_rfs_buffer_block) ((intptr_t)(buffer->user)));
 
       (*count)--;
       rtems_chain_extract (node);
@@ -182,7 +183,7 @@ rtems_rfs_buffer_handle_request (rtems_r
   rtems_chain_append (&fs->buffers, rtems_rfs_buffer_link (handle));
   fs->buffers_count++;
   
-  handle->buffer->user = (void*) block;
+  handle->buffer->user = (void*) ((intptr_t) block);
   handle->bnum = block;
   
   if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
Index: rtems-rfs-data.h
===================================================================
RCS file: /usr1/CVS/rtems/cpukit/libfs/src/rfs/rtems-rfs-data.h,v
retrieving revision 1.1
diff -p -u -u -r1.1 rtems-rfs-data.h
--- rtems-rfs-data.h	18 Feb 2010 00:24:25 -0000	1.1
+++ rtems-rfs-data.h	11 Apr 2010 05:29:55 -0000
@@ -31,6 +31,12 @@
 #define rtems_rfs_data_ptr(_d) ((uint8_t*)(_d))
 
 /**
+ * Helper function to get the data shifted in the correctly sized type.
+ */
+#define rtems_rfs_data_get(_d, _t, _o, _s) \
+  (((_t)(rtems_rfs_data_ptr (_d)[_o])) << (_s))
+
+/**
  * RFS Read Unsigned 8bit Integer
  */
 #define rtems_rfs_read_u8(_d) \
@@ -40,14 +46,17 @@
  * RFS Read Unsigned 16bit Integer
  */
 #define rtems_rfs_read_u16(_d) \
-  ((rtems_rfs_data_ptr (_d)[0] << 8) | (rtems_rfs_data_ptr (_d)[1]))
+  (rtems_rfs_data_get (_d, uint16_t, 0, 8) | \
+   rtems_rfs_data_get (_d, uint16_t, 1, 0))
 
 /**
  * RFS Read Unsigned 32bit Integer
  */
 #define rtems_rfs_read_u32(_d) \
-  ((rtems_rfs_data_ptr (_d)[0] << 24) | (rtems_rfs_data_ptr (_d)[1] << 16) | \
-   (rtems_rfs_data_ptr (_d)[2] << 8) | (rtems_rfs_data_ptr (_d)[3]))
+  (rtems_rfs_data_get (_d, uint32_t, 0, 24) | \
+   rtems_rfs_data_get (_d, uint32_t, 1, 16) | \
+   rtems_rfs_data_get (_d, uint32_t, 2, 8) | \
+   rtems_rfs_data_get (_d, uint32_t, 3, 0))
 
 /**
  * RFS Write Unsigned 8bit Integer
@@ -60,7 +69,7 @@
  */
 #define rtems_rfs_write_u16(_d, _v) \
   do { \
-    rtems_rfs_data_ptr (_d)[0] = (uint8_t)((_v) >> 8); \
+    rtems_rfs_data_ptr (_d)[0] = (uint8_t)(((uint16_t)(_v)) >> 8); \
     rtems_rfs_data_ptr (_d)[1] = (uint8_t)((_v)); \
   } while (0)
 
@@ -69,10 +78,10 @@
  */
 #define rtems_rfs_write_u32(_d, _v) \
   do { \
-    rtems_rfs_data_ptr (_d)[0] = (uint8_t)((_v) >> 24); \
-    rtems_rfs_data_ptr (_d)[1] = (uint8_t)((_v) >> 16); \
-    rtems_rfs_data_ptr (_d)[2] = (uint8_t)((_v) >> 8); \
-    rtems_rfs_data_ptr (_d)[3] = (uint8_t)((_v)); \
+    rtems_rfs_data_ptr (_d)[0] = (uint8_t)(((uint32_t)(_v)) >> 24); \
+    rtems_rfs_data_ptr (_d)[1] = (uint8_t)(((uint32_t)(_v)) >> 16); \
+    rtems_rfs_data_ptr (_d)[2] = (uint8_t)(((uint32_t)(_v)) >> 8);  \
+    rtems_rfs_data_ptr (_d)[3] = (uint8_t)((uint32_t)(_v)); \
   } while (0)
 
 #endif
Index: rtems-rfs-dir.c
===================================================================
RCS file: /usr1/CVS/rtems/cpukit/libfs/src/rfs/rtems-rfs-dir.c,v
retrieving revision 1.5
diff -p -u -u -r1.5 rtems-rfs-dir.c
--- rtems-rfs-dir.c	27 Mar 2010 04:04:40 -0000	1.5
+++ rtems-rfs-dir.c	11 Apr 2010 05:29:55 -0000
@@ -161,7 +161,7 @@ rtems_rfs_dir_lookup_ino (rtems_rfs_file
         {
           if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK))
             printf ("rtems-rfs: dir-lookup-ino: " \
-                    "checking entry for ino %ld: off=%04lx length:%d ino:%d\n",
+                    "checking entry for ino %ld: off=%04lx length:%d ino:%ld\n",
                     rtems_rfs_inode_ino (inode), map.bpos.boff,
                     elength, rtems_rfs_dir_entry_ino (entry));
 
@@ -609,7 +609,7 @@ rtems_rfs_dir_read (rtems_rfs_file_syste
       
       if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
         printf ("rtems-rfs: dir-read: found off:%Ld ino:%ld name=%s\n",
-                dirent->d_off, dirent->d_ino, dirent->d_name);
+                (uint64_t) dirent->d_off, dirent->d_ino, dirent->d_name);
       break;
     }
 
Index: rtems-rfs-file-system.c
===================================================================
RCS file: /usr1/CVS/rtems/cpukit/libfs/src/rfs/rtems-rfs-file-system.c,v
retrieving revision 1.3
diff -p -u -u -r1.3 rtems-rfs-file-system.c
--- rtems-rfs-file-system.c	27 Mar 2010 04:04:40 -0000	1.3
+++ rtems-rfs-file-system.c	11 Apr 2010 05:29:55 -0000
@@ -79,7 +79,7 @@ rtems_rfs_fs_read_superblock (rtems_rfs_
       (RTEMS_RFS_VERSION * RTEMS_RFS_VERSION_MASK))
   {
     if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
-      printf ("rtems-rfs: read-superblock: incompatible version: %08x (%08x)\n",
+      printf ("rtems-rfs: read-superblock: incompatible version: %08lx (%08x)\n",
               read_sb (RTEMS_RFS_SB_OFFSET_VERSION), RTEMS_RFS_VERSION_MASK);
     rtems_rfs_buffer_handle_close (fs, &handle);
     return EIO;
@@ -88,7 +88,7 @@ rtems_rfs_fs_read_superblock (rtems_rfs_
   if (read_sb (RTEMS_RFS_SB_OFFSET_INODE_SIZE) != RTEMS_RFS_INODE_SIZE)
   {
     if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
-      printf ("rtems-rfs: read-superblock: inode size mismatch: fs:%d target:%d\n",
+      printf ("rtems-rfs: read-superblock: inode size mismatch: fs:%ld target:%d\n",
               read_sb (RTEMS_RFS_SB_OFFSET_VERSION), RTEMS_RFS_VERSION_MASK);
     rtems_rfs_buffer_handle_close (fs, &handle);
     return EIO;
Index: rtems-rfs-format.c
===================================================================
RCS file: /usr1/CVS/rtems/cpukit/libfs/src/rfs/rtems-rfs-format.c,v
retrieving revision 1.4
diff -p -u -u -r1.4 rtems-rfs-format.c
--- rtems-rfs-format.c	27 Mar 2010 04:04:40 -0000	1.4
+++ rtems-rfs-format.c	11 Apr 2010 05:29:55 -0000
@@ -33,7 +33,7 @@
 /**
  * Return the number of gigabytes.
  */
-#define GIGS(_g) ((_g) * 1024 * 1024)
+#define GIGS(_g) (((uint64_t)(_g)) * 1024 * 1024)
 
 /**
  * Return the number of bits that fit in the block size.
Index: rtems-rfs-inode.h
===================================================================
RCS file: /usr1/CVS/rtems/cpukit/libfs/src/rfs/rtems-rfs-inode.h,v
retrieving revision 1.2
diff -p -u -u -r1.2 rtems-rfs-inode.h
--- rtems-rfs-inode.h	26 Feb 2010 05:54:59 -0000	1.2
+++ rtems-rfs-inode.h	11 Apr 2010 05:29:55 -0000
@@ -339,7 +339,7 @@ static inline void
 rtems_rfs_inode_set_uid_gid (rtems_rfs_inode_handle* handle,
                              uint16_t uid, uint16_t gid)
 {
-  rtems_rfs_write_u32 (&handle->node->owner, (gid << 16) | uid);
+  rtems_rfs_write_u32 (&handle->node->owner, (((uint32_t) gid) << 16) | uid);
   rtems_rfs_buffer_mark_dirty (&handle->buffer);
 }
 
Index: rtems-rfs-rtems.c
===================================================================
RCS file: /usr1/CVS/rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems.c,v
retrieving revision 1.5
diff -p -u -u -r1.5 rtems-rfs-rtems.c
--- rtems-rfs-rtems.c	27 Mar 2010 04:04:40 -0000	1.5
+++ rtems-rfs-rtems.c	11 Apr 2010 05:29:55 -0000
@@ -813,7 +813,7 @@ rtems_rfs_rtems_fchmod (rtems_filesystem
 
   if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FCHMOD))
     printf ("rtems-rfs-rtems: fchmod: in: ino:%ld mode:%06o\n",
-            ino, mode);
+            ino, (unsigned int) mode);
   
   rtems_rfs_rtems_lock (fs);
   
Index: rtems-rfs-rtems.h
===================================================================
RCS file: /usr1/CVS/rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems.h,v
retrieving revision 1.1
diff -p -u -u -r1.1 rtems-rfs-rtems.h
--- rtems-rfs-rtems.h	18 Feb 2010 00:24:25 -0000	1.1
+++ rtems-rfs-rtems.h	11 Apr 2010 05:29:55 -0000
@@ -158,7 +158,7 @@ typedef struct rtems_rfs_rtems_private
  * @param _ino The ino to set in the path location.
  */
 #define rtems_rfs_rtems_set_pathloc_ino(_loc, _ino) \
-  (_loc)->node_access = (void*)(_ino)
+  (_loc)->node_access = (void*)((intptr_t)(_ino))
 
 /**
  * Get the inode number (ino) given a path location.
@@ -176,7 +176,7 @@ typedef struct rtems_rfs_rtems_private
  * @param _doff The doff to set in the path location.
  */
 #define rtems_rfs_rtems_set_pathloc_doff(_loc, _doff) \
-  (_loc)->node_access_2 = (void*)(_doff)
+  (_loc)->node_access_2 = (void*)((intptr_t)(_doff))
 
 /**
  * Get the directory offset (doff) given a path location.
Index: rtems-rfs-shell.c
===================================================================
RCS file: /usr1/CVS/rtems/cpukit/libfs/src/rfs/rtems-rfs-shell.c,v
retrieving revision 1.6
diff -p -u -u -r1.6 rtems-rfs-shell.c
--- rtems-rfs-shell.c	27 Mar 2010 04:04:40 -0000	1.6
+++ rtems-rfs-shell.c	11 Apr 2010 05:29:55 -0000
@@ -499,7 +499,7 @@ rtems_rfs_shell_dir (rtems_rfs_file_syst
     
     length = elength - RTEMS_RFS_DIR_ENTRY_SIZE;
     
-    printf (" %5d: %04x inode=%-6u hash=%08x name[%03u]=",
+    printf (" %5d: %04x inode=%-6lu hash=%08lx name[%03u]=",
             entry, b,
             rtems_rfs_dir_entry_ino (data),
             rtems_rfs_dir_entry_hash (data),
