summaryrefslogtreecommitdiffstats
path: root/1.patch
blob: b2862e29b3be4e37626677b7576bfbca4003c132 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
From 9602d4c228eaed59d20de94e809ff3827f1e6602 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Mon, 25 Jan 2021 08:08:55 +0100
Subject: [PATCH 1/6] fix [-Wmisleading-indentation]

---
 gmagick_methods.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gmagick_methods.c b/gmagick_methods.c
index 39c48a4..d2b95a5 100644
--- a/gmagick_methods.c
+++ b/gmagick_methods.c
@@ -4546,7 +4546,7 @@ PHP_METHOD(gmagick, unsharpmaskimage)
 	if (php_gmagick_ensure_not_empty (intern->magick_wand) == 0)
 		return;
 
-		status = MagickUnsharpMaskImage(intern->magick_wand, radius, sigma, amount, threshold);
+	status = MagickUnsharpMaskImage(intern->magick_wand, radius, sigma, amount, threshold);
 
 	if (status == MagickFalse) {
 			GMAGICK_THROW_GMAGICK_EXCEPTION(intern->magick_wand, "Unable to unsharp mask image");		

From feb41650a583f3fa625e4e69493209b10d69f45b Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Mon, 25 Jan 2021 08:11:45 +0100
Subject: [PATCH 2/6] fix [-Wformat=]

---
 gmagickpixel_methods.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gmagickpixel_methods.c b/gmagickpixel_methods.c
index 88d8fb2..121a8fb 100644
--- a/gmagickpixel_methods.c
+++ b/gmagickpixel_methods.c
@@ -330,7 +330,7 @@ PHP_METHOD(gmagickpixel, getcolorvaluequantum)
 			break;
 
 		default:
-			zend_throw_exception_ex(php_gmagickpixel_exception_class_entry, 2 TSRMLS_CC, "Unknown color type: %d", color_quantum);
+			zend_throw_exception_ex(php_gmagickpixel_exception_class_entry, 2 TSRMLS_CC, "Unknown color type: " ZEND_LONG_FMT, color_quantum);
 			RETURN_NULL();
 	}
 	RETVAL_LONG(color_value_quantum);
@@ -391,10 +391,10 @@ PHP_METHOD(gmagickpixel, setcolorvaluequantum)
 			break;
 
 		default:
-			zend_throw_exception_ex(php_gmagickpixel_exception_class_entry, 2 TSRMLS_CC, "Unknown color type: %d", color_quantum);
+			zend_throw_exception_ex(php_gmagickpixel_exception_class_entry, 2 TSRMLS_CC, "Unknown color type: " ZEND_LONG_FMT, color_quantum);
 			RETURN_NULL();
 	}
 
 	GMAGICK_CHAIN_METHOD;
 }
-/* }}} */
\ No newline at end of file
+/* }}} */

From 59f93c789f2a96c433e4ee5f47c7375451e66c4d Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Mon, 25 Jan 2021 08:14:49 +0100
Subject: [PATCH 3/6] fix [-Wunused-const-variable=]

---
 gmagick.c | 23 -----------------------
 1 file changed, 23 deletions(-)

diff --git a/gmagick.c b/gmagick.c
index 67256ec..158117c 100644
--- a/gmagick.c
+++ b/gmagick.c
@@ -576,12 +576,6 @@ ZEND_BEGIN_ARG_INFO_EX(gmagick_newimage_args, 0, 0, 3)
 	ZEND_ARG_INFO(0, format)
 ZEND_END_ARG_INFO() 
 
-ZEND_BEGIN_ARG_INFO_EX(gmagick_newpseudoimage_args, 0, 0, 3)
- 	ZEND_ARG_INFO(0, columns)
- 	ZEND_ARG_INFO(0, rows)
- 	ZEND_ARG_INFO(0, pseudoString)
-ZEND_END_ARG_INFO() 
-
 ZEND_BEGIN_ARG_INFO_EX(gmagick_getresourcelimit_args, 0, 0, 1)
 	ZEND_ARG_INFO(0, resource_type)
 ZEND_END_ARG_INFO()
