summaryrefslogtreecommitdiff
path: root/ext/calendar
diff options
context:
space:
mode:
authorJeroen van Wolffelaar <jeroen@php.net>2001-09-25 21:58:48 +0000
committerJeroen van Wolffelaar <jeroen@php.net>2001-09-25 21:58:48 +0000
commitc03328857394bef36ffa9678d33079ad96e4a4e4 (patch)
treec0fb250db3b1bb996fc305bf56c2b74eb6d00935 /ext/calendar
parent158d34c9a57816326e141e88e1409d9f377dc2ea (diff)
downloadphp-git-c03328857394bef36ffa9678d33079ad96e4a4e4.tar.gz
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.
Diffstat (limited to 'ext/calendar')
-rw-r--r--ext/calendar/cal_unix.c4
-rw-r--r--ext/calendar/calendar.c34
-rw-r--r--ext/calendar/easter.c8
3 files changed, 23 insertions, 23 deletions
diff --git a/ext/calendar/cal_unix.c b/ext/calendar/cal_unix.c
index 2bf9b2454c..5d7f99a996 100644
--- a/ext/calendar/cal_unix.c
+++ b/ext/calendar/cal_unix.c
@@ -40,7 +40,7 @@ PHP_FUNCTION(unixtojd)
if(myargc==1) {
convert_to_long(timestamp);
- t = timestamp->value.lval;
+ t = Z_LVAL_P(timestamp);
} else {
t = time(NULL);
}
@@ -69,7 +69,7 @@ PHP_FUNCTION(jdtounix)
convert_to_long(jday);
- uday = jday->value.lval - 2440588 /* J.D. of 1.1.1970 */;
+ uday = Z_LVAL_P(jday) - 2440588 /* J.D. of 1.1.1970 */;
if(uday<0) RETURN_FALSE; /* before beginning of unix epoch */
if(uday>24755) RETURN_FALSE; /* behind end of unix epoch */
diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c
index acf55e923d..b10bc42036 100644
--- a/ext/calendar/calendar.c
+++ b/ext/calendar/calendar.c
@@ -296,7 +296,7 @@ PHP_FUNCTION(jdtogregorian)
}
convert_to_long_ex(julday);
- SdnToGregorian((*julday)->value.lval, &year, &month, &day);
+ SdnToGregorian(Z_LVAL_PP(julday), &year, &month, &day);
sprintf(date, "%i/%i/%i", month, day, year);
RETURN_STRING(date, 1);
@@ -318,7 +318,7 @@ PHP_FUNCTION(jdtogregorian)
convert_to_long_ex(day);
convert_to_long_ex(year);
- jdate = GregorianToSdn((*year)->value.lval, (*month)->value.lval, (*day)->value.lval);
+ jdate = GregorianToSdn(Z_LVAL_PP(year), Z_LVAL_PP(month), Z_LVAL_PP(day));
RETURN_LONG(jdate);
}
@@ -337,7 +337,7 @@ PHP_FUNCTION(jdtogregorian)
}
convert_to_long_ex(julday);
- SdnToJulian((*julday)->value.lval, &year, &month, &day);
+ SdnToJulian(Z_LVAL_PP(julday), &year, &month, &day);
sprintf(date, "%i/%i/%i", month, day, year);
RETURN_STRING(date, 1);
@@ -359,7 +359,7 @@ PHP_FUNCTION(jdtogregorian)
convert_to_long_ex(day);
convert_to_long_ex(year);
- jdate = JulianToSdn((*year)->value.lval, (*month)->value.lval, (*day)->value.lval);
+ jdate = JulianToSdn(Z_LVAL_PP(year), Z_LVAL_PP(month), Z_LVAL_PP(day));
RETURN_LONG(jdate);
}
@@ -379,7 +379,7 @@ PHP_FUNCTION(jdtogregorian)
convert_to_long_ex(julday);
- SdnToJewish((*julday)->value.lval, &year, &month, &day);
+ SdnToJewish(Z_LVAL_PP(julday), &year, &month, &day);
sprintf(date, "%i/%i/%i", month, day, year);
RETURN_STRING(date, 1);
@@ -401,7 +401,7 @@ PHP_FUNCTION(jdtogregorian)
convert_to_long_ex(day);
convert_to_long_ex(year);
- jdate = JewishToSdn((*year)->value.lval, (*month)->value.lval, (*day)->value.lval);
+ jdate = JewishToSdn(Z_LVAL_PP(year), Z_LVAL_PP(month), Z_LVAL_PP(day));
RETURN_LONG(jdate);
}
@@ -421,7 +421,7 @@ PHP_FUNCTION(jdtogregorian)
convert_to_long_ex(julday);
- SdnToFrench((*julday)->value.lval, &year, &month, &day);
+ SdnToFrench(Z_LVAL_PP(julday), &year, &month, &day);
sprintf(date, "%i/%i/%i", month, day, year);
RETURN_STRING(date, 1);
@@ -443,7 +443,7 @@ PHP_FUNCTION(jdtogregorian)
convert_to_long_ex(day);
convert_to_long_ex(year);
- jdate = FrenchToSdn((*year)->value.lval, (*month)->value.lval, (*day)->value.lval);
+ jdate = FrenchToSdn(Z_LVAL_PP(year), Z_LVAL_PP(month), Z_LVAL_PP(day));
RETURN_LONG(jdate);
}
@@ -465,10 +465,10 @@ PHP_FUNCTION(jdtogregorian)
convert_to_long(julday);
if(myargc==2) {
convert_to_long(mode);
- mymode = mode->value.lval;
+ mymode = Z_LVAL_P(mode);
}
- day = DayOfWeek(julday->value.lval);
+ day = DayOfWeek(Z_LVAL_P(julday));
daynamel = DayNameLong[day];
daynames = DayNameShort[day];
@@ -502,30 +502,30 @@ PHP_FUNCTION(jdtogregorian)
convert_to_long_ex(julday);
convert_to_long_ex(mode);
- switch((*mode)->value.lval) {
+ switch(Z_LVAL_PP(mode)) {
case CAL_MONTH_GREGORIAN_LONG: /* gregorian or julian month */
- SdnToGregorian((*julday)->value.lval, &year, &month, &day);
+ SdnToGregorian(Z_LVAL_PP(julday), &year, &month, &day);
monthname = MonthNameLong[month];
break;
case CAL_MONTH_JULIAN_SHORT: /* gregorian or julian month */
- SdnToJulian((*julday)->value.lval, &year, &month, &day);
+ SdnToJulian(Z_LVAL_PP(julday), &year, &month, &day);
monthname = MonthNameShort[month];
break;
case CAL_MONTH_JULIAN_LONG: /* gregorian or julian month */
- SdnToJulian((*julday)->value.lval, &year, &month, &day);
+ SdnToJulian(Z_LVAL_PP(julday), &year, &month, &day);
monthname = MonthNameLong[month];
break;
case CAL_MONTH_JEWISH: /* jewish month */
- SdnToJewish((*julday)->value.lval, &year, &month, &day);
+ SdnToJewish(Z_LVAL_PP(julday), &year, &month, &day);
monthname = JewishMonthName[month];
break;
case CAL_MONTH_FRENCH: /* french month */
- SdnToFrench((*julday)->value.lval, &year, &month, &day);
+ SdnToFrench(Z_LVAL_PP(julday), &year, &month, &day);
monthname = FrenchMonthName[month];
break;
default: /* default gregorian */
case CAL_MONTH_GREGORIAN_SHORT: /* gregorian or julian month */
- SdnToGregorian((*julday)->value.lval, &year, &month, &day);
+ SdnToGregorian(Z_LVAL_PP(julday), &year, &month, &day);
monthname = MonthNameShort[month];
break;
}
diff --git a/ext/calendar/easter.c b/ext/calendar/easter.c
index 70c9dbffc9..525cb15bcc 100644
--- a/ext/calendar/easter.c
+++ b/ext/calendar/easter.c
@@ -45,7 +45,7 @@ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, int gm)
WRONG_PARAM_COUNT;
}
convert_to_long(year_arg);
- year = year_arg->value.lval;
+ year = Z_LVAL_P(year_arg);
break;
default:
WRONG_PARAM_COUNT;
@@ -109,12 +109,12 @@ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, int gm)
te.tm_mday = easter-10;
}
- return_value->value.lval = mktime(&te);
+ Z_LVAL_P(return_value) = mktime(&te);
} else { /* return the days after March 21 */
- return_value->value.lval = easter;
+ Z_LVAL_P(return_value) = easter;
}
- return_value->type = IS_LONG;
+ Z_TYPE_P(return_value) = IS_LONG;
}