diff options
author | brooks <brooks@FreeBSD.org> | 2016-01-29 01:22:12 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2016-01-29 01:22:12 +0000 |
commit | 694bb1bf14f15dfce8a60d007edab8fc551bb080 (patch) | |
tree | 8b0d71fb0de17fc86ce9b8de8cfc7e203a3a067c | |
parent | 078a106cb8ad7232701906c62a918ee510fb0303 (diff) | |
download | FreeBSD-src-694bb1bf14f15dfce8a60d007edab8fc551bb080.zip FreeBSD-src-694bb1bf14f15dfce8a60d007edab8fc551bb080.tar.gz |
Use intptr_t note ptrdiff_t when storing flags in the bottom bits of
pointers.
Obtained from: CheriBSD (e3a69027cc5a384431156d61c90d4304387a9b9d)
Sponsored by: DARPA, AFRL
-rw-r--r-- | lib/libc/db/hash/hash.h | 10 | ||||
-rw-r--r-- | lib/libc/db/hash/hash_buf.c | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/libc/db/hash/hash.h b/lib/libc/db/hash/hash.h index cd11a3a..663ecdd 100644 --- a/lib/libc/db/hash/hash.h +++ b/lib/libc/db/hash/hash.h @@ -138,11 +138,11 @@ typedef struct htab { /* Memory resident data structure */ #define ALL_SET ((u_int32_t)0xFFFFFFFF) #define ALL_CLEAR 0 -#define PTROF(X) ((BUFHEAD *)((ptrdiff_t)(X)&~0x3)) -#define ISMOD(X) ((u_int32_t)(ptrdiff_t)(X)&0x1) -#define DOMOD(X) ((X) = (char *)((ptrdiff_t)(X)|0x1)) -#define ISDISK(X) ((u_int32_t)(ptrdiff_t)(X)&0x2) -#define DODISK(X) ((X) = (char *)((ptrdiff_t)(X)|0x2)) +#define PTROF(X) ((BUFHEAD *)((intptr_t)(X)&~0x3)) +#define ISMOD(X) ((u_int32_t)(intptr_t)(X)&0x1) +#define DOMOD(X) ((X) = (char *)((intptr_t)(X)|0x1)) +#define ISDISK(X) ((u_int32_t)(intptr_t)(X)&0x2) +#define DODISK(X) ((X) = (char *)((intptr_t)(X)|0x2)) #define BITS_PER_MAP 32 diff --git a/lib/libc/db/hash/hash_buf.c b/lib/libc/db/hash/hash_buf.c index 4445fc5..e79e7b3 100644 --- a/lib/libc/db/hash/hash_buf.c +++ b/lib/libc/db/hash/hash_buf.c @@ -138,7 +138,7 @@ __get_buf(HTAB *hashp, u_int32_t addr, return (NULL); if (!prev_bp) segp[segment_ndx] = - (BUFHEAD *)((ptrdiff_t)bp | is_disk_mask); + (BUFHEAD *)((intptr_t)bp | is_disk_mask); } else { BUF_REMOVE(bp); MRU_INSERT(bp); |