From 29b0798cc8ecf8c150dcb7befb98f052965e6d5f Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Tue, 27 Jun 2006 21:00:03 +0000 Subject: [PATCH] revert per Derick request --- ext/date/lib/dow.c | 12 ++++++------ ext/date/lib/parse_tz.c | 6 +++--- ext/date/lib/timezonedb.h | 6 +++--- ext/date/php_date.c | 20 ++++++++++---------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/ext/date/lib/dow.c b/ext/date/lib/dow.c index ca66313a55..af0353fdbf 100644 --- a/ext/date/lib/dow.c +++ b/ext/date/lib/dow.c @@ -20,8 +20,8 @@ #include "timelib.h" -static const int m_table_common[13] = { -1, 0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */ -static const int m_table_leap[13] = { -1, 6, 2, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */ +static int m_table_common[13] = { -1, 0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */ +static int m_table_leap[13] = { -1, 6, 2, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */ static timelib_sll century_value(timelib_sll j) { @@ -62,10 +62,10 @@ timelib_sll timelib_iso_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d) } /* jan feb mar apr may jun jul aug sep oct nov dec */ -static const int d_table_common[13] = { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; -static const int d_table_leap[13] = { 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 }; -static const int ml_table_common[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; -static const int ml_table_leap[13] = { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; +static int d_table_common[13] = { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; +static int d_table_leap[13] = { 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 }; +static int ml_table_common[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; +static int ml_table_leap[13] = { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; timelib_sll timelib_day_of_year(timelib_sll y, timelib_sll m, timelib_sll d) { diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c index 46ddb9786d..d4e6014b17 100644 --- a/ext/date/lib/parse_tz.c +++ b/ext/date/lib/parse_tz.c @@ -240,8 +240,8 @@ const timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *c int timelib_timezone_id_is_valid(char *timezone, const timelib_tzdb *tzdb) { - const unsigned char *tzf; - return (seek_to_tz_position(&tzf, timezone, tzdb)); + unsigned char *tzf; + return (seek_to_tz_position((unsigned char**) &tzf, timezone, tzdb)); } timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb) @@ -249,7 +249,7 @@ timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb) const unsigned char *tzf; timelib_tzinfo *tmp; - if (seek_to_tz_position(&tzf, timezone, tzdb)) { + if (seek_to_tz_position((unsigned char**) &tzf, timezone, tzdb)) { tmp = timelib_tzinfo_ctor(timezone); read_header((char**) &tzf, tmp); diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h index 4dbe789ed9..ce06e9ea13 100644 --- a/ext/date/lib/timezonedb.h +++ b/ext/date/lib/timezonedb.h @@ -1,4 +1,4 @@ -static const timelib_tzdb_index_entry timezonedb_idx_builtin[538] = { +const timelib_tzdb_index_entry timezonedb_idx_builtin[538] = { { "Africa/Abidjan" , 0x000000 }, { "Africa/Accra" , 0x000049 }, { "Africa/Addis_Ababa" , 0x0000E5 }, @@ -539,7 +539,7 @@ static const timelib_tzdb_index_entry timezonedb_idx_builtin[538] = { { "Zulu" , 0x03904E }, }; /* This is a generated file, do not modify */ -static const unsigned char timelib_timezone_db_data_builtin[233606] = { +const unsigned char timelib_timezone_db_data_builtin[233606] = { /* Africa/Abidjan */ @@ -16492,4 +16492,4 @@ static const unsigned char timelib_timezone_db_data_builtin[233606] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, }; -static const timelib_tzdb timezonedb_builtin = { "2006.1", 538, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; +const timelib_tzdb timezonedb_builtin = { "2006.1", 538, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 39074111d9..1184a10bc6 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -230,8 +230,8 @@ ZEND_DECLARE_MODULE_GLOBALS(date) static PHP_GINIT_FUNCTION(date); /* True global */ -static timelib_tzdb *php_date_global_timezone_db; -static int php_date_global_timezone_db_enabled; +timelib_tzdb *php_date_global_timezone_db; +int php_date_global_timezone_db_enabled; #define DATE_DEFAULT_LATITUDE "31.7667" #define DATE_DEFAULT_LONGITUDE "35.2333" @@ -637,25 +637,25 @@ PHPAPI timelib_tzinfo *get_timezone_info(TSRMLS_D) /* {{{ date() and gmdate() data */ #include "ext/standard/php_smart_str.h" -static const char *mon_full_names[] = { +static char *mon_full_names[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; -static const char *mon_short_names[] = { +static char *mon_short_names[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -static const char *day_full_names[] = { +static char *day_full_names[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; -static const char *day_short_names[] = { +static char *day_short_names[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; -static const char *english_suffix(timelib_sll number) +static char *english_suffix(timelib_sll number) { if (number >= 10 && number <= 19) { return "th"; @@ -671,16 +671,16 @@ static const char *english_suffix(timelib_sll number) /* }}} */ /* {{{ day of week helpers */ -static const char *php_date_full_day_name(timelib_sll y, timelib_sll m, timelib_sll d) +char *php_date_full_day_name(timelib_sll y, timelib_sll m, timelib_sll d) { timelib_sll day_of_week = timelib_day_of_week(y, m, d); if (day_of_week < 0) { return "Unknown"; } - return day_full_names[day_of_week]; + return day_full_names[day_of_week]; } -static const char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d) +char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d) { timelib_sll day_of_week = timelib_day_of_week(y, m, d); if (day_of_week < 0) { -- 2.50.1