aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-util
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@helixcode.com>2000-05-19 14:09:48 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2000-05-19 14:09:48 +0800
commit5cc159a95858af2e06484ac04cbf8c87369bd425 (patch)
tree7f6f18de7f54c965c087d91d7f77adf446c30601 /calendar/cal-util
parentbe42a2a28615168d66b5eaefa462b67cd8227761 (diff)
downloadgsoc2013-evolution-5cc159a95858af2e06484ac04cbf8c87369bd425.tar
gsoc2013-evolution-5cc159a95858af2e06484ac04cbf8c87369bd425.tar.gz
gsoc2013-evolution-5cc159a95858af2e06484ac04cbf8c87369bd425.tar.bz2
gsoc2013-evolution-5cc159a95858af2e06484ac04cbf8c87369bd425.tar.lz
gsoc2013-evolution-5cc159a95858af2e06484ac04cbf8c87369bd425.tar.xz
gsoc2013-evolution-5cc159a95858af2e06484ac04cbf8c87369bd425.tar.zst
gsoc2013-evolution-5cc159a95858af2e06484ac04cbf8c87369bd425.zip
Fixed warning message. (time_add_day): Likewise. (time_add_month):
2000-05-19 Federico Mena Quintero <federico@helixcode.com> * cal-util/timeutil.c (time_add_minutes): Fixed warning message. (time_add_day): Likewise. (time_add_month): Likewise. (time_add_year): Likewise. (time_from_day): Of all functions, *this* one had to have a bug. Set the tm.tm_isdst to -1 to specify that we don't know whether the time is in DST or not. This fixes *many* bugs upstream. (time_week_begin): Likewise. We never noticed this since the week functions are never used. (time_week_end): Likewise. svn path=/trunk/; revision=3135
Diffstat (limited to 'calendar/cal-util')
-rw-r--r--calendar/cal-util/timeutil.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/calendar/cal-util/timeutil.c b/calendar/cal-util/timeutil.c
index 2f9156a6f5..f887a8df37 100644
--- a/calendar/cal-util/timeutil.c
+++ b/calendar/cal-util/timeutil.c
@@ -109,7 +109,8 @@ time_add_minutes (time_t time, int minutes)
tm->tm_min += minutes;
if ((new_time = mktime (tm)) == -1){
- g_warning ("mktime could not handling adding a day with\n");
+ g_message ("time_add_minutes(): mktime() could not handle "
+ "adding %d minutes with\n", minutes);
print_time_t (time);
return time;
}
@@ -135,7 +136,8 @@ time_add_day (time_t time, int days)
tm->tm_mday += days;
if ((new_time = mktime (tm)) == -1){
- g_warning ("mktime could not handling adding a day with\n");
+ g_message ("time_add_day(): mktime() could not handling adding %d days with\n",
+ days);
print_time_t (time);
return time;
}
@@ -173,7 +175,8 @@ time_add_month (time_t time, int months)
tm->tm_mon += months;
tm->tm_isdst = -1;
if ((new_time = mktime (tm)) == -1){
- g_warning ("mktime could not handling adding a month with\n");
+ g_message ("time_add_month(): mktime() could not handling adding %d months with\n",
+ months);
print_time_t (time);
return time;
}
@@ -195,7 +198,8 @@ time_add_year (time_t time, int years)
tm->tm_year += years;
if ((new_time = mktime (tm)) == -1){
- g_warning ("mktime could not handling adding a year with\n");
+ g_message ("time_add_year(): mktime() could not handling adding %d years with\n",
+ years);
print_time_t (time);
return time;
}
@@ -249,6 +253,7 @@ time_from_day (int year, int month, int day)
tm.tm_year = year - 1900;
tm.tm_mon = month;
tm.tm_mday = day;
+ tm.tm_isdst = -1;
return mktime (&tm);
}
@@ -329,6 +334,7 @@ time_week_begin (time_t t)
tm.tm_min = 0;
tm.tm_sec = 0;
tm.tm_mday -= tm.tm_wday;
+ tm.tm_isdst = -1;
return mktime (&tm);
}
@@ -345,6 +351,7 @@ time_week_end (time_t t)
tm.tm_min = 0;
tm.tm_sec = 0;
tm.tm_mday += 7 - tm.tm_wday;
+ tm.tm_isdst = -1;
return mktime (&tm);
}