From 47545cb93d292a89d21c3d4f554584d9f00a9103 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sat, 7 Apr 2012 12:36:54 +0100 Subject: [PATCH] tools: Rename u_int64 to solve AIX problem AIX's system headers define u_int64. Rename our local 64 bit integer representation as dt_uint64 to avoid this collision. Change-Id: I997e3ff89df369a5f0643921a846a759bf8fa90b Reviewed-on: http://gerrit.openafs.org/7115 Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear --- src/tools/afsdump_extract.c | 6 +++--- src/tools/afsdump_scan.c | 2 +- src/tools/afsdump_xsed.c | 2 +- src/tools/backuphdr.c | 2 +- src/tools/directory.c | 2 +- src/tools/dumpscan.h | 16 ++++++++-------- src/tools/int64.c | 16 ++++++++-------- src/tools/intNN.h | 24 ++++++++++++------------ src/tools/internal.h | 2 +- src/tools/parsedump.c | 2 +- src/tools/parsetag.c | 4 ++-- src/tools/parsevnode.c | 8 ++++---- src/tools/parsevol.c | 2 +- src/tools/stagehdr.c | 2 +- src/tools/util.c | 4 ++-- src/tools/xf_files.c | 4 ++-- src/tools/xf_profile.c | 4 ++-- src/tools/xfiles.c | 10 +++++----- src/tools/xfiles.h | 10 +++++----- 19 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/tools/afsdump_extract.c b/src/tools/afsdump_extract.c index 88b6a22cf..9b252039c 100644 --- a/src/tools/afsdump_extract.c +++ b/src/tools/afsdump_extract.c @@ -400,7 +400,7 @@ static afs_uint32 file_cb(afs_vnode * v, XFILE * X, void *refcon) { char *vnodepath, vnpx[30]; - u_int64 where; + dt_uint64 where; XFILE OX; int r, use = 0; @@ -462,7 +462,7 @@ static afs_uint32 symlink_cb(afs_vnode * v, XFILE * X, void *refcon) { char *vnodepath, *linktarget, vnpx[30]; - u_int64 where; + dt_uint64 where; int r, use = 0; if (!dirs_done) { @@ -567,7 +567,7 @@ main(int argc, char **argv) dirs_done = 0; if (!use_vnum) { - u_int64 where; + dt_uint64 where; memset(&phi, 0, sizeof(phi)); phi.p = &dp; diff --git a/src/tools/afsdump_scan.c b/src/tools/afsdump_scan.c index 8bc7f1024..5fc2bdae2 100644 --- a/src/tools/afsdump_scan.c +++ b/src/tools/afsdump_scan.c @@ -331,7 +331,7 @@ main(int argc, char **argv) } if (printflags & DSPRINT_PATH) { - u_int64 where; + dt_uint64 where; dp.print_flags = printflags & DSPRINT_DEBUG; memset(&phi, 0, sizeof(phi)); diff --git a/src/tools/afsdump_xsed.c b/src/tools/afsdump_xsed.c index f726ae9a3..3328e5185 100644 --- a/src/tools/afsdump_xsed.c +++ b/src/tools/afsdump_xsed.c @@ -362,7 +362,7 @@ main(int argc, char **argv) } if (printflags & DSPRINT_PATH) { - u_int64 where; + dt_uint64 where; dp.print_flags = printflags & DSPRINT_DEBUG; bzero(&phi, sizeof(phi)); diff --git a/src/tools/backuphdr.c b/src/tools/backuphdr.c index 68cd6e415..0732d4f65 100644 --- a/src/tools/backuphdr.c +++ b/src/tools/backuphdr.c @@ -40,7 +40,7 @@ try_backuphdr(XFILE * X, char *tag, tagged_field * field, afs_uint32 value, { dump_parser *p = (dump_parser *) g_refcon; backup_system_header bh; - u_int64 where; + dt_uint64 where; afs_uint32 r; /* Which header should we try (if any)? */ diff --git a/src/tools/directory.c b/src/tools/directory.c index d2f11b4ca..2f2005ce8 100644 --- a/src/tools/directory.c +++ b/src/tools/directory.c @@ -93,7 +93,7 @@ afs_uint32 parse_directory(XFILE *X, dump_parser *p, afs_vnode *v, afs_dir_entry de; int pgno, i, l, n; afs_int32 r; - u_int64 where; + dt_uint64 where; if (p->print_flags & DSPRINT_DIR) { printf(" VNode Uniqifier Name\n"); diff --git a/src/tools/dumpscan.h b/src/tools/dumpscan.h index a0ebe39d3..ccf8afcbe 100644 --- a/src/tools/dumpscan.h +++ b/src/tools/dumpscan.h @@ -78,7 +78,7 @@ typedef struct { unsigned char *part; unsigned char *volname; afs_uint32 volid; - u_int64 dumplen; + dt_uint64 dumplen; afs_uint32 level; afs_uint32 magic; afs_uint32 cksum; @@ -92,7 +92,7 @@ typedef struct { #define F_DUMPHDR_FROM 0x00000004 #define F_DUMPHDR_TO 0x00000008 typedef struct { - u_int64 offset; /* Where in the input stream is it? */ + dt_uint64 offset; /* Where in the input stream is it? */ afs_uint32 field_mask; /* What fields are present? */ afs_uint32 magic; /* Magic number */ afs_uint32 version; /* Dump format version */ @@ -130,7 +130,7 @@ typedef struct { #define F_VOLHDR_DAYUSE 0x00800000 #define F_VOLHDR_DAYUSE_DATE 0x01000000 typedef struct { - u_int64 offset; /* Where in the input stream is it? */ + dt_uint64 offset; /* Where in the input stream is it? */ afs_uint32 field_mask; /* What fields are present? */ afs_uint32 volid; /* Volume ID */ afs_uint32 volvers; /* ?? */ @@ -177,7 +177,7 @@ typedef struct { #define F_VNODE_PARTIAL 0x00002000 /* Partial vnode continuation (no header) */ #define F_VNODE_LINK_TARGET 0x00004000 /* Symlink target present */ typedef struct { - u_int64 offset; /* Where in the input stream is it? */ + dt_uint64 offset; /* Where in the input stream is it? */ afs_uint32 field_mask; /* What fields are present? */ afs_uint32 vnode; /* Vnode number */ afs_uint32 vuniq; /* Uniquifier */ @@ -192,7 +192,7 @@ typedef struct { afs_uint32 client_date; /* Last modified date from client */ afs_uint32 server_date; /* Last modified date on server */ afs_uint32 size; /* Size of data */ - u_int64 d_offset; /* Where in the input stream is the data? */ + dt_uint64 d_offset; /* Where in the input stream is the data? */ char *link_target; /* Target of symbolic link */ unsigned char acl[SIZEOF_LARGEDISKVNODE - SIZEOF_SMALLDISKVNODE]; } afs_vnode; @@ -230,7 +230,7 @@ struct tag_parse_info { #define TPFLAG_SKIP 0x0001 #define TPFLAG_RSKIP 0x0002 int shift_offset; - u_int64 shift_start; + dt_uint64 shift_start; }; struct tagged_field { char tag; /* Tag character */ @@ -308,8 +308,8 @@ typedef struct vhash_ent { struct vhash_ent *next; /* Pointer to next entry */ afs_uint32 vnode; /* VNode number */ afs_uint32 parent; /* Parent VNode number */ - u_int64 v_offset; /* Offset to start of vnode */ - u_int64 d_offset; /* Offset to data (0 if none) */ + dt_uint64 v_offset; /* Offset to start of vnode */ + dt_uint64 d_offset; /* Offset to data (0 if none) */ afs_uint32 d_size; /* Size of data */ } vhash_ent; typedef struct { diff --git a/src/tools/int64.c b/src/tools/int64.c index de3396be4..a6897a2b5 100644 --- a/src/tools/int64.c +++ b/src/tools/int64.c @@ -33,13 +33,13 @@ #include "intNN.h" char * -hexify_int64(u_int64 * X, char *buf) +hexify_int64(dt_uint64 * X, char *buf) { static char mybuf[17]; #ifdef NATIVE_INT64 char c, *p; - u_int64 x = *X; + dt_uint64 x = *X; if (!buf) buf = mybuf; @@ -66,11 +66,11 @@ hexify_int64(u_int64 * X, char *buf) #ifdef NATIVE_INT64 char * -decimate_int64(u_int64 * X, char *buf) +decimate_int64(dt_uint64 * X, char *buf) { static char mybuf[21]; char *p; - u_int64 x = *X; + dt_uint64 x = *X; if (!buf) buf = mybuf; @@ -203,7 +203,7 @@ decimate(unsigned long hi, unsigned long lo, char *answer) } char * -decimate_int64(u_int64 * X, char *buf) +decimate_int64(dt_uint64 * X, char *buf) { static char mybuf[21]; char *p; @@ -220,7 +220,7 @@ decimate_int64(u_int64 * X, char *buf) void -shift_int64(u_int64 * X, int bits) +shift_int64(dt_uint64 * X, int bits) { #ifdef NATIVE_INT64 if (bits < 0) @@ -302,7 +302,7 @@ verify_int64_size() void test_int64_constructs(void) { - u_int64 x, y; + dt_uint64 x, y; afs_uint32 hi, lo; int failures = 0, pass; char buf[17]; @@ -357,7 +357,7 @@ void test_int64_compares() { #define NCOMPARE 9 - u_int64 control, test[NCOMPARE]; + dt_uint64 control, test[NCOMPARE]; char cbuf[17], tbuf[17]; int i, r, result[NCOMPARE]; int pass, failures, FAILURES = 0; diff --git a/src/tools/intNN.h b/src/tools/intNN.h index bc56bfe5a..6c264a0f5 100644 --- a/src/tools/intNN.h +++ b/src/tools/intNN.h @@ -49,11 +49,11 @@ typedef unsigned long afs_uint32; #ifdef NATIVE_INT64 -typedef unsigned NATIVE_INT64 u_int64; +typedef unsigned NATIVE_INT64 dt_uint64; /* construct/extract/assign */ -#define mk64(X,H,L) ((X) = ( ((u_int64)(H) << 32) \ - | ((u_int64)(L) & 0xffffffff))) +#define mk64(X,H,L) ((X) = ( ((dt_uint64)(H) << 32) \ + | ((dt_uint64)(L) & 0xffffffff))) #define hi64(Y) ((afs_uint32)(((Y) >> 32) & 0xffffffff)) #define lo64(Y) ((afs_uint32)((Y) & 0xffffffff)) #define ex64(Y,H,L) ((H) = hi64(Y), (L) = lo64(Y)) @@ -71,9 +71,9 @@ typedef unsigned NATIVE_INT64 u_int64; #define zero64(X) (!(X)) /* Arithmetic */ -#define add64_32(X,A,B) ((X) = (A) + (u_int64)(B)) +#define add64_32(X,A,B) ((X) = (A) + (dt_uint64)(B)) #define add64_64(X,A,B) ((X) = (A) + (B)) -#define sub64_32(X,A,B) ((X) = (A) - (u_int64)(B)) +#define sub64_32(X,A,B) ((X) = (A) - (dt_uint64)(B)) #define sub64_64(X,A,B) ((X) = (A) - (B)) /* Byte-order */ @@ -89,7 +89,7 @@ typedef unsigned NATIVE_INT64 u_int64; /** We have to provide our own 64-bit integers **/ typedef struct { afs_uint32 hi, lo; -} u_int64; +} dt_uint64; /* construct/extract/assign */ #define mk64(X,H,L) ((X).hi = (H), (X).lo = (L)) @@ -131,27 +131,27 @@ typedef struct { /* The following are too complex to be macros: */ -/* char *hexify_int64(u_int64 a, char *buf) +/* char *hexify_int64(dt_uint64 a, char *buf) * Produces an ASCII representation of a in hexadecimal, and returns * a pointer to the resulting string. If buf is non-NULL, it is taken * to be a pointer to the buffer to be used, which must be at least 17 * bytes long. This function is thread-safe iff buf is provided. */ -extern char *hexify_int64(u_int64 *, char *); +extern char *hexify_int64(dt_uint64 *, char *); -/* char *decimate_int64(u_int64 a, char *buf) +/* char *decimate_int64(dt_uint64 a, char *buf) * Produces an ASCII representation of a in decimal, and returns * a pointer to the resulting string. If buf is non-NULL, it is taken * to be a pointer to the buffer to be used, which must be at least 21 * bytes long. This function is thread-safe iff buf is provided. */ -extern char *decimate_int64(u_int64 *, char *); +extern char *decimate_int64(dt_uint64 *, char *); -/* void shift_int64(u_int64 a, int bits) +/* void shift_int64(dt_uint64 a, int bits) * Shifts the 64-bit integer in a by the specified number of bits. * If bits is positive, the shift is to the left; if negative, the * shift is to the right. */ -extern void shift_int64(u_int64 *, int); +extern void shift_int64(dt_uint64 *, int); #endif /* _INTNN_H_ */ diff --git a/src/tools/internal.h b/src/tools/internal.h index 276767ab2..0577238e7 100644 --- a/src/tools/internal.h +++ b/src/tools/internal.h @@ -53,5 +53,5 @@ extern afs_uint32 try_backuphdr(XFILE * X, unsigned char *tag, /* util.c - Random utilities */ extern afs_uint32 handle_return(int, XFILE *, unsigned char, dump_parser *); extern void prep_pi(dump_parser *, tag_parse_info *); -extern afs_uint32 match_next_vnode(XFILE *, dump_parser *, u_int64 *, +extern afs_uint32 match_next_vnode(XFILE *, dump_parser *, dt_uint64 *, afs_uint32); diff --git a/src/tools/parsedump.c b/src/tools/parsedump.c index bbb48e846..1b3171b01 100644 --- a/src/tools/parsedump.c +++ b/src/tools/parsedump.c @@ -75,7 +75,7 @@ parse_dumphdr(XFILE * X, unsigned char *tag, tagged_field * field, { dump_parser *p = (dump_parser *) g_refcon; afs_dump_header hdr; - u_int64 where; + dt_uint64 where; afs_uint32 r; memset(&hdr, 0, sizeof(hdr)); diff --git a/src/tools/parsetag.c b/src/tools/parsetag.c index 67e8a2cd4..6ebd1a91c 100644 --- a/src/tools/parsetag.c +++ b/src/tools/parsetag.c @@ -79,7 +79,7 @@ ParseTaggedData(XFILE * X, tagged_field * fields, unsigned char *tag, * work much of the time. */ if (!*tag && pi->shift_offset && (pi->flags & TPFLAG_RSKIP)) { - u_int64 where, tmp64a, tmp64b; + dt_uint64 where, tmp64a, tmp64b; char buf1[21], buf2[21], buf3[21]; char *p1, *p2, *p3; @@ -107,7 +107,7 @@ ParseTaggedData(XFILE * X, tagged_field * fields, unsigned char *tag, } if (!*tag && (pi->flags & TPFLAG_SKIP)) { int count = 0; - u_int64 where, tmp64a; + dt_uint64 where, tmp64a; if ((r = xftell(X, &where))) return r; diff --git a/src/tools/parsevnode.c b/src/tools/parsevnode.c index 8f09fd137..4227a06a1 100644 --- a/src/tools/parsevnode.c +++ b/src/tools/parsevnode.c @@ -69,7 +69,7 @@ static tagged_field vnode_fields[] = { static afs_uint32 resync_vnode(XFILE * X, dump_parser * p, afs_vnode * v, int start, int limit) { - u_int64 where, expected_where; + dt_uint64 where, expected_where; afs_uint32 r; int i; @@ -123,7 +123,7 @@ parse_vnode(XFILE * X, unsigned char *tag, tagged_field * field, { dump_parser *p = (dump_parser *) g_refcon; afs_uint32(*cb) (afs_vnode *, XFILE *, void *); - u_int64 where, offset2k; + dt_uint64 where, offset2k; afs_vnode v; afs_uint32 r; @@ -153,7 +153,7 @@ parse_vnode(XFILE * X, unsigned char *tag, tagged_field * field, /* Try to resync, if requested */ if (!r && (p->repair_flags & DSFIX_VFSYNC)) { afs_uint32 drop; - u_int64 xwhere; + dt_uint64 xwhere; if ((r = xftell(X, &where))) return r; @@ -214,7 +214,7 @@ parse_vnode(XFILE * X, unsigned char *tag, tagged_field * field, } else cb = p->cb_vnode_empty; if (cb) { - u_int64 where; + dt_uint64 where; if ((r = xftell(X, &where))) return r; diff --git a/src/tools/parsevol.c b/src/tools/parsevol.c index 9b95368e3..313051a9e 100644 --- a/src/tools/parsevol.c +++ b/src/tools/parsevol.c @@ -78,7 +78,7 @@ parse_volhdr(XFILE * X, unsigned char *tag, tagged_field * field, { dump_parser *p = (dump_parser *) g_refcon; afs_vol_header hdr; - u_int64 where; + dt_uint64 where; afs_uint32 r; memset(&hdr, 0, sizeof(hdr)); diff --git a/src/tools/stagehdr.c b/src/tools/stagehdr.c index ecdd2c210..7b494ab12 100644 --- a/src/tools/stagehdr.c +++ b/src/tools/stagehdr.c @@ -63,7 +63,7 @@ ParseStageHdr(XFILE * X, unsigned char *tag, backup_system_header * hdr) { char buf[STAGE_HDRLEN]; struct stage_header *bckhdr = (struct stage_header *)buf; - u_int64 where; + dt_uint64 where; afs_int32 r; if ((r = xftell(X, &where))) diff --git a/src/tools/util.c b/src/tools/util.c index badf07e01..778eac78c 100644 --- a/src/tools/util.c +++ b/src/tools/util.c @@ -45,7 +45,7 @@ int handle_return(int r, XFILE * X, unsigned char tag, dump_parser * p) { - u_int64 where, xwhere; + dt_uint64 where, xwhere; switch (r) { case 0: @@ -115,7 +115,7 @@ prep_pi(dump_parser * p, tag_parse_info * pi) */ /*** THIS FUNCTION INTENDED FOR INTERNAL USE ONLY ***/ int -match_next_vnode(XFILE * X, dump_parser * p, u_int64 * where, +match_next_vnode(XFILE * X, dump_parser * p, dt_uint64 * where, afs_uint32 vnode) { afs_uint32 r, x, y, z; diff --git a/src/tools/xf_files.c b/src/tools/xf_files.c index 719d3a2dc..146e6a5c3 100644 --- a/src/tools/xf_files.c +++ b/src/tools/xf_files.c @@ -71,7 +71,7 @@ xf_FILE_do_write(XFILE * X, void *buf, afs_uint32 count) /* do_tell for stdio xfiles */ static afs_uint32 -xf_FILE_do_tell(XFILE * X, u_int64 * offset) +xf_FILE_do_tell(XFILE * X, dt_uint64 * offset) { FILE *F = X->refcon; off_t where; @@ -86,7 +86,7 @@ xf_FILE_do_tell(XFILE * X, u_int64 * offset) /* do_seek for stdio xfiles */ static afs_uint32 -xf_FILE_do_seek(XFILE * X, u_int64 * offset) +xf_FILE_do_seek(XFILE * X, dt_uint64 * offset) { FILE *F = X->refcon; off_t where = get64(*offset); diff --git a/src/tools/xf_profile.c b/src/tools/xf_profile.c index f04384937..d24c72f13 100644 --- a/src/tools/xf_profile.c +++ b/src/tools/xf_profile.c @@ -74,7 +74,7 @@ xf_PROFILE_do_write(XFILE * X, void *buf, afs_uint32 count) /* do_tell for profiled xfiles */ static afs_uint32 -xf_PROFILE_do_tell(XFILE * X, u_int64 * offset) +xf_PROFILE_do_tell(XFILE * X, dt_uint64 * offset) { PFILE *PF = X->refcon; afs_uint32 err; @@ -90,7 +90,7 @@ xf_PROFILE_do_tell(XFILE * X, u_int64 * offset) /* do_seek for profiled xfiles */ static afs_uint32 -xf_PROFILE_do_seek(XFILE * X, u_int64 * offset) +xf_PROFILE_do_seek(XFILE * X, dt_uint64 * offset) { PFILE *PF = X->refcon; afs_uint32 err; diff --git a/src/tools/xfiles.c b/src/tools/xfiles.c index 08898fb2b..806bd78a9 100644 --- a/src/tools/xfiles.c +++ b/src/tools/xfiles.c @@ -58,7 +58,7 @@ afs_uint32 xfread(XFILE * X, void *buf, afs_uint32 count) { afs_uint32 code; - u_int64 tmp64; + dt_uint64 tmp64; code = (X->do_read) (X, buf, count); if (code) @@ -76,7 +76,7 @@ afs_uint32 xfwrite(XFILE * X, void *buf, afs_uint32 count) { afs_uint32 code; - u_int64 tmp64; + dt_uint64 tmp64; if (!X->is_writable) return ERROR_XFILE_RDONLY; @@ -91,7 +91,7 @@ xfwrite(XFILE * X, void *buf, afs_uint32 count) afs_uint32 -xftell(XFILE * X, u_int64 * offset) +xftell(XFILE * X, dt_uint64 * offset) { if (X->do_tell) return (X->do_tell) (X, offset); @@ -101,7 +101,7 @@ xftell(XFILE * X, u_int64 * offset) afs_uint32 -xfseek(XFILE * X, u_int64 * offset) +xfseek(XFILE * X, dt_uint64 * offset) { afs_uint32 code; @@ -119,7 +119,7 @@ afs_uint32 xfskip(XFILE * X, afs_uint32 count) { afs_uint32 code; - u_int64 tmp64; + dt_uint64 tmp64; /* Use the skip method, if there is one */ if (X->do_skip && !X->passthru) { diff --git a/src/tools/xfiles.h b/src/tools/xfiles.h index 83d3b7eed..2abc80be3 100644 --- a/src/tools/xfiles.h +++ b/src/tools/xfiles.h @@ -44,11 +44,11 @@ typedef struct XFILE XFILE; struct XFILE { afs_uint32(*do_read) (XFILE *, void *, afs_uint32); /* read data */ afs_uint32(*do_write) (XFILE *, void *, afs_uint32); /* write data */ - afs_uint32(*do_tell) (XFILE *, u_int64 *); /* find position */ - afs_uint32(*do_seek) (XFILE *, u_int64 *); /* set position */ + afs_uint32(*do_tell) (XFILE *, dt_uint64 *); /* find position */ + afs_uint32(*do_seek) (XFILE *, dt_uint64 *); /* set position */ afs_uint32(*do_skip) (XFILE *, afs_uint32); /* skip forward */ afs_uint32(*do_close) (XFILE *); /* close */ - u_int64 filepos; /* position (counted) */ + dt_uint64 filepos; /* position (counted) */ int is_seekable; /* 1 if seek works */ int is_writable; /* 1 if write works */ XFILE *passthru; /* XFILE to pass thru to */ @@ -78,8 +78,8 @@ extern afs_uint32 xfread(XFILE *, void *, afs_uint32); /* read data */ extern afs_uint32 xfwrite(XFILE *, void *, afs_uint32); /* write data */ extern afs_uint32 xfprintf(XFILE *, char *, ...); /* formatted */ extern afs_uint32 vxfprintf(XFILE *, char *, va_list); /* formatted VA */ -extern afs_uint32 xftell(XFILE *, u_int64 *); /* get position */ -extern afs_uint32 xfseek(XFILE *, u_int64 *); /* set position */ +extern afs_uint32 xftell(XFILE *, dt_uint64 *); /* get position */ +extern afs_uint32 xfseek(XFILE *, dt_uint64 *); /* set position */ extern afs_uint32 xfskip(XFILE *, afs_uint32); /* skip forward */ extern afs_uint32 xfpass(XFILE *, XFILE *); /* set passthru */ extern afs_uint32 xfunpass(XFILE *); /* unset passthru */ -- 2.39.5