Skip to content

Commit e246a0d

Browse files
committed
Remove unneeded casts of php_poll_handle_object.handle_data
handle_data is void*, which auto-coerces to any pointer type in C.
1 parent 9a57d1a commit e246a0d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

ext/standard/io_poll.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static const char *php_io_poll_backend_type_to_name(php_poll_backend_type type)
222222

223223
static php_socket_t php_stream_poll_handle_get_fd(php_poll_handle_object *handle)
224224
{
225-
php_stream_poll_handle_data *data = (php_stream_poll_handle_data *) handle->handle_data;
225+
php_stream_poll_handle_data *data = handle->handle_data;
226226
php_socket_t fd;
227227

228228
if (!data || !data->stream) {
@@ -241,13 +241,13 @@ static php_socket_t php_stream_poll_handle_get_fd(php_poll_handle_object *handle
241241

242242
static int php_stream_poll_handle_is_valid(php_poll_handle_object *handle)
243243
{
244-
php_stream_poll_handle_data *data = (php_stream_poll_handle_data *) handle->handle_data;
244+
php_stream_poll_handle_data *data = handle->handle_data;
245245
return data && data->stream && !php_stream_eof(data->stream);
246246
}
247247

248248
static void php_stream_poll_handle_cleanup(php_poll_handle_object *handle)
249249
{
250-
php_stream_poll_handle_data *data = (php_stream_poll_handle_data *) handle->handle_data;
250+
php_stream_poll_handle_data *data = handle->handle_data;
251251
if (data) {
252252
if (data->res) {
253253
zend_list_delete(data->res);
@@ -508,7 +508,7 @@ PHP_METHOD(StreamPollHandle, getStream)
508508
ZEND_PARSE_PARAMETERS_NONE();
509509

510510
php_poll_handle_object *intern = PHP_POLL_HANDLE_OBJ_FROM_ZV(getThis());
511-
php_stream_poll_handle_data *data = (php_stream_poll_handle_data *) intern->handle_data;
511+
php_stream_poll_handle_data *data = intern->handle_data;
512512

513513
if (!data || !data->stream) {
514514
RETURN_NULL();

0 commit comments

Comments
 (0)