Skip to content

Commit c033288

Browse files
author
Jeroen van Wolffelaar
committed
Back-substitute for Z_* macro's. If it breaks some extension (the script isn't optimal, it parses for example var->zval.value incorrect) please let me know.
1 parent 158d34c commit c033288

138 files changed

Lines changed: 2902 additions & 2902 deletions

File tree

Some content is hidden

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

ext/aspell/aspell.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ PHP_FUNCTION(aspell_new)
9494
if(argc==2)
9595
{
9696
convert_to_string_ex(personal) ;
97-
sc=aspell_new((*master)->value.str.val, (*personal)->value.str.val);
97+
sc=aspell_new(Z_STRVAL_PP(master), Z_STRVAL_PP(personal));
9898
}
9999
else
100-
sc=aspell_new((*master)->value.str.val, "");
100+
sc=aspell_new(Z_STRVAL_PP(master), "");
101101

102102
ind = zend_list_insert(sc, le_aspell);
103103
RETURN_LONG(ind);
@@ -122,18 +122,18 @@ PHP_FUNCTION(aspell_suggest)
122122
}
123123
convert_to_long_ex(scin);
124124
convert_to_string_ex(word);
125-
sc = (aspell *)zend_list_find((*scin)->value.lval, &type);
125+
sc = (aspell *)zend_list_find(Z_LVAL_PP(scin), &type);
126126
if(!sc)
127127
{
128-
php_error(E_WARNING, "%d is not an ASPELL result index", (*scin)->value.lval);
128+
php_error(E_WARNING, "%d is not an ASPELL result index", Z_LVAL_PP(scin));
129129
RETURN_FALSE;
130130
}
131131

132132
if (array_init(return_value) == FAILURE) {
133133
RETURN_FALSE;
134134
}
135135

136-
sug = aspell_suggest(sc, (*word)->value.str.val);
136+
sug = aspell_suggest(sc, Z_STRVAL_PP(word));
137137
for (i = 0; i != sug->size; ++i) {
138138
add_next_index_string(return_value, (char *)sug->data[i], 1);
139139
}
@@ -156,13 +156,13 @@ PHP_FUNCTION(aspell_check)
156156
}
157157
convert_to_long_ex(scin);
158158
convert_to_string_ex(word);
159-
sc= (aspell *) zend_list_find((*scin)->value.lval, &type);
159+
sc= (aspell *) zend_list_find(Z_LVAL_PP(scin), &type);
160160
if(!sc)
161161
{
162-
php_error(E_WARNING, "%d is not an ASPELL result index", (*scin)->value.lval);
162+
php_error(E_WARNING, "%d is not an ASPELL result index", Z_LVAL_PP(scin));
163163
RETURN_FALSE;
164164
}
165-
if (aspell_check(sc, (*word)->value.str.val))
165+
if (aspell_check(sc, Z_STRVAL_PP(word)))
166166
{
167167
RETURN_TRUE;
168168
}
@@ -188,13 +188,13 @@ PHP_FUNCTION(aspell_check_raw)
188188
}
189189
convert_to_long_ex(scin);
190190
convert_to_string_ex(word);
191-
sc = (aspell *)zend_list_find((*scin)->value.lval, &type);
191+
sc = (aspell *)zend_list_find(Z_LVAL_PP(scin), &type);
192192
if(!sc)
193193
{
194-
php_error(E_WARNING, "%d is not an ASPELL result index", (*scin)->value.lval);
194+
php_error(E_WARNING, "%d is not an ASPELL result index", Z_LVAL_PP(scin));
195195
RETURN_FALSE;
196196
}
197-
if (aspell_check_raw(sc, (*word)->value.str.val))
197+
if (aspell_check_raw(sc, Z_STRVAL_PP(word)))
198198
{
199199
RETURN_TRUE;
200200
}

