summaryrefslogtreecommitdiff
path: root/ext/ereg/ereg.c
diff options
context:
space:
mode:
authorJakub Zelenka <bukka@php.net>2014-12-27 19:42:04 +0000
committerJakub Zelenka <bukka@php.net>2014-12-27 19:42:04 +0000
commitb68da91d52801fb2cc4d2a4a44c859ea5b6c622b (patch)
tree290f7c8ea7fd2df02c995b07c1d490c2de333db5 /ext/ereg/ereg.c
parent4f6539bdaf62f0343f4ec67638d2f96e8c1c00ae (diff)
parenta9e86957c70c181e830ba05bb030c468d0cb15e1 (diff)
downloadphp-git-b68da91d52801fb2cc4d2a4a44c859ea5b6c622b.tar.gz
Merge branch 'master' into jsond
Conflicts: ext/json/JSON_parser.c ext/json/JSON_parser.h ext/json/config.m4 ext/json/config.w32 ext/json/json.c ext/json/php_json.h
Diffstat (limited to 'ext/ereg/ereg.c')
-rw-r--r--ext/ereg/ereg.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c
index c626fef5c7..7d478d682f 100644
--- a/ext/ereg/ereg.c
+++ b/ext/ereg/ereg.c
@@ -103,7 +103,7 @@ ZEND_GET_MODULE(ereg)
/* }}} */
/* {{{ ereg_lru_cmp */
-static int ereg_lru_cmp(const void *a, const void *b TSRMLS_DC)
+static int ereg_lru_cmp(const void *a, const void *b)
{
Bucket *f = (Bucket *) a;
Bucket *s = (Bucket *) b;
@@ -121,7 +121,7 @@ static int ereg_lru_cmp(const void *a, const void *b TSRMLS_DC)
/* }}} */
/* {{{ static ereg_clean_cache */
-static int ereg_clean_cache(zval *data, void *arg TSRMLS_DC)
+static int ereg_clean_cache(zval *data, void *arg)
{
int *num_clean = (int *)arg;
@@ -136,7 +136,7 @@ static int ereg_clean_cache(zval *data, void *arg TSRMLS_DC)
/* {{{ _php_regcomp
*/
-static int _php_regcomp(regex_t *preg, const char *pattern, int cflags TSRMLS_DC)
+static int _php_regcomp(regex_t *preg, const char *pattern, int cflags)
{
int r = 0;
int patlen = strlen(pattern);
@@ -144,12 +144,12 @@ static int _php_regcomp(regex_t *preg, const char *pattern, int cflags TSRMLS_DC
if (zend_hash_num_elements(&EREG(ht_rc)) >= EREG_CACHE_SIZE) {
/* easier than dealing with overflow as it happens */
- if (EREG(lru_counter) >= (1 << 31) || zend_hash_sort(&EREG(ht_rc), zend_qsort, ereg_lru_cmp, 0 TSRMLS_CC) == FAILURE) {
+ if (EREG(lru_counter) >= (1 << 31) || zend_hash_sort(&EREG(ht_rc), zend_qsort, ereg_lru_cmp, 0) == FAILURE) {
zend_hash_clean(&EREG(ht_rc));
EREG(lru_counter) = 0;
} else {
int num_clean = EREG_CACHE_SIZE / 4;
- zend_hash_apply_with_argument(&EREG(ht_rc), ereg_clean_cache, &num_clean TSRMLS_CC);
+ zend_hash_apply_with_argument(&EREG(ht_rc), ereg_clean_cache, &num_clean);
}
}
@@ -215,7 +215,7 @@ static void _free_ereg_cache(zval *zv)
#undef regfree
#define regfree(a);
#undef regcomp
-#define regcomp(a, b, c) _php_regcomp(a, b, c TSRMLS_CC)
+#define regcomp(a, b, c) _php_regcomp(a, b, c)
/* {{{ PHP_GINIT_FUNCTION
*/
@@ -249,7 +249,7 @@ PHP_MINFO_FUNCTION(ereg)
/* {{{ php_ereg_eprint
* php_ereg_eprint - convert error number to name
*/
-static void php_ereg_eprint(int err, regex_t *re TSRMLS_DC) {
+static void php_ereg_eprint(int err, regex_t *re) {
char *buf = NULL, *message = NULL;
size_t len;
size_t buf_len;
@@ -279,7 +279,7 @@ static void php_ereg_eprint(int err, regex_t *re TSRMLS_DC) {
/* drop the message into place */
regerror(err, re, message + buf_len, len);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message);
+ php_error_docref(NULL, E_WARNING, "%s", message);
}
if (buf) efree(buf);
@@ -305,7 +305,7 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
char *string = NULL;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "zs|z/", &regex, &findin, &findin_len, &array) == FAILURE) {
+ if (zend_parse_parameters(argc, "zs|z/", &regex, &findin, &findin_len, &array) == FAILURE) {
return;
}
@@ -331,7 +331,7 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
}
if (err) {
- php_ereg_eprint(err, &re TSRMLS_CC);
+ php_ereg_eprint(err, &re);
RETURN_FALSE;
}
@@ -344,7 +344,7 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
/* actually execute the regular expression */
err = regexec(&re, string, re.re_nsub+1, subs, 0);
if (err && err != REG_NOMATCH) {
- php_ereg_eprint(err, &re TSRMLS_CC);
+ php_ereg_eprint(err, &re);
regfree(&re);
efree(subs);
RETURN_FALSE;
@@ -403,7 +403,7 @@ PHP_FUNCTION(eregi)
/* {{{ php_ereg_replace
* this is the meat and potatoes of regex replacement! */
-PHP_EREG_API char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended TSRMLS_DC)
+PHP_EREG_API char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended)
{
regex_t re;
regmatch_t *subs;
@@ -427,7 +427,7 @@ PHP_EREG_API char *php_ereg_replace(const char *pattern, const char *replace, co
err = regcomp(&re, pattern, copts);
if (err) {
- php_ereg_eprint(err, &re TSRMLS_CC);
+ php_ereg_eprint(err, &re);
return ((char *) -1);
}
@@ -446,7 +446,7 @@ PHP_EREG_API char *php_ereg_replace(const char *pattern, const char *replace, co
err = regexec(&re, &string[pos], re.re_nsub+1, subs, (pos ? REG_NOTBOL : 0));
if (err && err != REG_NOMATCH) {
- php_ereg_eprint(err, &re TSRMLS_CC);
+ php_ereg_eprint(err, &re);
efree(subs);
efree(buf);
regfree(&re);
@@ -559,7 +559,7 @@ static void php_do_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase)
zend_string *replace;
char *ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzS", &arg_pattern, &arg_replace, &arg_string) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzS", &arg_pattern, &arg_replace, &arg_string) == FAILURE) {
return;
}
@@ -596,7 +596,7 @@ static void php_do_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase)
}
/* do the actual work */
- ret = php_ereg_replace(pattern->val, replace->val, string->val, icase, 1 TSRMLS_CC);
+ ret = php_ereg_replace(pattern->val, replace->val, string->val, icase, 1);
if (ret == (char *) -1) {
RETVAL_FALSE;
} else {
@@ -637,7 +637,7 @@ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase)
size_t spliton_len, str_len;
int err, size, copts = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &spliton, &spliton_len, &str, &str_len, &count) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &spliton, &spliton_len, &str, &str_len, &count) == FAILURE) {
return;
}
@@ -650,7 +650,7 @@ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase)
err = regcomp(&re, spliton, REG_EXTENDED | copts);
if (err) {
- php_ereg_eprint(err, &re TSRMLS_CC);
+ php_ereg_eprint(err, &re);
RETURN_FALSE;
}
@@ -667,7 +667,7 @@ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase)
/* No more matches */
regfree(&re);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Regular Expression");
+ php_error_docref(NULL, E_WARNING, "Invalid Regular Expression");
zend_hash_destroy(Z_ARRVAL_P(return_value));
efree(Z_ARR_P(return_value));
@@ -694,7 +694,7 @@ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase)
/* see if we encountered an error */
if (err && err != REG_NOMATCH) {
- php_ereg_eprint(err, &re TSRMLS_CC);
+ php_ereg_eprint(err, &re);
regfree(&re);
zend_hash_destroy(Z_ARRVAL_P(return_value));
efree(Z_ARR_P(return_value));
@@ -737,7 +737,7 @@ PHP_EREG_API PHP_FUNCTION(sql_regcase)
unsigned char c;
register int i, j;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &string, &string_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &string, &string_len) == FAILURE) {
return;
}