32 bit fixes
authorChristos Zoulas <christos@zoulas.com>
Sun, 18 Jan 2015 23:03:37 +0000 (18:03 -0500)
committerChristos Zoulas <christos@zoulas.com>
Sun, 18 Jan 2015 23:03:37 +0000 (18:03 -0500)
amd/amq_subr.c
amd/nfs_subr.c
amd/readdir.c
amq/amq.c

index 8783611056520913b219a48380aa408734ea6212..86f035186d72a83e446474985037b4414a1df533 100644 (file)
@@ -528,6 +528,7 @@ xdr_amq_map_info_qelem(XDR *xdrs, qelem *qhead)
   u_int len = 0;
   int x;
   char *n;
+  long modify;
 
   /*
    * Compute length of list
@@ -552,7 +553,8 @@ xdr_amq_map_info_qelem(XDR *xdrs, qelem *qhead)
       return (FALSE);
     }
 
-    if (!xdr_long(xdrs, &m->modify)) {
+    modify = (long)m->modify;
+    if (!xdr_long(xdrs, &modify)) {
       return (FALSE);
     }
 
index e463ff72c63a154354a6174fd1c1ae215bfe38ab..7192a6af7d3e9093e6938a76b9174ffb7d2a5b79 100644 (file)
@@ -1104,9 +1104,9 @@ am_nfs3_getattr_3_svc(am_GETATTR3args *argp, struct svc_req *rqstp)
   result.status = AM_NFS3_OK;
 
   if (amuDebug(D_TRACE))
-    plog(XLOG_DEBUG, "\tstat(%s), size = %lu, mtime=%d.%d",
+    plog(XLOG_DEBUG, "\tstat(%s), size = %llu, mtime=%d.%d",
         mp->am_path,
-        (am_size3) fattr3->size,
+        (unsigned long long)fattr3->size,
         (u_int) fattr3->mtime.seconds,
         (u_int) fattr3->mtime.nseconds);
 
index 4b5e61b3d56d95841258f19209f72c3fccbdb9bb..57773a5091147e41e8cf505d8a082b9ec1ee0799 100644 (file)
@@ -635,7 +635,7 @@ static size_t needroom3(void)
 
 /* This one is called only if map is browsable */
 static int
-amfs_readdir3_browsable(am_node *mp, am_cookie3 cookie,
+amfs_readdir3_browsable(am_node *mp, voidp cookie,
                        am_dirlist3 *dp, am_entry3 *ep, u_int count,
                        int fully_browsable)
 {
@@ -647,7 +647,8 @@ amfs_readdir3_browsable(am_node *mp, am_cookie3 cookie,
   dp->eof = FALSE;             /* assume readdir not done */
 
   if (amuDebug(D_READDIR))
-    plog(XLOG_DEBUG, "amfs_readdir3_browsable gen=%lu, count=%d", gen, count);
+    plog(XLOG_DEBUG, "%s: gen=%llu, count=%d", __func__,
+       (unsigned long long)gen, count);
 
   if (gen == 0) {
     size_t needed = needroom3();
@@ -732,8 +733,9 @@ amfs_readdir3_browsable(am_node *mp, am_cookie3 cookie,
       for (j = 0, ne = te; ne; ne = ne->ne_nextentry)
        plog(XLOG_DEBUG, "gen2 key %4d \"%s\"", j++, ne->name);
       for (j = 0, ne = ep; ne; ne = ne->ne_nextentry) {
-       plog(XLOG_DEBUG, "gen2+ key %4d \"%s\" fi=%lu ck=%lu",
-            j++, ne->name, ne->fileid, ne->cookie);
+       plog(XLOG_DEBUG, "gen2+ key %4d \"%s\" fi=%llu ck=%llu",
+            j++, ne->name, (unsigned long long)ne->fileid,
+            (unsigned long long)ne->cookie);
       }
       plog(XLOG_DEBUG, "EOF is %d", dp->eof);
     }
@@ -793,14 +795,15 @@ amfs_readdir3_browsable(am_node *mp, am_cookie3 cookie,
 }
 
 static int
-amfs_readdir3(am_node *mp, am_cookie3 cookie,
+amfs_readdir3(am_node *mp, voidp cookie,
              am_dirlist3 *dp, am_entry3 *ep, u_int count)
 {
   uint64 gen = *(uint64 *) cookie;
   am_node *xp;
 
   if (amuDebug(D_READDIR))
-    plog(XLOG_DEBUG, "amfs_readdir3 gen=%lu, count=%d", gen, count);
+    plog(XLOG_DEBUG, "%s: gen=%llu, count=%d", __func__,
+       (unsigned long long)gen, count);
 
   dp->eof = FALSE;             /* assume readdir not done */
 
@@ -847,8 +850,9 @@ amfs_readdir3(am_node *mp, am_cookie3 cookie,
       am_entry3 *ne;
       int j;
       for (j = 0, ne = ep; ne; ne = ne->nextentry) {
-       plog(XLOG_DEBUG, "gen1 key %4d \"%s\" fi=%lu ck=%lu",
-            j++, ne->name, ne->fileid, ne->cookie);
+       plog(XLOG_DEBUG, "gen1 key %4d \"%s\" fi=%llu ck=%llu",
+            j++, ne->name, (unsigned long long)ne->fileid,
+            (unsigned long long)ne->cookie);
       }
     }
     return 0;
@@ -907,8 +911,9 @@ amfs_readdir3(am_node *mp, am_cookie3 cookie,
       am_entry3 *ne;
       int j;
       for (j = 0, ne = ep; ne; ne = ne->nextentry) {
-       plog(XLOG_DEBUG, "gen2 key %4d \"%s\" fi=%lu ck=%lu",
-            j++, ne->name, ne->fileid, ne->cookie);
+       plog(XLOG_DEBUG, "gen2 key %4d \"%s\" fi=%llu ck=%llu",
+            j++, ne->name, (unsigned long long)ne->fileid,
+            (unsigned long long)ne->cookie);
       }
     }
     return 0;
@@ -944,8 +949,8 @@ amfs_generic_readdir(am_node *mp, voidp cookie, voidp dp, voidp ep, u_int count)
       return amfs_readdir(mp, cookie, dp, ep, count);
   } else {
     if (browsable)
-      return amfs_readdir3_browsable(mp, (am_cookie3) cookie, dp, ep, count, full);
+      return amfs_readdir3_browsable(mp, cookie, dp, ep, count, full);
     else
-      return amfs_readdir3(mp, (am_cookie3) cookie, dp, ep, count);
+      return amfs_readdir3(mp, cookie, dp, ep, count);
   }
 }
index 5d4ed7ad737af134ce4bdef41fb1105be07e8ef1..dc5fe025a3a752542e6ba11bfb0e4ac8febca098 100644 (file)
--- a/amq/amq.c
+++ b/amq/amq.c
@@ -79,7 +79,7 @@ enum show_opt {
 static void
 time_print(time_type tt)
 {
-  time_t t = (time_t)tt;
+  time_t t = (time_t)*tt;
   struct tm *tp = localtime(&t);
   printf("%02d/%02d/%04d %02d:%02d:%02d",
         tp->tm_mon + 1, tp->tm_mday,