obstack: fix compiler warning
MS Visual C suggests that the construct condition ? (int) i : (ptrdiff_t) d is incorrect. Let's fix this by casting to ptrdiff_t also for the positive arm of the conditional. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Jun 19, 2019 at 14:05 UTC
96a0679441224e1a1d6f8afd6e25671ce577b92f
1 file changed
+1
-1
compat/obstack.h
+1
-1
@@ -496,7 +496,7 @@ __extension__ \
496
( (h)->temp.tempint = (char *) (obj) - (char *) (h)->chunk, \
497
((((h)->temp.tempint > 0 \
498
&& (h)->temp.tempint < (h)->chunk_limit - (char *) (h)->chunk)) \
499
- ? (int) ((h)->next_free = (h)->object_base \
499
+ ? (ptrdiff_t) ((h)->next_free = (h)->object_base \
500
= (h)->temp.tempint + (char *) (h)->chunk) \
501
: (((obstack_free) ((h), (h)->temp.tempint + (char *) (h)->chunk), 0), 0)))
502