Skip to content

Commit c43806f

Browse files
committed
Zend compatibility patch
1 parent 4187439 commit c43806f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+342
-343
lines changed

ext/calendar/calendar.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ PHP_FUNCTION(cal_info)
150150
}
151151
convert_to_long_ex(cal);
152152
if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) {
153-
zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(), Z_LVAL_PP(cal));
153+
zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
154154
RETURN_FALSE;
155155
}
156156

@@ -192,7 +192,7 @@ PHP_FUNCTION(cal_days_in_month)
192192
convert_to_long_ex(year);
193193

194194
if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) {
195-
zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(), Z_LVAL_PP(cal));
195+
zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
196196
RETURN_FALSE;
197197
}
198198

@@ -228,7 +228,7 @@ PHP_FUNCTION(cal_to_jd)
228228
convert_to_long_ex(year);
229229

230230
if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) {
231-
zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(), Z_LVAL_PP(cal));
231+
zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
232232
RETURN_FALSE;
233233
}
234234

@@ -254,7 +254,7 @@ PHP_FUNCTION(cal_from_jd)
254254
convert_to_long_ex(cal);
255255

256256
if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) {
257-
zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(), Z_LVAL_PP(cal));
257+
zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
258258
RETURN_FALSE;
259259
}
260260
calendar = &cal_conversion_table[Z_LVAL_PP(cal)];

