From: Richard W.M. Jones Date: Fri, 6 Nov 2009 09:14:31 +0000 (+0000) Subject: Fixes for compiling on 32 bit. X-Git-Tag: 1.0.78~38 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=e1f5472395b08033c60054e8f87f3c61126c4fa4;p=libguestfs.git Fixes for compiling on 32 bit. --- diff --git a/fish/alloc.c b/fish/alloc.c index fd5be2c..ad2dccc 100644 --- a/fish/alloc.c +++ b/fish/alloc.c @@ -140,12 +140,12 @@ parse_size (const char *str, off_t *size_rtn) */ if (sscanf (str, "%"SCNu64"%c", &size, &type) == 2) { switch (type) { - case 'k': case 'K': size *= 1024L; break; - case 'm': case 'M': size *= 1024L * 1024; break; - case 'g': case 'G': size *= 1024L * 1024 * 1024; break; - case 't': case 'T': size *= 1024L * 1024 * 1024 * 1024; break; - case 'p': case 'P': size *= 1024L * 1024 * 1024 * 1024 * 1024; break; - case 'e': case 'E': size *= 1024L * 1024 * 1024 * 1024 * 1024 * 1024; break; + case 'k': case 'K': size *= 1024ULL; break; + case 'm': case 'M': size *= 1024ULL * 1024ULL; break; + case 'g': case 'G': size *= 1024ULL * 1024ULL * 1024ULL; break; + case 't': case 'T': size *= 1024ULL * 1024ULL * 1024ULL * 1024ULL; break; + case 'p': case 'P': size *= 1024ULL * 1024ULL * 1024ULL * 1024ULL * 1024ULL; break; + case 'e': case 'E': size *= 1024ULL * 1024ULL * 1024ULL * 1024ULL * 1024ULL * 1024ULL; break; case 's': size *= 512; break; default: fprintf (stderr, _("could not parse size specification '%s'\n"), str); @@ -153,7 +153,7 @@ parse_size (const char *str, off_t *size_rtn) } } else if (sscanf (str, "%"SCNu64, &size) == 1) - size *= 1024; + size *= 1024ULL; else { fprintf (stderr, _("could not parse size specification '%s'\n"), str); return -1; diff --git a/fuse/guestmount.c b/fuse/guestmount.c index 3ae614c..8812ac2 100644 --- a/fuse/guestmount.c +++ b/fuse/guestmount.c @@ -619,7 +619,7 @@ fg_read (const char *path, char *buf, size_t size, off_t offset, size_t rsize; if (verbose) - fprintf (stderr, "fg_read: %s: size %zu offset %zu\n", + fprintf (stderr, "fg_read: %s: size %zu offset %ju\n", path, size, offset); /* The guestfs protocol limits size to somewhere over 2MB. We just