diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-05-30 14:04:06 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-30 14:04:06 +0900 |
commit | bef896e4ab414312cdca493e0306d66ec7246b01 (patch) | |
tree | 6494188715d2f48259acf6cf9d5953acb406ae0f | |
parent | 0abb9628932717f535f27d4652c07455389db5f3 (diff) | |
parent | c112084af965ade0836b7c226c68ecd8b536fc0a (diff) | |
download | git-bef896e4ab414312cdca493e0306d66ec7246b01.tar.gz |
Merge branch 'rs/no-null-ptr-arith-in-fast-export'
Code clean-up to avoid non-standard-conformant pointer arithmetic.
* rs/no-null-ptr-arith-in-fast-export:
fast-export: avoid NULL pointer arithmetic
-rw-r--r-- | builtin/fast-export.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin/fast-export.c b/builtin/fast-export.c index 68a762fbea..07d20f446f 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -156,15 +156,14 @@ static void anonymize_path(struct strbuf *out, const char *path, } } -/* Since intptr_t is C99, we do not use it here */ -static inline uint32_t *mark_to_ptr(uint32_t mark) +static inline void *mark_to_ptr(uint32_t mark) { - return ((uint32_t *)NULL) + mark; + return (void *)(uintptr_t)mark; } static inline uint32_t ptr_to_mark(void * mark) { - return (uint32_t *)mark - (uint32_t *)NULL; + return (uint32_t)(uintptr_t)mark; } static inline void mark_object(struct object *object, uint32_t mark) |