ext/bcmath/bcmath.c

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ PHP_FUNCTION(bcadd)
150150
WRONG_PARAM_COUNT;
151151
}
152152
convert_to_long_ex(scale_param);
153-
scale = (int) (*scale_param)->value.lval;
153+
scale = (int) Z_LVAL_PP(scale_param);
154154
break;
155155
default:
156156
WRONG_PARAM_COUNT;
@@ -161,12 +161,12 @@ PHP_FUNCTION(bcadd)
161161
bc_init_num(&first);
162162
bc_init_num(&second);
163163
bc_init_num(&result);
164-
bc_str2num(&first, (*left)->value.str.val, scale);
165-
bc_str2num(&second, (*right)->value.str.val, scale);
164+
bc_str2num(&first, Z_STRVAL_PP(left), scale);
165+
bc_str2num(&second, Z_STRVAL_PP(right), scale);
166166
bc_add (first, second, &result, scale);
167-
return_value->value.str.val = bc_num2str(result);
168-
return_value->value.str.len = strlen(return_value->value.str.val);
169-
return_value->type = IS_STRING;
167+
Z_STRVAL_P(return_value) = bc_num2str(result);
168+
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
169+
Z_TYPE_P(return_value) = IS_STRING;
170170
bc_free_num(&first);
171171
bc_free_num(&second);
172172
bc_free_num(&result);
@@ -193,7 +193,7 @@ PHP_FUNCTION(bcsub)
193193
WRONG_PARAM_COUNT;
194194
}
195195
convert_to_long_ex(scale_param);
196-
scale = (int) (*scale_param)->value.lval;
196+
scale = (int) Z_LVAL_PP(scale_param);
197197
break;
198198
default:
199199
WRONG_PARAM_COUNT;
@@ -204,12 +204,12 @@ PHP_FUNCTION(bcsub)
204204
bc_init_num(&first);
205205
bc_init_num(&second);
206206
bc_init_num(&result);
207-
bc_str2num(&first, (*left)->value.str.val, scale);
208-
bc_str2num(&second, (*right)->value.str.val, scale);
207+
bc_str2num(&first, Z_STRVAL_PP(left), scale);
208+
bc_str2num(&second, Z_STRVAL_PP(right), scale);
209209
bc_sub (first, second, &result, scale);
210-
return_value->value.str.val = bc_num2str(result);
211-
return_value->value.str.len = strlen(return_value->value.str.val);
212-
return_value->type = IS_STRING;
210+
Z_STRVAL_P(return_value) = bc_num2str(result);
211+
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
212+
Z_TYPE_P(return_value) = IS_STRING;
213213
bc_free_num(&first);
214214
bc_free_num(&second);
215215
bc_free_num(&result);
@@ -236,7 +236,7 @@ PHP_FUNCTION(bcmul)
236236
WRONG_PARAM_COUNT;
237237
}
238238
convert_to_long_ex(scale_param);
239-
scale = (int) (*scale_param)->value.lval;
239+
scale = (int) Z_LVAL_PP(scale_param);
240240
break;
241241
default:
242242
WRONG_PARAM_COUNT;
@@ -247,12 +247,12 @@ PHP_FUNCTION(bcmul)
247247
bc_init_num(&first);
248248
bc_init_num(&second);
249249
bc_init_num(&result);
250-
bc_str2num(&first, (*left)->value.str.val, scale);
251-
bc_str2num(&second, (*right)->value.str.val, scale);
250+
bc_str2num(&first, Z_STRVAL_PP(left), scale);
251+
bc_str2num(&second, Z_STRVAL_PP(right), scale);
252252
bc_multiply (first, second, &result, scale);
253-
return_value->value.str.val = bc_num2str(result);
254-
return_value->value.str.len = strlen(return_value->value.str.val);
255-
return_value->type = IS_STRING;
253+
Z_STRVAL_P(return_value) = bc_num2str(result);
254+
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
255+
Z_TYPE_P(return_value) = IS_STRING;
256256
bc_free_num(&first);
257257
bc_free_num(&second);
258258
bc_free_num(&result);
@@ -279,7 +279,7 @@ PHP_FUNCTION(bcdiv)
279279
WRONG_PARAM_COUNT;
280280
}
281281
convert_to_long_ex(scale_param);
282-
scale = (int) (*scale_param)->value.lval;
282+
scale = (int) Z_LVAL_PP(scale_param);
283283
break;
284284
default:
285285
WRONG_PARAM_COUNT;
@@ -290,13 +290,13 @@ PHP_FUNCTION(bcdiv)
290290
bc_init_num(&first);
291291
bc_init_num(&second);
292292
bc_init_num(&result);
293-
bc_str2num(&first, (*left)->value.str.val, scale);
294-
bc_str2num(&second, (*right)->value.str.val, scale);
293+
bc_str2num(&first, Z_STRVAL_PP(left), scale);
294+
bc_str2num(&second, Z_STRVAL_PP(right), scale);
295295
switch (bc_divide (first, second, &result, scale)) {
296296
case 0: /* OK */
297-
return_value->value.str.val = bc_num2str(result);
298-
return_value->value.str.len = strlen(return_value->value.str.val);
299-
return_value->type = IS_STRING;
297+
Z_STRVAL_P(return_value) = bc_num2str(result);
298+
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
299+
Z_TYPE_P(return_value) = IS_STRING;
300300
break;
301301
case -1: /* division by zero */
302302
php_error(E_WARNING, "Division by zero");
@@ -331,13 +331,13 @@ PHP_FUNCTION(bcmod)
331331
bc_init_num(&first);
332332
bc_init_num(&second);
333333
bc_init_num(&result);
334-
bc_str2num(&first, (*left)->value.str.val, 0);
335-
bc_str2num(&second, (*right)->value.str.val, 0);
334+
bc_str2num(&first, Z_STRVAL_PP(left), 0);
335+
bc_str2num(&second, Z_STRVAL_PP(right), 0);
336336
switch (bc_modulo(first, second, &result, 0)) {
337337
case 0:
338-
return_value->value.str.val = bc_num2str(result);
339-
return_value->value.str.len = strlen(return_value->value.str.val);
340-
return_value->type = IS_STRING;
338+
Z_STRVAL_P(return_value) = bc_num2str(result);
339+
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
340+
Z_TYPE_P(return_value) = IS_STRING;
341341
break;
342342
case -1:
343343
php_error(E_WARNING, "Division by zero");
@@ -369,7 +369,7 @@ PHP_FUNCTION(bcpow)
369369
WRONG_PARAM_COUNT;
370370
}
371371
convert_to_long_ex(scale_param);
372-
scale = (int) (*scale_param)->value.lval;
372+
scale = (int) Z_LVAL_PP(scale_param);
373373
break;
374374
default:
375375
WRONG_PARAM_COUNT;
@@ -380,12 +380,12 @@ PHP_FUNCTION(bcpow)
380380
bc_init_num(&first);
381381
bc_init_num(&second);
382382
bc_init_num(&result);
383-
bc_str2num(&first, (*left)->value.str.val, scale);
384-
bc_str2num(&second, (*right)->value.str.val, scale);
383+
bc_str2num(&first, Z_STRVAL_PP(left), scale);
384+
bc_str2num(&second, Z_STRVAL_PP(right), scale);
385385
bc_raise (first, second, &result, scale);
386-
return_value->value.str.val = bc_num2str(result);
387-
return_value->value.str.len = strlen(return_value->value.str.val);
388-
return_value->type = IS_STRING;
386+
Z_STRVAL_P(return_value) = bc_num2str(result);
387+
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
388+
Z_TYPE_P(return_value) = IS_STRING;
389389
bc_free_num(&first);
390390
bc_free_num(&second);
391391
bc_free_num(&result);
@@ -412,19 +412,19 @@ PHP_FUNCTION(bcsqrt)
412412
WRONG_PARAM_COUNT;
413413
}
414414
convert_to_long_ex(scale_param);
415-
scale = (int) (*scale_param)->value.lval;
415+
scale = (int) Z_LVAL_PP(scale_param);
416416
break;
417417
default:
418418
WRONG_PARAM_COUNT;
419419
break;
420420
}
421421
convert_to_string_ex(left);
422422
bc_init_num(&result);
423-
bc_str2num(&result, (*left)->value.str.val, scale);
423+
bc_str2num(&result, Z_STRVAL_PP(left), scale);
424424
if (bc_sqrt (&result, scale) != 0) {
425-
return_value->value.str.val = bc_num2str(result);
426-
return_value->value.str.len = strlen(return_value->value.str.val);
427-
return_value->type = IS_STRING;
425+
Z_STRVAL_P(return_value) = bc_num2str(result);
426+
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
427+
Z_TYPE_P(return_value) = IS_STRING;
428428
} else {
429429
php_error(E_WARNING, "Square root of negative number");
430430
}
@@ -452,7 +452,7 @@ PHP_FUNCTION(bccomp)
452452
WRONG_PARAM_COUNT;
453453
}
454454
convert_to_long_ex(scale_param);
455-
scale = (int) (*scale_param)->value.lval;
455+
scale = (int) Z_LVAL_PP(scale_param);
456456
break;
457457
default:
458458
WRONG_PARAM_COUNT;
@@ -464,10 +464,10 @@ PHP_FUNCTION(bccomp)
464464
bc_init_num(&first);
465465
bc_init_num(&second);
466466

