]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: remove the uchar_t typedef
authorChristoph Hellwig <hch@lst.de>
Thu, 30 Jul 2015 23:19:58 +0000 (09:19 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 30 Jul 2015 23:19:58 +0000 (09:19 +1000)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
db/hash.c
db/metadump.c
include/darwin.h
include/freebsd.h
include/gnukfreebsd.h
include/linux.h
mkfs/proto.c
repair/attr_repair.c

index 4c49a662e150b69e22091916c5a3d67e21e94367..e02857f12d55662edb0c49b5edccd341aa9a5a07 100644 (file)
--- a/db/hash.c
+++ b/db/hash.c
@@ -52,7 +52,7 @@ hash_f(
 {
        xfs_dahash_t    hashval;
 
-       hashval = libxfs_da_hashname((uchar_t *)argv[1], (int)strlen(argv[1]));
+       hashval = libxfs_da_hashname((unsigned char *)argv[1], (int)strlen(argv[1]));
        dbprintf("0x%x\n", hashval);
        return 0;
 }
index 8ea947b4bf845994ca28e1492591ac8541835b31..1474279a1588d9f7af8f9665ba58c92269a5e6f0 100644 (file)
@@ -529,7 +529,7 @@ struct name_ent {
        struct name_ent         *next;
        xfs_dahash_t            hash;
        int                     namelen;
-       uchar_t                 name[1];
+       unsigned char           name[1];
 };
 
 #define NAME_TABLE_SIZE                4096
@@ -555,7 +555,7 @@ nametable_clear(void)
  * return a pointer to its entry, otherwise return a null pointer.
  */
 static struct name_ent *
-nametable_find(xfs_dahash_t hash, int namelen, uchar_t *name)
+nametable_find(xfs_dahash_t hash, int namelen, unsigned char *name)
 {
        struct name_ent *ent;
 
@@ -572,7 +572,7 @@ nametable_find(xfs_dahash_t hash, int namelen, uchar_t *name)
  * name's new entry, or a null pointer if an error occurs.
  */
 static struct name_ent *
-nametable_add(xfs_dahash_t hash, int namelen, uchar_t *name)
+nametable_add(xfs_dahash_t hash, int namelen, unsigned char *name)
 {
        struct name_ent *ent;
 
@@ -593,10 +593,10 @@ nametable_add(xfs_dahash_t hash, int namelen, uchar_t *name)
 #define is_invalid_char(c)     ((c) == '/' || (c) == '\0')
 #define rol32(x,y)             (((x) << (y)) | ((x) >> (32 - (y))))
 
-static inline uchar_t
+static inline unsigned char
 random_filename_char(void)
 {
-       static uchar_t filename_alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+       static unsigned char filename_alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                                                "abcdefghijklmnopqrstuvwxyz"
                                                "0123456789-_";
 
@@ -611,7 +611,7 @@ is_orphanage_dir(
        struct xfs_mount        *mp,
        xfs_ino_t               dir_ino,
        size_t                  name_len,
-       uchar_t                 *name)
+       unsigned char           *name)
 {
        return dir_ino == mp->m_sb.sb_rootino &&
                        name_len == ORPHANAGE_LEN &&
@@ -630,7 +630,7 @@ static int
 in_lost_found(
        xfs_ino_t               ino,
        int                     namelen,
-       uchar_t                 *name)
+       unsigned char           *name)
 {
        static xfs_ino_t        orphanage_ino = 0;
        char                    s[24];  /* 21 is enough (64 bits in decimal) */
@@ -671,13 +671,13 @@ static void
 obfuscate_name(
        xfs_dahash_t    hash,
        size_t          name_len,
-       uchar_t         *name)
+       unsigned char   *name)
 {
-       uchar_t         *newp = name;
+       unsigned char   *newp = name;
        int             i;
        xfs_dahash_t    new_hash = 0;
-       uchar_t         *first;
-       uchar_t         high_bit;
+       unsigned char   *first;
+       unsigned char   high_bit;
        int             shift;
 
        /*
@@ -826,16 +826,16 @@ obfuscate_name(
 static int
 flip_bit(
        size_t          name_len,
-       uchar_t         *name,
+       unsigned char   *name,
        uint32_t        bitseq)
 {
        int     index;
        size_t  offset;
-       uchar_t *p0, *p1;
-       uchar_t m0, m1;
+       unsigned char *p0, *p1;
+       unsigned char m0, m1;
        struct {
            int         byte;   /* Offset from start within name */
-           uchar_t     bit;    /* Bit within that byte */
+           unsigned char bit;  /* Bit within that byte */
        } bit_to_flip[][2] = {  /* Sorted by second entry's byte */
            { { 0, 0 }, { 1, 7 } },     /* Each row defines a pair */
            { { 1, 0 }, { 2, 7 } },     /* of bytes and a bit within */
@@ -964,7 +964,7 @@ flip_bit(
 static int
 find_alternate(
        size_t          name_len,
-       uchar_t         *name,
+       unsigned char   *name,
        uint32_t        seq)
 {
        uint32_t        bitseq = 0;
@@ -1001,9 +1001,9 @@ find_alternate(
  * are already in the table.
  */
 static int
-handle_duplicate_name(xfs_dahash_t hash, size_t name_len, uchar_t *name)
+handle_duplicate_name(xfs_dahash_t hash, size_t name_len, unsigned char *name)
 {
-       uchar_t         new_name[name_len + 1];
+       unsigned char   new_name[name_len + 1];
        uint32_t        seq = 1;
 
        if (!nametable_find(hash, name_len, name))
@@ -1036,7 +1036,7 @@ static void
 generate_obfuscated_name(
        xfs_ino_t               ino,
        int                     namelen,
-       uchar_t                 *name)
+       unsigned char           *name)
 {
        xfs_dahash_t            hash;
 
@@ -1160,8 +1160,8 @@ obfuscate_path_components(
        char                    *buf,
        __uint64_t              len)
 {
-       uchar_t                 *comp = (uchar_t *)buf;
-       uchar_t                 *end = comp + len;
+       unsigned char           *comp = (unsigned char *)buf;
+       unsigned char           *end = comp + len;
        xfs_dahash_t            hash;
 
        while (comp < end) {
index 95f865b7d0ee0491f9e62992e42aa7e3d601382d..ca9f8f4f19474e379b2660e86c5c3c0350eb8c28 100644 (file)
@@ -127,7 +127,6 @@ typedef u_int32_t   xfs_dev_t;
 typedef int64_t                xfs_daddr_t;
 typedef char*          xfs_caddr_t;
 
-typedef unsigned char  uchar_t;
 #define stat64         stat
 #define fstat64                fstat
 #define lseek64                lseek
index b51688b5e4ee7bdaf301cc16bf22109917d22c87..d01c0c1371c4cf88bceec0698dfaab1fe911f33d 100644 (file)
@@ -55,10 +55,6 @@ typedef __int64_t    xfs_daddr_t;
 typedef char*          xfs_caddr_t;
 typedef off_t          loff_t;
 
-#ifndef        _UCHAR_T_DEFINED
-typedef unsigned char  uchar_t;
-#define        _UCHAR_T_DEFINED        1
-#endif
 typedef enum { B_FALSE,B_TRUE }        boolean_t;
 
 #define        O_LARGEFILE     0
index d392859251de1b18cbb372ad85bbb4c7ddd33896..914825ef5f84d2660533ad9c4b274795fb384e07 100644 (file)
@@ -45,10 +45,6 @@ typedef __int64_t    xfs_daddr_t;
 typedef char*          xfs_caddr_t;
 typedef off_t          loff_t;
 
-#ifndef        _UCHAR_T_DEFINED
-typedef unsigned char  uchar_t;
-#define        _UCHAR_T_DEFINED        1
-#endif
 typedef enum { B_FALSE,B_TRUE }        boolean_t;
 
 #define HAVE_FID       1
index 55862905a870ddef886731a152a82e884ef9865d..da50421e394895cd22a93d6921fa4e96c5e2851a 100644 (file)
@@ -144,11 +144,6 @@ typedef __uint32_t xfs_dev_t;
 typedef __int64_t      xfs_daddr_t;
 typedef char*          xfs_caddr_t;
 
-#ifndef        _UCHAR_T_DEFINED
-typedef unsigned char  uchar_t;
-#define        _UCHAR_T_DEFINED        1
-#endif
-
 #ifndef _BOOLEAN_T_DEFINED
 typedef enum {B_FALSE, B_TRUE} boolean_t;
 #define _BOOLEAN_T_DEFINED     1
index 09325a4b6e900d00781c0d814f3ce9752def43ec..17308bc89f6eb3c2c6e960be248cfc2486641958 100644 (file)
@@ -443,7 +443,7 @@ parseproto(
        mode |= val;
        creds.cr_uid = (int)getnum(pp);
        creds.cr_gid = (int)getnum(pp);
-       xname.name = (uchar_t *)name;
+       xname.name = (unsigned char *)name;
        xname.len = name ? strlen(name) : 0;
        xname.type = 0;
        tp = libxfs_trans_alloc(mp, 0);
index f9afce72ced1054228109c619e0c2a42eb7c4139..e2bfd449513e4ff308d00ad55cbc1ba1f9f87437 100644 (file)
@@ -1121,7 +1121,7 @@ process_leaf_attr_remote(
        if (remotep->namelen == 0 || namecheck((char *)&remotep->name[0], 
                                                remotep->namelen) || 
                        be32_to_cpu(entry->hashval) != 
-                               libxfs_da_hashname((uchar_t *)&remotep->name[0], 
+                               libxfs_da_hashname((unsigned char *)&remotep->name[0], 
                                                remotep->namelen) ||
                        be32_to_cpu(entry->hashval) < last_hashval ||
                        be32_to_cpu(remotep->valueblk) == 0) {