ext/com/COM.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,7 @@ static int php_COM_load_typelib(ITypeLib *TypeLib, int mode)
16281628
SysFreeString(bstr_ids);
16291629
c.name_len = strlen(ids)+1;
16301630
c.name = ids;
1631-
if (zend_get_constant(c.name, c.name_len-1, &exists))
1631+
if (zend_get_constant(c.name, c.name_len-1, &exists TSRMLS_CC))
16321632
{
16331633
/* Oops, it already exists. No problem if it is defined as the same value */
16341634
/* Check to see if they are the same */

ext/crack/crack.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ PHP_INI_BEGIN()
6161
STD_PHP_INI_ENTRY("crack.default_dictionary", NULL, PHP_INI_SYSTEM, OnUpdateString, default_dictionary, zend_crack_globals, crack_globals)
6262
PHP_INI_END()
6363

64-
long _crack_open_dict(char *dictpath)
64+
long _crack_open_dict(char *dictpath TSRMLS_DC)
6565
{
6666
PWDICT *pwdict;
6767
long resource;
@@ -145,7 +145,7 @@ ZEND_FUNCTION(crack_opendict)
145145

146146
convert_to_string_ex(dictpath);
147147

148-
if (-1 == (resource = _crack_open_dict(Z_STRVAL_PP(dictpath)))) {
148+
if (-1 == (resource = _crack_open_dict(Z_STRVAL_PP(dictpath) TSRMLS_CC))) {
149149
RETURN_FALSE;
150150
}
151151

@@ -202,7 +202,7 @@ ZEND_FUNCTION(crack_check)
202202
RETURN_FALSE;
203203
}
204204
if (NULL != CRACKG(default_dictionary) && CRACKG(current_id) == -1) {
205-
_crack_open_dict(CRACKG(default_dictionary));
205+
_crack_open_dict(CRACKG(default_dictionary) TSRMLS_CC);
206206
}
207207
id = CRACKG(current_id);
208208
break;

ext/curl/curl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
286286
error = call_user_function(EG(function_table),
287287
NULL,
288288
t->func,
289-
retval, 2, argv);
289+
retval, 2, argv TSRMLS_CC);
290290
if (error == FAILURE) {
291291
php_error(E_WARNING, "Cannot call the CURLOPT_WRITEFUNCTION");
292292
length = -1;
@@ -340,7 +340,7 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
340340
error = call_user_function(EG(function_table),
341341
NULL,
342342
t->func,
343-
retval, 3, argv);
343+
retval, 3, argv TSRMLS_CC);
344344
if (error == FAILURE) {
345345
php_error(E_WARNING, "Cannot call the CURLOPT_READFUNCTION");
346346
length = -1;
@@ -402,7 +402,7 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
402402
error = call_user_function(EG(function_table),
403403
NULL,
404404
t->func,
405-
retval, 2, argv);
405+
retval, 2, argv TSRMLS_CC);
406406
if (error == FAILURE) {
407407
php_error(E_WARNING, "Couldn't call the CURLOPT_HEADERFUNCTION");
408408
length = -1;
@@ -450,7 +450,7 @@ static size_t curl_passwd(void *ctx, char *prompt, char *buf, int buflen)
450450
error = call_user_function(EG(function_table),
451451
NULL,
452452
func,
453-
retval, 2, argv);
453+
retval, 2, argv TSRMLS_CC);
454454
if (error == FAILURE) {
455455
php_error(E_WARNING, "Couldn't call the CURLOPT_PASSWDFUNCTION");
456456
ret = -1;

ext/db/db.c

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,12 @@ void *dbm_mutex;
168168

169169
/* {{{ php_find_dbm
170170
*/
171-
dbm_info *php_find_dbm(pval *id)
171+
dbm_info *php_find_dbm(pval *id TSRMLS_DC)
172172
{
173173
list_entry *le;
174174
dbm_info *info;
175175
int numitems, i;
176176
int info_type;
177-
TSRMLS_FETCH();
178177

179178
if (Z_TYPE_P(id) == IS_STRING) {
180179
numitems = zend_hash_num_elements(&EG(regular_list));
@@ -260,7 +259,8 @@ PHP_FUNCTION(dblist)
260259

261260
/* {{{ proto int dbmopen(string filename, string mode)
262261
Opens a dbm database */
263-
PHP_FUNCTION(dbmopen) {
262+
PHP_FUNCTION(dbmopen)
263+
{
264264
pval *filename, *mode;
265265
dbm_info *info=NULL;
266266
int ret;
@@ -272,7 +272,7 @@ PHP_FUNCTION(dbmopen) {
272272
convert_to_string(filename);
273273
convert_to_string(mode);
274274

275-
info = php_dbm_open(Z_STRVAL_P(filename), Z_STRVAL_P(mode));
275+
info = php_dbm_open(Z_STRVAL_P(filename), Z_STRVAL_P(mode) TSRMLS_CC);
276276
if (info) {
277277
ret = zend_list_insert(info, le_db);
278278
RETURN_LONG(ret);
@@ -284,22 +284,19 @@ PHP_FUNCTION(dbmopen) {
284284

285285
/* {{{ php_dbm_open
286286
*/
287-
dbm_info *php_dbm_open(char *filename, char *mode)
287+
dbm_info *php_dbm_open(char *filename, char *mode TSRMLS_DC)
288288
{
289289
dbm_info *info;
290290
int ret, lock=0;
291291
char *lockfn = NULL;
292292
int lockfd = 0;
293-
294293
#if NFS_HACK
295294
int last_try = 0;
296295
struct stat sb;
297296
int retries = 0;
298297
#endif
299-
300298
DBM_TYPE dbf=NULL;
301299
DBM_MODE_TYPE imode;
302-
TSRMLS_FETCH();
303300

304301
if (filename == NULL) {
305302
php_error(E_WARNING, "NULL filename passed to php_dbm_open()");
@@ -492,7 +489,7 @@ PHP_FUNCTION(dbminsert)
492489
convert_to_string(key);
493490
convert_to_string(value);
494491

495-
info = php_find_dbm(id);
492+
info = php_find_dbm(id TSRMLS_CC);
496493
if (!info) {
497494
php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id));
498495
RETURN_FALSE;
@@ -552,25 +549,24 @@ PHP_FUNCTION(dbmreplace)
552549
convert_to_string(key);
553550
convert_to_string(value);
554551

555-
info = php_find_dbm(id);
552+
info = php_find_dbm(id TSRMLS_CC);
556553
if (!info) {
557554
php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id));
558555
RETURN_FALSE;
559556
}
560557

561-
ret = php_dbm_replace(info, Z_STRVAL_P(key), Z_STRVAL_P(value));
558+
ret = php_dbm_replace(info, Z_STRVAL_P(key), Z_STRVAL_P(value) TSRMLS_CC);
562559
RETURN_LONG(ret);
563560
}
564561
/* }}} */
565562

566563
/* {{{ php_dbm_replace
567564
*/
568-
int php_dbm_replace(dbm_info *info, char *key, char *value)
565+
int php_dbm_replace(dbm_info *info, char *key, char *value TSRMLS_DC)
569566
{
570567
DBM_TYPE dbf;
571568
int ret;
572569
datum key_datum, value_datum;
573-
TSRMLS_FETCH();
574570

575571
if (PG(magic_quotes_runtime)) {
576572
php_stripslashes(key,NULL);
@@ -614,13 +610,13 @@ PHP_FUNCTION(dbmfetch)
614610
}
615611
convert_to_string(key);
616612

617-
info = php_find_dbm(id);
613+
info = php_find_dbm(id TSRMLS_CC);
618614
if (!info) {
619615
php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id));
620616
RETURN_FALSE;
621617
}
622618

623-
ret = php_dbm_fetch(info, Z_STRVAL_P(key));
619+
ret = php_dbm_fetch(info, Z_STRVAL_P(key) TSRMLS_CC);
624620
if (ret) {
625621
RETVAL_STRING(ret, 0);
626622
} else {
@@ -631,12 +627,11 @@ PHP_FUNCTION(dbmfetch)
631627

632628
/* {{{ php_dbm_fetch
633629
*/
634-
char *php_dbm_fetch(dbm_info *info, char *key)
630+
char *php_dbm_fetch(dbm_info *info, char *key TSRMLS_DC)
635631
{
636632
datum key_datum, value_datum;
637633
char *ret;
638634
DBM_TYPE dbf;
639-
TSRMLS_FETCH();
640635

641636
key_datum.dptr = key;
642637
key_datum.dsize = strlen(key);
@@ -691,7 +686,7 @@ PHP_FUNCTION(dbmexists)
691686
}
692687
convert_to_string(key);
693688

694-
info = php_find_dbm(id);
689+
info = php_find_dbm(id TSRMLS_CC);
695690
if (!info) {
696691
php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id));
697692
RETURN_FALSE;
@@ -740,7 +735,7 @@ PHP_FUNCTION(dbmdelete)
740735
}
741736
convert_to_string(key);
742737

743-
info = php_find_dbm(id);
738+
info = php_find_dbm(id TSRMLS_CC);
744739
if (!info) {
745740
php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id));
746741
RETURN_FALSE;
@@ -787,7 +782,7 @@ PHP_FUNCTION(dbmfirstkey)
787782
WRONG_PARAM_COUNT;
788783
}
789784

790-
info = php_find_dbm(id);
785+
info = php_find_dbm(id TSRMLS_CC);
791786
if (!info) {
792787
php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id));
793788
RETURN_FALSE;
@@ -849,13 +844,13 @@ PHP_FUNCTION(dbmnextkey)
849844
}
850845
convert_to_string(key);
851846

852-
info = php_find_dbm(id);
847+
info = php_find_dbm(id TSRMLS_CC);
853848
if (!info) {
854849
php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id));
855850
RETURN_FALSE;
856851
}
857852

