summaryrefslogtreecommitdiffstats
path: root/0001-Fix-Wincompatible-pointer-types.patch
blob: 2c2fa40ed12610346a29822ffabef9693d340c25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 3b841b78f00acbd8bef95d8ebcd0fefe9a0f0bfa Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
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