diff options
author | tangl163 <cnjsw001@gmail.com> | 2020-08-01 11:56:16 +0800 |
---|---|---|
committer | George Peter Banyard <girgias@php.net> | 2020-08-03 02:05:14 +0100 |
commit | 7d4ae7fa235301031590a774802fc343e3e42856 (patch) | |
tree | 8939d14668023d13019f57bee54ba6baffa75245 | |
parent | 90434d7fe3ac204b56b85cf8ca606e7dd8cf27ac (diff) | |
download | php-git-7d4ae7fa235301031590a774802fc343e3e42856.tar.gz |
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
-rw-r--r-- | Zend/zend_alloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); } |