diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2021-06-14 16:36:46 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2021-08-09 02:30:13 -0700 |
commit | dadc9f49c08c98910ccd208e6fea573304aa8ca2 (patch) | |
tree | 27cb3fdee84c1d93678067c8dd62216c63ed8398 | |
parent | 5c628c7074ae4a90a62165502afe5e7cb6a7eaa5 (diff) | |
download | grep-dadc9f49c08c98910ccd208e6fea573304aa8ca2.tar.gz |
grep: pointer-integer cast nit
* src/grep.c (ALIGN_TO): When converting pointers to unsigned
integers, convert to uintptr_t not size_t, as size_t in theory
might be too narrow.
-rw-r--r-- | src/grep.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -880,9 +880,9 @@ enum { INITIAL_BUFSIZE = 96 * 1024 }; /* Return VAL aligned to the next multiple of ALIGNMENT. VAL can be an integer or a pointer. Both args must be free of side effects. */ #define ALIGN_TO(val, alignment) \ - ((size_t) (val) % (alignment) == 0 \ + ((uintptr_t) (val) % (alignment) == 0 \ ? (val) \ - : (val) + ((alignment) - (size_t) (val) % (alignment))) + : (val) + ((alignment) - (uintptr_t) (val) % (alignment))) /* Add two numbers that count input bytes or lines, and report an error if the addition overflows. */ |