From: Eric Bollengier Date: Thu, 7 Jul 2011 11:58:59 +0000 (+0200) Subject: Change intmax_t to int64_t to fix #1664 X-Git-Tag: Release-7.0.0~876 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9c4549dc76cd8040d82c8520c09148f116469cfd;p=bacula%2Fbacula Change intmax_t to int64_t to fix #1664 --- diff --git a/bacula/src/filed/restore.c b/bacula/src/filed/restore.c index 7c4b028578..8b3ef7dfb7 100644 --- a/bacula/src/filed/restore.c +++ b/bacula/src/filed/restore.c @@ -162,7 +162,7 @@ void do_restore(JCR *jcr) char ec1[50]; /* Buffer printing huge values */ uint32_t buf_size; /* client buffer size */ int stat; - intmax_t rsrc_len = 0; /* Original length of resource fork */ + int64_t rsrc_len = 0; /* Original length of resource fork */ r_ctx rctx; ATTR *attr; /* ***FIXME*** make configurable */ diff --git a/bacula/src/filed/restore.h b/bacula/src/filed/restore.h index ffb0897d1d..bb4cfac92d 100644 --- a/bacula/src/filed/restore.h +++ b/bacula/src/filed/restore.h @@ -50,7 +50,7 @@ struct r_ctx { int flags; /* Options for extract_data() */ BFILE forkbfd; /* Alternative data stream */ uint64_t fork_addr; /* Write address for alternative stream */ - intmax_t fork_size; /* Size of alternate stream */ + int64_t fork_size; /* Size of alternate stream */ int fork_flags; /* Options for extract_data() */ int32_t type; /* file type FT_ */ ATTR *attr; /* Pointer to attributes */ diff --git a/bacula/src/lib/base64.c b/bacula/src/lib/base64.c index c07f12fd66..7975864ce0 100644 --- a/bacula/src/lib/base64.c +++ b/bacula/src/lib/base64.c @@ -74,9 +74,9 @@ base64_init(void) * stored (not including the EOS). */ int -to_base64(intmax_t value, char *where) +to_base64(int64_t value, char *where) { - uintmax_t val; + uint64_t val; int i = 0; int n; @@ -98,7 +98,7 @@ to_base64(intmax_t value, char *where) val = value; where[i] = 0; do { - where[--i] = base64_digits[val & (uintmax_t)0x3F]; + where[--i] = base64_digits[val & (uint64_t)0x3F]; val >>= 6; } while (val); return n; @@ -112,9 +112,9 @@ to_base64(intmax_t value, char *where) * Returns the value. */ int -from_base64(intmax_t *value, char *where) +from_base64(int64_t *value, char *where) { - uintmax_t val = 0; + uint64_t val = 0; int i, neg; if (!base64_inited) @@ -131,7 +131,7 @@ from_base64(intmax_t *value, char *where) val += base64_map[(uint8_t)where[i++]]; } - *value = neg ? -(intmax_t)val : (intmax_t)val; + *value = neg ? -(int64_t)val : (int64_t)val; return i; } @@ -324,24 +324,24 @@ int main(int argc, char *argv[]) #ifdef xxx p = where; - p += to_base64((intmax_t)(statp.st_atime), p); + p += to_base64((int64_t)(statp.st_atime), p); *p++ = ' '; - p += to_base64((intmax_t)t, p); + p += to_base64((int64_t)t, p); printf("%s %s\n", fname, where); - printf("%s %lld\n", "st_dev", (intmax_t)statp.st_dev); - printf("%s %lld\n", "st_ino", (intmax_t)statp.st_ino); - printf("%s %lld\n", "st_mode", (intmax_t)statp.st_mode); - printf("%s %lld\n", "st_nlink", (intmax_t)statp.st_nlink); - printf("%s %lld\n", "st_uid", (intmax_t)statp.st_uid); - printf("%s %lld\n", "st_gid", (intmax_t)statp.st_gid); - printf("%s %lld\n", "st_rdev", (intmax_t)statp.st_rdev); - printf("%s %lld\n", "st_size", (intmax_t)statp.st_size); - printf("%s %lld\n", "st_blksize", (intmax_t)statp.st_blksize); - printf("%s %lld\n", "st_blocks", (intmax_t)statp.st_blocks); - printf("%s %lld\n", "st_atime", (intmax_t)statp.st_atime); - printf("%s %lld\n", "st_mtime", (intmax_t)statp.st_mtime); - printf("%s %lld\n", "st_ctime", (intmax_t)statp.st_ctime); + printf("%s %lld\n", "st_dev", (int64_t)statp.st_dev); + printf("%s %lld\n", "st_ino", (int64_t)statp.st_ino); + printf("%s %lld\n", "st_mode", (int64_t)statp.st_mode); + printf("%s %lld\n", "st_nlink", (int64_t)statp.st_nlink); + printf("%s %lld\n", "st_uid", (int64_t)statp.st_uid); + printf("%s %lld\n", "st_gid", (int64_t)statp.st_gid); + printf("%s %lld\n", "st_rdev", (int64_t)statp.st_rdev); + printf("%s %lld\n", "st_size", (int64_t)statp.st_size); + printf("%s %lld\n", "st_blksize", (int64_t)statp.st_blksize); + printf("%s %lld\n", "st_blocks", (int64_t)statp.st_blocks); + printf("%s %lld\n", "st_atime", (int64_t)statp.st_atime); + printf("%s %lld\n", "st_mtime", (int64_t)statp.st_mtime); + printf("%s %lld\n", "st_ctime", (int64_t)statp.st_ctime); #endif if (debug_level) diff --git a/bacula/src/lib/protos.h b/bacula/src/lib/protos.h index fbc241fd31..e161158b4d 100644 --- a/bacula/src/lib/protos.h +++ b/bacula/src/lib/protos.h @@ -44,8 +44,8 @@ void print_ls_output(JCR *jcr, ATTR *attr); /* base64.c */ void base64_init (void); -int to_base64 (intmax_t value, char *where); -int from_base64 (intmax_t *value, char *where); +int to_base64 (int64_t value, char *where); +int from_base64 (int64_t *value, char *where); int bin_to_base64 (char *buf, int buflen, char *bin, int binlen, int compatible); int base64_to_bin(char *dest, int destlen, char *src, int srclen);