diff options
author | Nuno Lopes <nlopess@php.net> | 2006-06-27 19:48:01 +0000 |
---|---|---|
committer | Nuno Lopes <nlopess@php.net> | 2006-06-27 19:48:01 +0000 |
commit | 5c97837ca201bd9b8d8f8cd4f84685f097b933cc (patch) | |
tree | 39b5a8669bd0bec53dea5ee310ae97f69ea0b897 /ext/date/lib/dow.c | |
parent | 7dec2a73540771eb548389b94b4d70ad19ffd54e (diff) | |
download | php-git-5c97837ca201bd9b8d8f8cd4f84685f097b933cc.tar.gz |
add a couple of static and const keywords, to let the compiler optimize better
will MFB in a hour, or so
Diffstat (limited to 'ext/date/lib/dow.c')
-rw-r--r-- | ext/date/lib/dow.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/date/lib/dow.c b/ext/date/lib/dow.c index af0353fdbf..ca66313a55 100644 --- a/ext/date/lib/dow.c +++ b/ext/date/lib/dow.c @@ -20,8 +20,8 @@ #include "timelib.h" -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 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 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 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 }; +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 }; timelib_sll timelib_day_of_year(timelib_sll y, timelib_sll m, timelib_sll d) { |