From 7d4ae7fa235301031590a774802fc343e3e42856 Mon Sep 17 00:00:00 2001 From: tangl163 Date: Sat, 1 Aug 2020 11:56:16 +0800 Subject: Drop the unneeded pointer casting The standard says that "A pointer to void may be converted to or from a pointer to any object type". So the casting is unneeded. REF: * c11: http://port70.net/~nsz/c/c11/n1570.html#6.3.2.3p1 * c99: http://port70.net/~nsz/c/c99/n1256.html Closes GH-5916 --- Zend/zend_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zend/zend_alloc.c') diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 753a8b830d..2236cf0dbb 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -1236,7 +1236,7 @@ static zend_never_inline void *zend_mm_alloc_small_slow(zend_mm_heap *heap, uint #endif /* return first element */ - return (char*)bin; + return bin; } static zend_always_inline void *zend_mm_alloc_small(zend_mm_heap *heap, int bin_num ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) @@ -1253,7 +1253,7 @@ static zend_always_inline void *zend_mm_alloc_small(zend_mm_heap *heap, int bin_ if (EXPECTED(heap->free_slot[bin_num] != NULL)) { zend_mm_free_slot *p = heap->free_slot[bin_num]; heap->free_slot[bin_num] = p->next_free_slot; - return (void*)p; + return p; } else { return zend_mm_alloc_small_slow(heap, bin_num ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); } -- cgit v1.2.1