@@ -595,14 +589,6 @@ ZEND_BEGIN_ARG_INFO_EX(gmagick_normalizeimage_args, 0, 0, 0)
 	ZEND_ARG_INFO(0, CHANNEL)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(gmagick_oilpaintimage_args, 0, 0, 1)
-	ZEND_ARG_INFO(0, radius)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(gmagick_previewimages_args, 0, 0, 1)
-	ZEND_ARG_INFO(0, PREVIEW)
-ZEND_END_ARG_INFO()
-
 ZEND_BEGIN_ARG_INFO_EX(gmagick_profileimage_args, 0, 0, 2)
 	ZEND_ARG_INFO(0, name)
 	ZEND_ARG_INFO(0, profile)
@@ -624,10 +610,6 @@ ZEND_BEGIN_ARG_INFO_EX(gmagick_quantizeimages_args, 0, 0, 5)
 	ZEND_ARG_INFO(0, measureError)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(gmagick_queryfonts_args, 0, 0, 1)
-	ZEND_ARG_INFO(0, pattern)
-ZEND_END_ARG_INFO()
-
 ZEND_BEGIN_ARG_INFO_EX(gmagick_queryfontmetrics_args, 0, 0, 2)
 	ZEND_ARG_OBJ_INFO(0, GmagickDraw, GmagickDraw, 0)
 	ZEND_ARG_INFO(0, text)
@@ -725,11 +707,6 @@ ZEND_BEGIN_ARG_INFO_EX(gmagick_whitethresholdimage_args, 0, 0, 1)
 	ZEND_ARG_INFO(0, color)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(gmagick_writeimages_args, 0, 0, 2)
-	ZEND_ARG_INFO(0, filename)
-	ZEND_ARG_INFO(0, adjoin)
-ZEND_END_ARG_INFO()
-
 ZEND_BEGIN_ARG_INFO_EX(gmagick_sampleimage_args, 0, 0, 2)
 	ZEND_ARG_INFO(0, columns)
 	ZEND_ARG_INFO(0, rows)

From fa7ae4843818fd752466c60a8574bbe7e3a4292b Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Mon, 25 Jan 2021 12:52:58 +0100
Subject: [PATCH 5/6] Fix error: 'i' undeclared

---
 gmagick.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gmagick.c b/gmagick.c
index 158117c..60bbc07 100644
--- a/gmagick.c
+++ b/gmagick.c
@@ -1753,6 +1753,10 @@ PHP_MINIT_FUNCTION(gmagick)
 */
 PHP_MSHUTDOWN_FUNCTION(gmagick)
 {
+#ifndef HAVE_OMP_PAUSE_RESOURCE_ALL
+	int i;
+#endif
+
 	DestroyMagick();
 #if HAVE_OMP_PAUSE_RESOURCE_ALL
 	// Note there is a patch to add omp_pause_resource_all to DestroyMagick()

From 759eb6277f49c122178cea9f78cd41b349c78fff Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Mon, 25 Jan 2021 13:57:28 +0100
Subject: [PATCH 6/6] AC_COMPILE_IFELSE instead of AC_CHECH_FUNC

---
 config.m4 | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/config.m4 b/config.m4
index 8bd545a..6f76fd6 100644
--- a/config.m4
+++ b/config.m4
@@ -30,7 +30,19 @@ if test $PHP_GMAGICK != "no"; then
 		AC_MSG_CHECKING(GraphicsMagick version mask)
 		AC_MSG_RESULT(found version $GRAPHICSMAGICK_VERSION_MASK)
 
-		PHP_CHECK_FUNC(omp_pause_resource_all, gomp)
+
+		AC_MSG_CHECKING(omp_pause_resource_all usability)
+		AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+			#include <omp.h>
+		]],[[
+			omp_pause_resource_all(omp_pause_hard);
+		]])],[
+			AC_MSG_RESULT(yes)
+			PHP_CHECK_FUNC(omp_pause_resource_all, gomp)
+			PHP_ADD_LIBRARY(gomp,, GMAGICK_SHARED_LIBADD)
+		],[
+			AC_MSG_RESULT(no)
+		])
 
         LIB_DIR=$WAND_DIR/lib
         # If "$LIB_DIR" == "/usr/lib" or possible /usr/$PHP_LIBDIR" then you're probably