diff options
author | Matthias Clasen <mclasen@redhat.com> | 2007-06-08 18:39:29 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2007-06-08 18:39:29 +0000 |
commit | 387ed45e9ea8689c647cf34bcbd6e171bcb6df84 (patch) | |
tree | 6676315fa1f87f53acde942c38c892947fc35a90 | |
parent | 705d6545e56f779ac7da80d86a10b58a224d691c (diff) | |
download | gtk+-387ed45e9ea8689c647cf34bcbd6e171bcb6df84.tar.gz |
Handle return values from nl_langinfo() more correctly.
2007-06-09 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcalendar.c (gtk_calendar_init): Handle return values
from nl_langinfo() more correctly.
svn path=/trunk/; revision=18085
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | gtk/gtkcalendar.c | 10 |
2 files changed, 10 insertions, 5 deletions
@@ -1,3 +1,8 @@ +2007-06-09 Matthias Clasen <mclasen@redhat.com> + + * gtk/gtkcalendar.c (gtk_calendar_init): Handle return values + from nl_langinfo() more correctly. + 2007-06-09 Carlos Garnacho <carlos@imendio.com> * gtk/gtkrc.c (gtk_rc_parse_engine): initialize rc_priv in the else diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index 1b6f0f18e7..dc32cba7a8 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -568,7 +568,7 @@ gtk_calendar_init (GtkCalendar *calendar) GtkCalendarPrivate *priv; gchar *year_before; #ifdef HAVE__NL_TIME_FIRST_WEEKDAY - gchar *langinfo; + union { unsigned int word; char *string; } langinfo; gint week_1stday = 0; gint first_weekday = 1; guint week_origin; @@ -688,10 +688,10 @@ gtk_calendar_init (GtkCalendar *calendar) } #else #ifdef HAVE__NL_TIME_FIRST_WEEKDAY - langinfo = nl_langinfo (_NL_TIME_FIRST_WEEKDAY); - first_weekday = langinfo[0]; - langinfo = nl_langinfo (_NL_TIME_WEEK_1STDAY); - week_origin = GPOINTER_TO_INT (langinfo); + langinfo.string = nl_langinfo (_NL_TIME_FIRST_WEEKDAY); + first_weekday = langinfo.string[0]; + langinfo.string = nl_langinfo (_NL_TIME_WEEK_1STDAY); + week_origin = langinfo.word; if (week_origin == 19971130) /* Sunday */ week_1stday = 0; else if (week_origin == 19971201) /* Monday */ |