tools: Rename u_int64 to solve AIX problem
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 7 Apr 2012 11:36:54 +0000 (12:36 +0100)
committerDerrick Brashear <shadow@dementix.org>
Sat, 7 Apr 2012 13:23:05 +0000 (06:23 -0700)
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 <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

19 files changed:
src/tools/afsdump_extract.c
src/tools/afsdump_scan.c
src/tools/afsdump_xsed.c
src/tools/backuphdr.c
src/tools/directory.c
src/tools/dumpscan.h
src/tools/int64.c
src/tools/intNN.h
src/tools/internal.h
src/tools/parsedump.c
src/tools/parsetag.c
src/tools/parsevnode.c
src/tools/parsevol.c
src/tools/stagehdr.c
src/tools/util.c
src/tools/xf_files.c
src/tools/xf_profile.c
src/tools/xfiles.c
src/tools/xfiles.h

index 88b6a22..9b25203 100644 (file)
@@ -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;
index 8bc7f10..5fc2bda 100644 (file)
@@ -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));
index f726ae9..3328e51 100644 (file)
@@ -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));
index 68cd6e4..0732d4f 100644 (file)
@@ -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)? */
index d2f11b4..2f2005c 100644 (file)
@@ -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");
index a0ebe39..ccf8afc 100644 (file)
@@ -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 {
index de3396b..a6897a2 100644 (file)
 #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;
index bc56bfe..6c264a0 100644 (file)
@@ -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_ */
index 276767a..0577238 100644 (file)
@@ -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);
index bbb48e8..1b3171b 100644 (file)
@@ -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));
index 67e8a2c..6ebd1a9 100644 (file)
@@ -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;
index 8f09fd1..4227a06 100644 (file)
@@ -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;
index 9b95368..313051a 100644 (file)
@@ -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));
index ecdd2c2..7b494ab 100644 (file)
@@ -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)))
index badf07e..778eac7 100644 (file)
@@ -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;
index 719d3a2..146e6a5 100644 (file)
@@ -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);
index f043849..d24c72f 100644 (file)
@@ -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;
index 08898fb..806bd78 100644 (file)
@@ -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) {
index 83d3b7e..2abc80b 100644 (file)
@@ -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 */