summaryrefslogtreecommitdiff
path: root/libsoup/soup-date.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2008-02-09 05:08:29 +0000
committerDan Winship <danw@src.gnome.org>2008-02-09 05:08:29 +0000
commit419aa03177361d7ccc8c51f5838193bf7b69aa77 (patch)
tree5fbf6b7476b267c956adcb172ad17d91f226d27a /libsoup/soup-date.c
parent801cefbcf058518a60360e1297c63b482e267655 (diff)
downloadlibsoup-419aa03177361d7ccc8c51f5838193bf7b69aa77.tar.gz
mark the DES magic number arrays const
* libsoup/soup-auth-manager-ntlm.c: mark the DES magic number arrays const * libsoup/soup-date.c (months, days): add an extra "const" to each of these declarations, as one "const" is apparently not enough. (soup_date_to_time_t): remove redundant copy of days_before array. * libsoup/soup-dns.c (soup_dns_init): use g_once_init_enter/leave * libsoup/soup-gnutls.c (soup_ssl_supported) (soup_gnutls_channel_funcs): Mark these const (soup_gnutls_init, init_dh_params): Use g_once_init_enter/leave * libsoup/soup-status.c (reason_phrases): mark this const * tests/ssl-test.c: Remove the workaround for soup_gnutls_init() not being thread-safe, since it is now. svn path=/trunk/; revision=1080
Diffstat (limited to 'libsoup/soup-date.c')
-rw-r--r--libsoup/soup-date.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libsoup/soup-date.c b/libsoup/soup-date.c
index beffc967..ba616d7e 100644
--- a/libsoup/soup-date.c
+++ b/libsoup/soup-date.c
@@ -37,13 +37,13 @@
**/
/* Do not internationalize */
-static const char *months[] = {
+static const char *const months[] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
/* Do not internationalize */
-static const char *days[] = {
+static const char *const days[] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
@@ -513,9 +513,6 @@ time_t
soup_date_to_time_t (SoupDate *date)
{
time_t tt;
- static const int days_before[] = {
- 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
- };
/* FIXME: offset, etc */
@@ -533,7 +530,7 @@ soup_date_to_time_t (SoupDate *date)
tt = (date->year - 1970) * 365;
tt += (date->year - 1968) / 4;
- tt += days_before[date->month - 1] + date->day - 1;
+ tt += days_before[date->month] + date->day - 1;
if (date->year % 4 == 0 && date->month <= 2)
tt--;
tt = ((((tt * 24) + date->hour) * 60) + date->minute) * 60 + date->second;