[gnome-calendar] utils: Cleanup first weekday function



commit 30ba757c403735b938a0c25ea602b104e31ebcde
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sun Jan 28 09:59:08 2018 -0200

    utils: Cleanup first weekday function

 src/gcal-utils.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/gcal-utils.c b/src/gcal-utils.c
index d5b93de4..9846a59b 100644
--- a/src/gcal-utils.c
+++ b/src/gcal-utils.c
@@ -407,16 +407,14 @@ gint
 get_first_weekday (void)
 {
   int week_start;
+
 #ifdef HAVE__NL_TIME_FIRST_WEEKDAY
+
   union { unsigned int word; char *string; } langinfo;
-  int week_1stday = 0;
-  int first_weekday = 1;
+  gint week_1stday = 0;
+  gint first_weekday = 1;
   guint week_origin;
-#else
-  char *gtk_week_start;
-#endif
 
-#ifdef HAVE__NL_TIME_FIRST_WEEKDAY
   langinfo.string = nl_langinfo (_NL_TIME_FIRST_WEEKDAY);
   first_weekday = langinfo.string[0];
   langinfo.string = nl_langinfo (_NL_TIME_WEEK_1STDAY);
@@ -429,7 +427,12 @@ get_first_weekday (void)
     g_warning ("Unknown value of _NL_TIME_WEEK_1STDAY.\n");
 
   week_start = (week_1stday + first_weekday - 1) % 7;
+
 #else
+
+  gchar *gtk_week_start;
+
+
   /* Use a define to hide the string from xgettext */
 # define GTK_WEEK_START "calendar:week_start:0"
   gtk_week_start = dgettext ("gtk30", GTK_WEEK_START);
@@ -445,6 +448,7 @@ get_first_weekday (void)
                  "did so wrongly.\n");
       week_start = 0;
     }
+
 #endif
 
   return week_start;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]