467-
bc_str2num(&first, (*left)->value.str.val, scale);
468-
bc_str2num(&second, (*right)->value.str.val, scale);
469-
return_value->value.lval = bc_compare(first, second);
470-
return_value->type = IS_LONG;
467+
bc_str2num(&first, Z_STRVAL_PP(left), scale);
468+
bc_str2num(&second, Z_STRVAL_PP(right), scale);
469+
Z_LVAL_P(return_value) = bc_compare(first, second);
470+
Z_TYPE_P(return_value) = IS_LONG;
471471

472472
bc_free_num(&first);
473473
bc_free_num(&second);
@@ -486,7 +486,7 @@ PHP_FUNCTION(bcscale)
486486
}
487487

488488
convert_to_long_ex(new_scale);
489-
bc_precision = (*new_scale)->value.lval;
489+
bc_precision = Z_LVAL_PP(new_scale);
490490
RETURN_TRUE;
491491
}
492492
/* }}} */

ext/calendar/cal_unix.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ PHP_FUNCTION(unixtojd)
4040

4141
if(myargc==1) {
4242
convert_to_long(timestamp);
43-
t = timestamp->value.lval;
43+
t = Z_LVAL_P(timestamp);
4444
} else {
4545
t = time(NULL);
4646
}
@@ -69,7 +69,7 @@ PHP_FUNCTION(jdtounix)
6969

7070
convert_to_long(jday);
7171

72-
uday = jday->value.lval - 2440588 /* J.D. of 1.1.1970 */;
72+
uday = Z_LVAL_P(jday) - 2440588 /* J.D. of 1.1.1970 */;
7373

7474
if(uday<0) RETURN_FALSE; /* before beginning of unix epoch */
7575
if(uday>24755) RETURN_FALSE; /* behind end of unix epoch */

0 commit comments

Comments
 (0)