From 3b841b78f00acbd8bef95d8ebcd0fefe9a0f0bfa Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 16 Feb 2024 15:58:45 +0100 Subject: [PATCH] Fix [-Wincompatible-pointer-types] --- crypto_stream.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crypto_stream.c b/crypto_stream.c index 4e0758c..f208b34 100644 --- a/crypto_stream.c +++ b/crypto_stream.c @@ -133,13 +133,21 @@ typedef struct { } php_crypto_stream_data; /* {{{ php_crypto_stream_write */ +#if PHP_VERSION_ID < 70400 static size_t php_crypto_stream_write(php_stream *stream, +#else +static ssize_t php_crypto_stream_write(php_stream *stream, +#endif const char *buf, size_t count TSRMLS_DC) { php_crypto_stream_data *data = (php_crypto_stream_data *) stream->abstract; int bytes_written = BIO_write(data->bio, buf, count > INT_MAX ? INT_MAX : count); +#if PHP_VERSION_ID < 70400 return bytes_written <= 0 ? 0 : (size_t) bytes_written; +#else + return bytes_written; +#endif } /* }}} */ @@ -256,7 +264,11 @@ static void php_crypto_stream_auth_save_result(php_stream *stream, int ok) /* }}} */ /* {{{ php_crypto_stream_read */ +#if PHP_VERSION_ID < 70400 static size_t php_crypto_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) +#else +static ssize_t php_crypto_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) +#endif { php_crypto_stream_data *data = (php_crypto_stream_data *) stream->abstract; int bytes_read = BIO_read(data->bio, buf, count > INT_MAX ? INT_MAX : count); -- 2.43.0