mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-05 04:47:14 +02:00
87 lines
2.3 KiB
Diff
87 lines
2.3 KiB
Diff
From 3e49feb8362f14d6f13d79c9533edd900bbf1d21 Mon Sep 17 00:00:00 2001
|
|
From: Qiangjun Ran <ranqiangjun@gmail.com>
|
|
Date: Tue, 8 Jun 2021 14:43:34 +0800
|
|
Subject: [PATCH] PHP 8 support
|
|
|
|
Patch-Source: https://github.com/sqmk/pecl-jsmin/pull/59
|
|
---
|
|
jsmin.c | 8 ++++----
|
|
jsmin.h | 4 ++--
|
|
php_jsmin.c | 6 +++---
|
|
3 files changed, 9 insertions(+), 9 deletions(-)
|
|
|
|
diff --git a/jsmin.c b/jsmin.c
|
|
index 2744aef..773dc09 100644
|
|
--- a/jsmin.c
|
|
+++ b/jsmin.c
|
|
@@ -34,7 +34,7 @@ SOFTWARE.
|
|
*/
|
|
|
|
static jsmin_obj*
|
|
-new_jsmin_obj(char *javascript TSRMLS_DC)
|
|
+new_jsmin_obj(char *javascript)
|
|
{
|
|
jsmin_obj *jmo = ecalloc(1, sizeof(jsmin_obj));
|
|
jmo->javascript = javascript;
|
|
@@ -48,7 +48,7 @@ new_jsmin_obj(char *javascript TSRMLS_DC)
|
|
/* free_jsmin_obj -- frees up memory on struct
|
|
*/
|
|
void
|
|
-free_jsmin_obj(jsmin_obj *jmo TSRMLS_DC)
|
|
+free_jsmin_obj(jsmin_obj *jmo)
|
|
{
|
|
smart_string_free(&jmo->buffer);
|
|
efree(jmo);
|
|
@@ -250,9 +250,9 @@ jsmin_action(int d, jsmin_obj *jmo)
|
|
*/
|
|
|
|
jsmin_obj*
|
|
-jsmin(char *javascript TSRMLS_DC)
|
|
+jsmin(char *javascript)
|
|
{
|
|
- jsmin_obj *jmo = new_jsmin_obj(javascript TSRMLS_CC);
|
|
+ jsmin_obj *jmo = new_jsmin_obj(javascript);
|
|
|
|
jsmin_action(3, jmo);
|
|
while (jmo->theA != 0) {
|
|
diff --git a/jsmin.h b/jsmin.h
|
|
index 317b90b..0bda630 100644
|
|
--- a/jsmin.h
|
|
+++ b/jsmin.h
|
|
@@ -25,7 +25,7 @@ enum error_codes {
|
|
PHP_JSMIN_ERROR_UNTERMINATED_REGEX
|
|
};
|
|
|
|
-extern jsmin_obj* jsmin(char *javascript TSRMLS_DC);
|
|
-extern void free_jsmin_obj(jsmin_obj *jmo TSRMLS_DC);
|
|
+extern jsmin_obj* jsmin(char *javascript);
|
|
+extern void free_jsmin_obj(jsmin_obj *jmo);
|
|
|
|
#endif
|
|
diff --git a/php_jsmin.c b/php_jsmin.c
|
|
index a9783d4..6cc034a 100644
|
|
--- a/php_jsmin.c
|
|
+++ b/php_jsmin.c
|
|
@@ -105,11 +105,11 @@ PHP_FUNCTION(jsmin)
|
|
|
|
zval *ret_code = NULL;
|
|
|
|
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/", &javascript, &javascript_len, &ret_code) == FAILURE) {
|
|
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/", &javascript, &javascript_len, &ret_code) == FAILURE) {
|
|
RETURN_FALSE;
|
|
}
|
|
|
|
- jmo = jsmin(javascript TSRMLS_CC);
|
|
+ jmo = jsmin(javascript);
|
|
if (ret_code) {
|
|
zval_dtor(ret_code);
|
|
ZVAL_LONG(ret_code, jmo->errorCode);
|
|
@@ -121,7 +121,7 @@ PHP_FUNCTION(jsmin)
|
|
} else {
|
|
ZVAL_STRINGL(return_value, jmo->buffer.c, jmo->buffer.len);
|
|
}
|
|
- free_jsmin_obj(jmo TSRMLS_CC);
|
|
+ free_jsmin_obj(jmo);
|
|
}
|
|
/* }}} */
|
|
|