858-
ret = php_dbm_nextkey(info, Z_STRVAL_P(key));
853+
ret = php_dbm_nextkey(info, Z_STRVAL_P(key) TSRMLS_CC);
859854
if (!ret) {
860855
RETURN_FALSE;
861856
} else {
@@ -866,12 +861,11 @@ PHP_FUNCTION(dbmnextkey)
866861

867862
/* {{{ php_dbm_nextkey
868863
*/
869-
char *php_dbm_nextkey(dbm_info *info, char *key)
864+
char *php_dbm_nextkey(dbm_info *info, char *key TSRMLS_DC)
870865
{
871866
datum key_datum, ret_datum;
872867
char *ret;
873868
DBM_TYPE dbf;
874-
TSRMLS_FETCH();
875869

876870
key_datum.dptr = key;
877871
key_datum.dsize = strlen(key);

ext/dbx/dbx.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,18 @@ int split_dbx_handle_object(zval ** dbx_object, zval *** pdbx_handle, zval *** p
7979
}
8080

8181
/* from dbx.h, to be used in support-files (dbx_mysql.c etc...) */
82-
void dbx_call_any_function(INTERNAL_FUNCTION_PARAMETERS, char * function_name, zval ** returnvalue, int number_of_arguments, zval *** params) {
82+
void dbx_call_any_function(INTERNAL_FUNCTION_PARAMETERS, char * function_name, zval ** returnvalue, int number_of_arguments, zval ***params)
83+
{
8384
zval * zval_function_name;
85+
8486
MAKE_STD_ZVAL(zval_function_name);
8587
ZVAL_STRING(zval_function_name, function_name, 1);
86-
if (call_user_function_ex(EG(function_table), NULL, zval_function_name, returnvalue, number_of_arguments, params, 0, NULL) == FAILURE) {
88+
if (call_user_function_ex(EG(function_table), NULL, zval_function_name, returnvalue, number_of_arguments, params, 0, NULL TSRMLS_CC) == FAILURE) {
8789
zend_error(E_ERROR, "function '%s' not found", zval_function_name->value.str.val);
88-
}
90+
}
8991
zval_dtor(zval_function_name); /* to free stringvalue memory */
9092
FREE_ZVAL(zval_function_name);
91-
}
93+
}
9294

9395
/* switch_dbx functions declarations
9496
* each must be supported in the dbx_module files as dbx_module_function,

0 commit comments

Comments
 (0)