Skip to content

Commit 7d4ae7f

Browse files
tangl163Girgias
authored andcommitted
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
1 parent 90434d7 commit 7d4ae7f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Zend/zend_alloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ static zend_never_inline void *zend_mm_alloc_small_slow(zend_mm_heap *heap, uint
12361236
#endif
12371237

12381238
/* return first element */
1239-
return (char*)bin;
1239+
return bin;
12401240
}
12411241

12421242
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_
12531253
if (EXPECTED(heap->free_slot[bin_num] != NULL)) {
12541254
zend_mm_free_slot *p = heap->free_slot[bin_num];
12551255
heap->free_slot[bin_num] = p->next_free_slot;
1256-
return (void*)p;
1256+
return p;
12571257
} else {
12581258
return zend_mm_alloc_small_slow(heap, bin_num ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
12591259
}

0 commit comments

Comments
 (0)