summaryrefslogtreecommitdiffstats
path: root/smbclient-upstream.patch
blob: 57992876b0e89aa3e265ad5850a7e66ec8f57a46 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
From 9ff3c987291dba1e4904672a9ca22e9b38739384 Mon Sep 17 00:00:00 2001
From: Po-Chuan Hsieh <sunpoet@sunpoet.net>
Date: Wed, 6 Sep 2023 00:46:57 +0800
Subject: [PATCH] Fix build warning on i386

/wrkdirs/usr/ports/net/pecl-smbclient/work-php81/smbclient-1.1.1/smbclient.c:1205:52: warning: format specifies type 'long' but the argument has type 'zend_long' (aka 'int') [-Wformat]
                php_error(E_WARNING, "Negative byte count: %ld", count);
                                                           ~~~   ^~~~~
                                                           %d
/wrkdirs/usr/ports/net/pecl-smbclient/work-php81/smbclient-1.1.1/smbclient.c:1256:52: warning: format specifies type 'long' but the argument has type 'zend_long' (aka 'int') [-Wformat]
                php_error(E_WARNING, "Negative byte count: %ld", count);
                                                           ~~~   ^~~~~
                                                           %d
2 warnings generated.
---
 smbclient.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/smbclient.c b/smbclient.c
index ad1f3d8..8a24dab 100644
--- a/smbclient.c
+++ b/smbclient.c
@@ -1202,7 +1202,7 @@ PHP_FUNCTION(smbclient_read)
 		return;
 	}
 	if (count < 0) {
-		php_error(E_WARNING, "Negative byte count: %ld", count);
+		php_error(E_WARNING, "Negative byte count: " ZEND_LONG_FMT, count);
 		RETURN_FALSE;
 	}
 	STATE_FROM_ZSTATE;
@@ -1253,7 +1253,7 @@ PHP_FUNCTION(smbclient_write)
 		return;
 	}
 	if (count < 0) {
-		php_error(E_WARNING, "Negative byte count: %ld", count);
+		php_error(E_WARNING, "Negative byte count: " ZEND_LONG_FMT, count);
 		RETURN_FALSE;
 	}
 	if (count == 0 || count > str_len) {
From 43f9e8e3ee234e51390adbcc8f42ab0271930702 Mon Sep 17 00:00:00 2001
From: Po-Chuan Hsieh <sunpoet@sunpoet.net>
Date: Wed, 6 Sep 2023 00:45:40 +0800
Subject: [PATCH] Fix build with Clang 16 on i386

/wrkdirs/usr/ports/net/pecl-smbclient/work-php80/smbclient-1.1.1/smb_streams.c:328:2: error: incompatible function pointer types initializing 'int (*)(php_stream *, zend_off_t, int, zend_off_t *)' (aka 'int (*)(struct _php_stream *, int, int, int *)') with an expression of type 'int (php_stream *, off_t, int, off_t *)' (aka 'int (struct _php_stream *, long long, int, long long *)') [-Wincompatible-function-pointer-types]
        php_smb_ops_seek,
        ^~~~~~~~~~~~~~~~
1 error generated.
---
 smb_streams.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/smb_streams.c b/smb_streams.c
index 8b2a9ab..51a0a32 100644
--- a/smb_streams.c
+++ b/smb_streams.c
@@ -270,7 +270,7 @@ static int php_smb_ops_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_D
 	return 0;
 }
 
-static int php_smb_ops_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC)
+static int php_smb_ops_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC)
 {
 	STREAM_DATA_FROM_STREAM();