Skip to content

Commit 7945990

Browse files
committed
fix: add explicit pointer casts for C++ compatibility in async API
1 parent e27f9b6 commit 7945990

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Zend/zend_async_API.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -561,15 +561,15 @@ static zend_always_inline void
561561
zend_async_callbacks_push(zend_async_event_t *event, zend_async_event_callback_t *callback)
562562
{
563563
if (event->callbacks.data == NULL) {
564-
event->callbacks.data = safe_emalloc(4, sizeof(zend_async_event_callback_t *), 0);
564+
event->callbacks.data = (zend_async_event_callback_t **)safe_emalloc(4, sizeof(zend_async_event_callback_t *), 0);
565565
event->callbacks.capacity = 4;
566566
}
567567

568568
zend_async_callbacks_vector_t *vector = &event->callbacks;
569569

570570
if (vector->length == vector->capacity) {
571571
vector->capacity = vector->capacity ? vector->capacity * 2 : 4;
572-
vector->data = safe_erealloc(vector->data,
572+
vector->data = (zend_async_event_callback_t **)safe_erealloc(vector->data,
573573
vector->capacity,
574574
sizeof(zend_async_event_callback_t *),
575575
0);
@@ -770,13 +770,13 @@ zend_async_scope_add_child(zend_async_scope_t *parent_scope, zend_async_scope_t
770770
child_scope->parent_scope = parent_scope;
771771

772772
if (vector->data == NULL) {
773-
vector->data = safe_emalloc(4, sizeof(zend_async_scope_t *), 0);
773+
vector->data = (zend_async_scope_t **)safe_emalloc(4, sizeof(zend_async_scope_t *), 0);
774774
vector->capacity = 4;
775775
}
776776

777777
if (vector->length == vector->capacity) {
778778
vector->capacity *= 2;
779-
vector->data = safe_erealloc(vector->data, vector->capacity, sizeof(zend_async_scope_t *), 0);
779+
vector->data = (zend_async_scope_t **)safe_erealloc(vector->data, vector->capacity, sizeof(zend_async_scope_t *), 0);
780780
}
781781

782782
vector->data[vector->length++] = child_scope;

0 commit comments

Comments
 (0)