]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: remove __psint_t and __psunsigned_t
authorChristoph Hellwig <hch@lst.de>
Thu, 30 Jul 2015 23:16:58 +0000 (09:16 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 30 Jul 2015 23:16:58 +0000 (09:16 +1000)
Replace them with the standards conform intptr_t and uintptr_t.  Note
that many uses look rather questionable cargo-cult avoidance of pointer
arithmetics, but let's leave that for now and look at it separately.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
16 files changed:
configure.ac
db/bit.c
db/check.c
db/field.c
db/field.h
include/platform_defs.h.in
logprint/log_misc.c
m4/package_types.m4
repair/agheader.c
repair/attr_repair.c
repair/avl.c
repair/avl.h
repair/dir2.c
repair/incore_ext.c
repair/incore_ino.c
repair/phase6.c

index ae17c68d52829e65261bbeb677da969911cbce4f..fe991ccea19dd680a90a5cabd152a34b70f38d99 100644 (file)
@@ -116,8 +116,6 @@ AC_HAVE_READDIR
 
 AC_CHECK_SIZEOF([long])
 AC_CHECK_SIZEOF([char *])
-AC_TYPE_PSINT
-AC_TYPE_PSUNSIGNED
 AC_TYPE_U32
 AC_TYPE_UMODE_T
 AC_MANUAL_FORMAT
index e604ccac379d39de6d48f9d00e85d78ebbfd8e9c..b85ed6a8e40b5aa16f8b5ceb82e1517ac7992297 100644 (file)
--- a/db/bit.c
+++ b/db/bit.c
@@ -79,24 +79,24 @@ getbitval(
        p = (char *)obj + byteize(bitoff);
        bit = bitoffs(bitoff);
        signext = (flags & BVSIGNED) != 0;
-       z4 = ((__psint_t)p & 0xf) == 0 && bit == 0;
+       z4 = ((intptr_t)p & 0xf) == 0 && bit == 0;
        if (nbits == 64 && z4)
                return be64_to_cpu(*(__be64 *)p);
-       z3 = ((__psint_t)p & 0x7) == 0 && bit == 0;
+       z3 = ((intptr_t)p & 0x7) == 0 && bit == 0;
        if (nbits == 32 && z3) {
                if (signext)
                        return (__s32)be32_to_cpu(*(__be32 *)p);
                else
                        return (__u32)be32_to_cpu(*(__be32 *)p);
        }
-       z2 = ((__psint_t)p & 0x3) == 0 && bit == 0;
+       z2 = ((intptr_t)p & 0x3) == 0 && bit == 0;
        if (nbits == 16 && z2) {
                if (signext)
                        return (__s16)be16_to_cpu(*(__be16 *)p);
                else
                        return (__u16)be16_to_cpu(*(__be16 *)p);
        }
-       z1 = ((__psint_t)p & 0x1) == 0 && bit == 0;
+       z1 = ((intptr_t)p & 0x1) == 0 && bit == 0;
        if (nbits == 8 && z1) {
                if (signext)
                        return *(__s8 *)p;
index ce98360f43eb1e5c683e560c51c9b6fe38390965..31930fbc7a1597f837109b8ee7509193c075fb0f 100644 (file)
@@ -3436,8 +3436,8 @@ process_sf_dir_v2(
        sfe = xfs_dir2_sf_firstentry(sf);
        offset = M_DIROPS(mp)->data_first_offset;
        for (i = sf->count - 1, i8 = 0; i >= 0; i--) {
-               if ((__psint_t)sfe + M_DIROPS(mp)->sf_entsize(sf, sfe->namelen) -
-                   (__psint_t)sf > be64_to_cpu(dip->di_size)) {
+               if ((intptr_t)sfe + M_DIROPS(mp)->sf_entsize(sf, sfe->namelen) -
+                   (intptr_t)sf > be64_to_cpu(dip->di_size)) {
                        if (!sflag)
                                dbprintf(_("dir %llu bad size in entry at %d\n"),
                                        id->ino,
@@ -3478,7 +3478,7 @@ process_sf_dir_v2(
                        M_DIROPS(mp)->sf_entsize(sf, sfe->namelen);
                sfe = M_DIROPS(mp)->sf_nextentry(sf, sfe);
        }
-       if (i < 0 && (__psint_t)sfe - (__psint_t)sf != 
+       if (i < 0 && (intptr_t)sfe - (intptr_t)sf != 
                                        be64_to_cpu(dip->di_size)) {
                if (!sflag)
                        dbprintf(_("dir %llu size is %lld, should be %u\n"),
index 50a53d145b23d6030424523e08ed7f1dfae5cadc..2c65817855837033a92ad508d8b2d697dd355d47 100644 (file)
@@ -369,10 +369,10 @@ bitoffset(
                        abase = (f->flags & FLD_ABASE1) != 0;
                        ASSERT(fa->ftyp == f->ftyp);
                        ASSERT((fa->arg & FTARG_SIZE) == 0);
-                       return (int)(__psint_t)f->offset +
+                       return (int)(intptr_t)f->offset +
                                (idx - abase) * fsize(f, obj, startoff, idx);
                } else
-                       return (int)(__psint_t)f->offset;
+                       return (int)(intptr_t)f->offset;
        } else
                return (*f->offset)(obj, startoff, idx);
 }
@@ -384,7 +384,7 @@ fcount(
        int             startoff)
 {
        if (!(f->flags & FLD_COUNT))
-               return (int)(__psint_t)f->count;
+               return (int)(intptr_t)f->count;
        else
                return (*f->count)(obj, startoff);
 }
@@ -417,7 +417,7 @@ fsize(
        fa = &ftattrtab[f->ftyp];
        ASSERT(fa->ftyp == f->ftyp);
        if (!(fa->arg & FTARG_SIZE))
-               return (int)(__psint_t)fa->size;
+               return (int)(intptr_t)fa->size;
        else
                return (*fa->size)(obj, startoff, idx);
 }
index 6343c9ae5a529d4bba76ba90244654d150556e0a..1617be4cf689c4412ee34e76c3b6d9d6d96f4ef7 100644 (file)
@@ -181,10 +181,10 @@ typedef enum fldt {
 } fldt_t;
 
 typedef int (*offset_fnc_t)(void *obj, int startoff, int idx);
-#define        OI(o)   ((offset_fnc_t)(__psint_t)(o))
+#define        OI(o)   ((offset_fnc_t)(intptr_t)(o))
 
 typedef int (*count_fnc_t)(void *obj, int startoff);
-#define        CI(c)   ((count_fnc_t)(__psint_t)(c))
+#define        CI(c)   ((count_fnc_t)(intptr_t)(c))
 #define        C1      CI(1)
 
 typedef struct field
@@ -207,7 +207,7 @@ typedef struct field
 #define        FLD_COUNT       16      /* count value is a function pointer */
 
 typedef int (*size_fnc_t)(void *obj, int startoff, int idx);
-#define        SI(s)   ((size_fnc_t)(__psint_t)(s))
+#define        SI(s)   ((size_fnc_t)(intptr_t)(s))
 
 typedef struct ftattr
 {
index 05a726ac050f71963605e2d8e5dffd70a83bf43c..9a1782cde2657df01a653e1c127c72e7a52618be 100644 (file)
@@ -87,42 +87,6 @@ typedef struct filldir               filldir_t;
 #undef SIZEOF_CHAR_P
 #define BITS_PER_LONG (SIZEOF_LONG * CHAR_BIT)
 
-/* Check if __psint_t is set to something meaningful */
-#undef HAVE___PSINT_T
-#ifndef HAVE___PSINT_T
-# if (SIZEOF_CHAR_P * CHAR_BIT) == 32
-typedef int __psint_t;
-# elif (SIZEOF_CHAR_P * CHAR_BIT) == 64
-#  if BITS_PER_LONG == 64
-typedef long __psint_t;
-#  else
-/* This is a very strange architecture, which has 64 bit pointers but */
-/* not 64 bit longs.  So, just punt here and assume long long is OK.  */
-typedef long long __psint_t;
-#  endif
-# else
-#  error Unknown pointer size
-# endif
-#endif
-
-/* Check if __psunsigned_t is set to something meaningful */
-#undef HAVE___PSUNSIGNED_T
-#ifndef HAVE___PSUNSIGNED_T
-# if (SIZEOF_CHAR_P * CHAR_BIT) == 32
-typedef unsigned int __psunsigned_t;
-# elif (SIZEOF_CHAR_P * CHAR_BIT) == 64
-#  if BITS_PER_LONG == 64
-typedef long __psunsigned_t;
-#  else
-/* This is a very strange architecture, which has 64 bit pointers but */
-/* not 64 bit longs.  So, just punt here and assume long long is OK.  */
-typedef unsigned long long __psunsigned_t;
-#  endif
-# else
-#  error Unknown pointer size
-# endif
-#endif
-
 /* Check whether to define umode_t ourselves. */
 #ifndef HAVE_UMODE_T
 typedef unsigned short umode_t;
index 269dafebf6d1621427ac90a1981ae6dd0ab37afb..91ef07087ff93a21809d8e57283d6bf1b4c24f04 100644 (file)
@@ -929,7 +929,7 @@ xlog_print_record(
        }
     } else {
        read_len -= *read_type;
-       buf = (xfs_caddr_t)((__psint_t)(*partial_buf) + (__psint_t)(*read_type));
+       buf = (xfs_caddr_t)((intptr_t)(*partial_buf) + (intptr_t)(*read_type));
        ptr = *partial_buf;
     }
     if ((ret = (int) read(fd, buf, read_len)) == -1) {
index 454c84a3f52975edbc5362f8c982f8be8ca26d24..c3645bc7dd653d15ecd2df356d8f14f64206a9f6 100644 (file)
@@ -1,31 +1,3 @@
-# 
-# Check if we have a type for the pointer's size integer (__psint_t)
-# 
-AC_DEFUN([AC_TYPE_PSINT],
-  [ AC_MSG_CHECKING([for __psint_t ])
-    AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <stdlib.h>
-#include <stddef.h>
-    ], [
-         __psint_t  psint;
-    ], AC_DEFINE(HAVE___PSINT_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
-  ])
-
-# 
-# Check if we have a type for the pointer's size unsigned (__psunsigned_t)
-# 
-AC_DEFUN([AC_TYPE_PSUNSIGNED],
-  [ AC_MSG_CHECKING([for __psunsigned_t ])
-    AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <stdlib.h>
-#include <stddef.h>
-    ], [
-        __psunsigned_t  psuint;
-    ], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
-  ])
-
 # 
 # Check if we have a type for __u32
 # 
index 0989597b324d499fee5fc1bd422a43fbe7f18465..a216afa9bff515e58c6a5575f679bc5d2f08cc05 100644 (file)
@@ -305,7 +305,7 @@ secondary_sb_wack(
                         * be set, and the latter is never updated past
                         * the last field - just zap them both.
                         */
-                       memset((void *)((__psint_t)sb + size), 0,
+                       memset((void *)((intptr_t)sb + size), 0,
                                mp->m_sb.sb_sectsize - size);
                        memset(XFS_BUF_PTR(sbuf) + size, 0,
                                mp->m_sb.sb_sectsize - size);
index 3e441639bce37c53efdc7ae0027d58b900cc1271..f9afce72ced1054228109c619e0c2a42eb7c4139 100644 (file)
@@ -931,7 +931,7 @@ process_shortform_attr(
        _("removing attribute entry %d for inode %" PRIu64 "\n"),
                                        i, ino);
                                tempentry = (xfs_attr_sf_entry_t *)
-                                       ((__psint_t) currententry +
+                                       ((intptr_t) currententry +
                                         XFS_ATTR_SF_ENTSIZE(currententry));
                                memmove(currententry,tempentry,remainingspace);
                                asf->hdr.count -= 1;
@@ -946,7 +946,7 @@ process_shortform_attr(
                }
 
                /* Let's get ready for the next entry... */
-               nextentry = (xfs_attr_sf_entry_t *)((__psint_t) nextentry +
+               nextentry = (xfs_attr_sf_entry_t *)((intptr_t) nextentry +
                                        XFS_ATTR_SF_ENTSIZE(currententry));
                currentsize = currentsize + XFS_ATTR_SF_ENTSIZE(currententry);
 
@@ -1220,7 +1220,7 @@ process_leaf_attr_block(
                }
 
                /* mark the entry used */
-               start = (__psint_t)entry - (__psint_t)leaf;
+               start = (intptr_t)entry - (intptr_t)leaf;
                stop = start + sizeof(xfs_attr_leaf_entry_t);
                if (set_da_freemap(mp, attr_freemap, start, stop))  {
                        do_warn(
index 697e540712eed89299ef9fd872ff86046877b161..83e308702e3f69f4fb5d20488c617e72417144dc 100644 (file)
@@ -69,8 +69,8 @@ avl_checktree(
        avlnode_t *root)
 {
        avlnode_t *nlast, *nnext, *np;
-       __psunsigned_t offset = 0;
-       __psunsigned_t end;
+       uintptr_t offset = 0;
+       uintptr_t end;
 
        nlast = nnext = root;
 
@@ -589,8 +589,8 @@ attach:
 avlnode_t *
 avl_findanyrange(
        avltree_desc_t *tree,
-       __psunsigned_t start,
-       __psunsigned_t end,
+       uintptr_t start,
+       uintptr_t end,
        int     checklen)
 {
        avlnode_t *np = tree->avl_root;
@@ -660,10 +660,10 @@ avl_findanyrange(
 avlnode_t *
 avl_find(
        avltree_desc_t *tree,
-       __psunsigned_t value)
+       uintptr_t value)
 {
        avlnode_t *np = tree->avl_root;
-       __psunsigned_t nvalue;
+       uintptr_t nvalue;
 
        while (np) {
                nvalue = AVL_START(tree, np);
@@ -887,8 +887,8 @@ static
 avlnode_t *
 avl_insert_find_growth(
                avltree_desc_t *tree,
-               __psunsigned_t start,   /* range start at start, */
-               __psunsigned_t end,     /* exclusive */
+               uintptr_t start,        /* range start at start, */
+               uintptr_t end,  /* exclusive */
                int   *growthp) /* OUT */
 {
        avlnode_t *root = tree->avl_root;
@@ -941,7 +941,7 @@ avl_insert_grow(
        int growth)
 {
        avlnode_t *nnext;
-       __psunsigned_t start = AVL_START(tree, newnode);
+       uintptr_t start = AVL_START(tree, newnode);
 
        if (growth == AVL_BACK) {
 
@@ -983,8 +983,8 @@ avl_insert(
        avlnode_t *newnode)
 {
        avlnode_t *np;
-       __psunsigned_t start = AVL_START(tree, newnode);
-       __psunsigned_t end = AVL_END(tree, newnode);
+       uintptr_t start = AVL_START(tree, newnode);
+       uintptr_t end = AVL_END(tree, newnode);
        int growth;
 
        ASSERT(newnode);
@@ -1138,16 +1138,16 @@ avlops_t avl_debug_ops = {
        avl_debug_end,
 }
 
-static __psunsigned_t
+static uintptr_t
 avl_debug_start(avlnode_t *node)
 {
-       return (__psunsigned_t)(struct avl_debug_node *)node->avl_start;
+       return (uintptr_t)(struct avl_debug_node *)node->avl_start;
 }
 
-static __psunsigned_t
+static uintptr_t
 avl_debug_end(avlnode_t *node)
 {
-       return (__psunsigned_t)
+       return (uintptr_t)
                ((struct avl_debug_node *)node->avl_start +
                 (struct avl_debug_node *)node->avl_size);
 }
@@ -1283,7 +1283,7 @@ main()
 avlnode_t *
 avl_findadjacent(
        avltree_desc_t *tree,
-       __psunsigned_t value,
+       uintptr_t value,
        int             dir)
 {
        avlnode_t *np = tree->avl_root;
@@ -1357,8 +1357,8 @@ avl_findadjacent(
 void
 avl_findranges(
        avltree_desc_t *tree,
-       __psunsigned_t start,
-       __psunsigned_t end,
+       uintptr_t start,
+       uintptr_t end,
        avlnode_t               **startp,
        avlnode_t               **endp)
 {
index 0078a95ad7304b6deac6a4ca6bf09ef7058e5afa..7e59b23f67bf7fa3695f3b27dc543b76d0adf9a9 100644 (file)
@@ -31,8 +31,8 @@ typedef struct        avlnode {
  * avl-tree operations
  */
 typedef struct avlops {
-       __psunsigned_t  (*avl_start)(avlnode_t *);
-       __psunsigned_t  (*avl_end)(avlnode_t *);
+       uintptr_t       (*avl_start)(avlnode_t *);
+       uintptr_t       (*avl_end)(avlnode_t *);
 } avlops_t;
 
 #define        AVL_START(tree, n)      (*(tree)->avl_ops->avl_start)(n)
@@ -87,7 +87,7 @@ avl_init_tree(
 static inline avlnode_t *
 avl_findrange(
        avltree_desc_t *tree,
-       __psunsigned_t value)
+       uintptr_t value)
 {
        avlnode_t *np = tree->avl_root;
 
@@ -110,27 +110,27 @@ avl_findrange(
 avlnode_t *
 avl_find(
        avltree_desc_t *tree,
-       __psunsigned_t value);
+       uintptr_t value);
 
 avlnode_t *
 avl_findanyrange(
        avltree_desc_t *tree,
-       __psunsigned_t start,
-       __psunsigned_t end,
+       uintptr_t start,
+       uintptr_t end,
        int     checklen);
 
 
 avlnode_t *
 avl_findadjacent(
        avltree_desc_t *tree,
-       __psunsigned_t value,
+       uintptr_t value,
        int             dir);
 
 void
 avl_findranges(
        avltree_desc_t *tree,
-       __psunsigned_t start,
-       __psunsigned_t end,
+       uintptr_t start,
+       uintptr_t end,
        avlnode_t               **startp,
        avlnode_t               **endp);
 
index 3c4d9bd9e25c0fcbaea2d4dfb0de1af8bdb27d60..c89f478f42f8b84b7a2157b242a0f4066684c110 100644 (file)
@@ -669,7 +669,7 @@ process_sf_dir2_fixi8(
        int                     oldsize;
 
        newsfp = sfp;
-       oldsize = (__psint_t)*next_sfep - (__psint_t)sfp;
+       oldsize = (intptr_t)*next_sfep - (intptr_t)sfp;
        oldsfp = malloc(oldsize);
        if (oldsfp == NULL) {
                do_error(_("couldn't malloc dir2 shortform copy\n"));
@@ -874,7 +874,7 @@ _("entry \"%*.*s\" in shortform directory %" PRIu64 " references %s inode %" PRI
                if (namelen == 0) {
                        junkreason = _("is zero length");
                        bad_sfnamelen = 1;
-               } else if ((__psint_t) sfep - (__psint_t) sfp +
+               } else if ((intptr_t) sfep - (intptr_t) sfp +
                                M_DIROPS(mp)->sf_entsize(sfp, sfep->namelen)
                                                        > ino_dir_size)  {
                        junkreason = _("extends past end of dir");
@@ -944,15 +944,15 @@ _("entry contains offset out of order in shortform dir %" PRIu64 "\n"),
                                ino_dir_size -= tmp_elen;
 
                                tmp_sfep = (xfs_dir2_sf_entry_t *)
-                                       ((__psint_t) sfep + tmp_elen);
-                               tmp_len = max_size - ((__psint_t) tmp_sfep
-                                                       - (__psint_t) sfp);
+                                       ((intptr_t) sfep + tmp_elen);
+                               tmp_len = max_size - ((intptr_t) tmp_sfep
+                                                       - (intptr_t) sfp);
 
                                memmove(sfep, tmp_sfep, tmp_len);
 
                                sfp->count -= 1;
                                num_entries--;
-                               memset((void *) ((__psint_t) sfep + tmp_len), 0,
+                               memset((void *) ((intptr_t) sfep + tmp_len), 0,
                                        tmp_elen);
 
                                /*
@@ -990,7 +990,7 @@ _("would have junked entry \"%s\" in directory inode %" PRIu64 "\n"),
                 * calculate size based on next_sfep.
                 */
                next_sfep = (tmp_sfep == NULL)
-                       ? (xfs_dir2_sf_entry_t *) ((__psint_t) sfep
+                       ? (xfs_dir2_sf_entry_t *) ((intptr_t) sfep
                                                        + ((!bad_sfnamelen)
                                ? M_DIROPS(mp)->sf_entsize(sfp, sfep->namelen)
                                : M_DIROPS(mp)->sf_entsize(sfp, namelen)))
@@ -1045,7 +1045,7 @@ _("corrected directory %" PRIu64 " size, was %" PRId64 ", now %" PRIdPTR "\n"),
                                (intptr_t)next_sfep - (intptr_t)sfp);
 
                        dip->di_size = cpu_to_be64(
-                                       (__psint_t)next_sfep - (__psint_t)sfp);
+                                       (intptr_t)next_sfep - (intptr_t)sfp);
                        *dino_dirty = 1;
                        *repair = 1;
                }
index 843e69d99271b18eb915c2467eaa2ce64008cc86..c15e57de9e7592e559eaeb063826349dc1935c27 100644 (file)
@@ -498,17 +498,17 @@ get_bcnt_extent(xfs_agnumber_t agno, xfs_agblock_t startblock,
        return(ext);
 }
 
-static __psunsigned_t
+static uintptr_t
 avl_ext_start(avlnode_t *node)
 {
-       return((__psunsigned_t)
+       return((uintptr_t)
                ((extent_tree_node_t *) node)->ex_startblock);
 }
 
-static __psunsigned_t
+static uintptr_t
 avl_ext_end(avlnode_t *node)
 {
-       return((__psunsigned_t) (
+       return((uintptr_t) (
                ((extent_tree_node_t *) node)->ex_startblock +
                ((extent_tree_node_t *) node)->ex_blockcount));
 }
@@ -517,24 +517,24 @@ avl_ext_end(avlnode_t *node)
  * convert size to an address for the AVL tree code -- the bigger the size,
  * the lower the address so the biggest extent will be first in the tree
  */
-static __psunsigned_t
+static uintptr_t
 avl_ext_bcnt_start(avlnode_t *node)
 {
 /*
-       return((__psunsigned_t) (BCNT_ADDR(((extent_tree_node_t *)
+       return((uintptr_t) (BCNT_ADDR(((extent_tree_node_t *)
                                                node)->ex_blockcount)));
 */
-       return((__psunsigned_t) ((extent_tree_node_t *)node)->ex_blockcount);
+       return((uintptr_t) ((extent_tree_node_t *)node)->ex_blockcount);
 }
 
-static __psunsigned_t
+static uintptr_t
 avl_ext_bcnt_end(avlnode_t *node)
 {
 /*
-       return((__psunsigned_t) (BCNT_ADDR(((extent_tree_node_t *)
+       return((uintptr_t) (BCNT_ADDR(((extent_tree_node_t *)
                                                node)->ex_blockcount)));
 */
-       return((__psunsigned_t) ((extent_tree_node_t *)node)->ex_blockcount);
+       return((uintptr_t) ((extent_tree_node_t *)node)->ex_blockcount);
 }
 
 avlops_t avl_extent_bcnt_tree_ops = {
index 0f3deebd7b4a3358db749f27944cc86fa78310a3..2a2aadac4b8bbf4d4faad78e2c5fbefca9ddc083 100644 (file)
@@ -771,16 +771,16 @@ add_ino_ex_data(xfs_mount_t *mp)
        full_ino_ex_data = 1;
 }
 
-static __psunsigned_t
+static uintptr_t
 avl_ino_start(avlnode_t *node)
 {
-       return((__psunsigned_t) ((ino_tree_node_t *) node)->ino_startnum);
+       return((uintptr_t) ((ino_tree_node_t *) node)->ino_startnum);
 }
 
-static __psunsigned_t
+static uintptr_t
 avl_ino_end(avlnode_t *node)
 {
-       return((__psunsigned_t) (
+       return((uintptr_t) (
                ((ino_tree_node_t *) node)->ino_startnum +
                XFS_INODES_PER_CHUNK));
 }
index 1f82c3d09b15b37655cb1abcb9caa654fa2b1325..9a5cba7fc22ef139ae877af52dd94029f747322c 100644 (file)
@@ -649,7 +649,7 @@ _("can't access block %" PRIu64 " (fsbno %" PRIu64 ") of realtime bitmap inode %
 
                libxfs_trans_log_buf(tp, bp, 0, mp->m_sb.sb_blocksize - 1);
 
-               bmp = (xfs_rtword_t *)((__psint_t) bmp + mp->m_sb.sb_blocksize);
+               bmp = (xfs_rtword_t *)((intptr_t) bmp + mp->m_sb.sb_blocksize);
                bno++;
        }
 
@@ -721,7 +721,7 @@ _("can't access block %" PRIu64 " (fsbno %" PRIu64 ") of realtime summary inode
 
                libxfs_trans_log_buf(tp, bp, 0, mp->m_sb.sb_blocksize - 1);
 
-               smp = (xfs_suminfo_t *)((__psint_t)smp + mp->m_sb.sb_blocksize);
+               smp = (xfs_suminfo_t *)((intptr_t)smp + mp->m_sb.sb_blocksize);
                bno++;
        }
 
@@ -2461,12 +2461,12 @@ shortform_dir2_junk(
         * now move all the remaining entries down over the junked entry and
         * clear the newly unused bytes at the tail of the directory region.
         */
-       next_len = *max_size - ((__psint_t)next_sfep - (__psint_t)sfp);
+       next_len = *max_size - ((intptr_t)next_sfep - (intptr_t)sfp);
        *max_size -= next_elen;
        *bytes_deleted += next_elen;
 
        memmove(sfep, next_sfep, next_len);
-       memset((void *)((__psint_t)sfep + next_len), 0, next_elen);
+       memset((void *)((intptr_t)sfep + next_len), 0, next_elen);
        sfp->count -= 1;
        *ino_dirty = 1;
 
@@ -2556,7 +2556,7 @@ shortform_dir2_entry_check(xfs_mount_t    *mp,
        sfep = next_sfep = xfs_dir2_sf_firstentry(sfp);
 
        for (i = 0; i < sfp->count && max_size >
-                                       (__psint_t)next_sfep - (__psint_t)sfp;
+                                       (intptr_t)next_sfep - (intptr_t)sfp;
                        sfep = next_sfep, i++)  {
                bad_sfnamelen = 0;
 
@@ -2579,8 +2579,8 @@ shortform_dir2_entry_check(xfs_mount_t    *mp,
 
                        if (i == sfp->count - 1)  {
                                namelen = ip->i_d.di_size -
-                                       ((__psint_t) &sfep->name[0] -
-                                        (__psint_t) sfp);
+                                       ((intptr_t) &sfep->name[0] -
+                                        (intptr_t) sfp);
                        } else  {
                                /*
                                 * don't process the rest of the directory,
@@ -2588,15 +2588,15 @@ shortform_dir2_entry_check(xfs_mount_t  *mp,
                                 */
                                break;
                        }
-               } else if (no_modify && (__psint_t) sfep - (__psint_t) sfp +
+               } else if (no_modify && (intptr_t) sfep - (intptr_t) sfp +
                                + M_DIROPS(mp)->sf_entsize(sfp, sfep->namelen)
                                > ip->i_d.di_size)  {
                        bad_sfnamelen = 1;
 
                        if (i == sfp->count - 1)  {
                                namelen = ip->i_d.di_size -
-                                       ((__psint_t) &sfep->name[0] -
-                                        (__psint_t) sfp);
+                                       ((intptr_t) &sfep->name[0] -
+                                        (intptr_t) sfp);
                        } else  {
                                /*
                                 * don't process the rest of the directory,
@@ -2778,7 +2778,7 @@ _("entry \"%s\" (ino %" PRIu64 ") in dir %" PRIu64 " is a duplicate name"),
                 * on next_sfep.
                 */
                ASSERT(no_modify || bad_sfnamelen == 0);
-               next_sfep = (struct xfs_dir2_sf_entry *)((__psint_t)sfep +
+               next_sfep = (struct xfs_dir2_sf_entry *)((intptr_t)sfep +
                              (bad_sfnamelen
                                ? M_DIROPS(mp)->sf_entsize(sfp, namelen)
                                : M_DIROPS(mp)->sf_entsize(sfp, sfep->namelen)));
@@ -2795,8 +2795,8 @@ _("entry \"%s\" (ino %" PRIu64 ") in dir %" PRIu64 " is a duplicate name"),
                                tmp_sfep = next_sfep;
                                process_sf_dir2_fixi8(mp, sfp, &tmp_sfep);
                                bytes_deleted +=
-                                       (__psint_t)next_sfep -
-                                       (__psint_t)tmp_sfep;
+                                       (intptr_t)next_sfep -
+                                       (intptr_t)tmp_sfep;
                                next_sfep = tmp_sfep;
                        } else
                                sfp->i8count = i8;
@@ -2817,9 +2817,9 @@ _("entry \"%s\" (ino %" PRIu64 ") in dir %" PRIu64 " is a duplicate name"),
 
        if (ip->i_d.di_size != ip->i_df.if_bytes)  {
                ASSERT(ip->i_df.if_bytes == (xfs_fsize_t)
-                               ((__psint_t) next_sfep - (__psint_t) sfp));
+                               ((intptr_t) next_sfep - (intptr_t) sfp));
                ip->i_d.di_size = (xfs_fsize_t)
-                               ((__psint_t) next_sfep - (__psint_t) sfp);
+                               ((intptr_t) next_sfep - (intptr_t) sfp);
                do_warn(
        _("setting size to %" PRId64 " bytes to reflect junked entries\n"),
                        ip->i_d.di_size);