Skip to content

Commit ff03f42

Browse files
get rid of uptrval
1 parent 4b1771a commit ff03f42

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

contrib/linux-kernel/mem.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ typedef uint32_t U32;
3838
typedef int32_t S32;
3939
typedef uint64_t U64;
4040
typedef int64_t S64;
41-
typedef uintptr_t uptrval;
4241

4342
/*-**************************************************************
4443
* Memory I/O API

lib/common/mem.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ extern "C" {
5959
typedef int32_t S32;
6060
typedef uint64_t U64;
6161
typedef int64_t S64;
62-
typedef uintptr_t uptrval;
6362
#else
6463
# include <limits.h>
6564
#if CHAR_BIT != 8
@@ -82,7 +81,6 @@ extern "C" {
8281
* limits exist in C99, however, in such case, <stdint.h> is preferred */
8382
typedef unsigned long long U64;
8483
typedef signed long long S64;
85-
typedef size_t uptrval; /* generally true, except OpenVMS-64 */
8684
#endif
8785

8886

lib/decompress/zstd_decompress_block.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,9 +2124,8 @@ ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx,
21242124
ip += seqHSize;
21252125
srcSize -= seqHSize;
21262126

2127-
RETURN_ERROR_IF(dst == NULL && nbSeq > 0, dstSize_tooSmall, "NULL not handled");
2128-
RETURN_ERROR_IF(dstCapacity == 0 && nbSeq > 0, dstSize_tooSmall, "dstCapacity == 0, but nbSeq is non-zero");
2129-
RETURN_ERROR_IF(MEM_64bits() && (uptrval)dst + dstCapacity > (uptrval)-1 - (1 << 20), dstSize_tooSmall,
2127+
RETURN_ERROR_IF((dst == NULL) ^ (dstCapacity == 0), dstSize_tooSmall, "NULL not handled");
2128+
RETURN_ERROR_IF(MEM_64bits() && (const char*)(size_t)(-1) - (const char*)dst < (U64)(1 << 20), dstSize_tooSmall,
21302129
"invalid dst");
21312130

21322131
/* If we could potentially have long offsets, or we might want to use the prefetch decoder,

0 commit comments

Comments
 (0)