<orage:master> 4.7.6.3: Fixed bug 6290 garbage displayed in “GMT Offset” in timezone config

Juha Kautto noreply at xfce.org
Fri Dec 10 15:34:01 CET 2010


Updating branch refs/heads/master
         to bfe573f76da9087c66f6b634b55c77290c90b0e5 (commit)
       from 544de244c1537182c916de360198fbfc8b068e96 (commit)

commit bfe573f76da9087c66f6b634b55c77290c90b0e5
Author: Juha Kautto <juha at xfce.org>
Date:   Fri Dec 10 17:02:02 2010 +0200

    4.7.6.3: Fixed bug 6290 garbage displayed in “GMT Offset” in timezone config
    
    This problem happened in 64 systems. Fixed by using int instead of long.

 configure.in.in                 |    2 +-
 globaltime/tz_zoneinfo_read.c   |   18 +++++++++---------
 panel-plugin/tz_zoneinfo_read.c |   18 +++++++++---------
 src/tz_zoneinfo_read.c          |   18 +++++++++---------
 tz_convert/tz_convert.c         |   21 +++++++++++----------
 5 files changed, 39 insertions(+), 38 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index a9129f0..e20edf7 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -9,7 +9,7 @@ dnl Written for Xfce by Juha Kautto <juha at xfce.org>
 dnl
 
 dnl Version information
-m4_define([orage_version], [4.7.6.2-git])
+m4_define([orage_version], [4.7.6.3-git])
 
 m4_define([gtk_minimum_version], [2.10.0])
 m4_define([xfce_minimum_version], [4.6.0])
diff --git a/globaltime/tz_zoneinfo_read.c b/globaltime/tz_zoneinfo_read.c
index 31d2ab1..f285b0d 100644
--- a/globaltime/tz_zoneinfo_read.c
+++ b/globaltime/tz_zoneinfo_read.c
@@ -154,14 +154,14 @@ static void read_file(const char *file_name, const struct stat *file_stat)
         printf("read_file: end\n");
 }
 
-static long get_long()
+static int get_long()
 {
-    unsigned long tmp;
+    int tmp;
 
-    tmp = (((long)in_head[0]<<24)
-         + ((long)in_head[1]<<16)
-         + ((long)in_head[2]<<8)
-         +  (long)in_head[3]);
+    tmp = (((int)in_head[0]<<24)
+         + ((int)in_head[1]<<16)
+         + ((int)in_head[2]<<8)
+         +  (int)in_head[3]);
     in_head += 4;
     return(tmp);
 }
@@ -200,7 +200,7 @@ static int process_header()
 
 static void process_local_time_table()
 { /* points when time changes */
-    unsigned long tmp;
+    time_t tmp;
     int i;
 
     begin_timechanges = in_head;
@@ -209,9 +209,9 @@ static void process_local_time_table()
     for (i = 0; i < timecnt; i++) {
         tmp = get_long();
         if (debug > 3) {
-            printf("GMT %d: %lu =  %s", i, tmp
+            printf("GMT %d: %d =  %s", i, (int)tmp
                     , asctime(gmtime((const time_t*)&tmp)));
-            printf("\tLOC %d: %lu =  %s", i, tmp
+            printf("\tLOC %d: %d =  %s", i, (int)tmp
                     , asctime(localtime((const time_t*)&tmp)));
         }
     }
diff --git a/panel-plugin/tz_zoneinfo_read.c b/panel-plugin/tz_zoneinfo_read.c
index d029177..b70a181 100644
--- a/panel-plugin/tz_zoneinfo_read.c
+++ b/panel-plugin/tz_zoneinfo_read.c
@@ -154,14 +154,14 @@ static void read_file(const char *file_name, const struct stat *file_stat)
         printf("read_file: end\n");
 }
 
-static long get_long()
+static int get_long()
 {
-    unsigned long tmp;
+    int tmp;
 
-    tmp = (((long)in_head[0]<<24)
-         + ((long)in_head[1]<<16)
-         + ((long)in_head[2]<<8)
-         +  (long)in_head[3]);
+    tmp = (((int)in_head[0]<<24)
+         + ((int)in_head[1]<<16)
+         + ((int)in_head[2]<<8)
+         +  (int)in_head[3]);
     in_head += 4;
     return(tmp);
 }
@@ -200,7 +200,7 @@ static int process_header()
 
 static void process_local_time_table()
 { /* points when time changes */
-    unsigned long tmp;
+    time_t tmp;
     int i;
 
     begin_timechanges = in_head;
@@ -209,9 +209,9 @@ static void process_local_time_table()
     for (i = 0; i < timecnt; i++) {
         tmp = get_long();
         if (debug > 3) {
-            printf("GMT %d: %lu =  %s", i, tmp
+            printf("GMT %d: %d =  %s", i, (int)tmp
                     , asctime(gmtime((const time_t*)&tmp)));
-            printf("\tLOC %d: %lu =  %s", i, tmp
+            printf("\tLOC %d: %d =  %s", i, (int)tmp
                     , asctime(localtime((const time_t*)&tmp)));
         }
     }
diff --git a/src/tz_zoneinfo_read.c b/src/tz_zoneinfo_read.c
index c665fec..8196df8 100644
--- a/src/tz_zoneinfo_read.c
+++ b/src/tz_zoneinfo_read.c
@@ -154,14 +154,14 @@ static void read_file(const char *file_name, const struct stat *file_stat)
         printf("read_file: end\n");
 }
 
-static long get_long()
+static int get_long()
 {
-    unsigned long tmp;
+    int tmp;
 
-    tmp = (((long)in_head[0]<<24)
-         + ((long)in_head[1]<<16)
-         + ((long)in_head[2]<<8)
-         +  (long)in_head[3]);
+    tmp = (((int)in_head[0]<<24)
+         + ((int)in_head[1]<<16)
+         + ((int)in_head[2]<<8)
+         +  (int)in_head[3]);
     in_head += 4;
     return(tmp);
 }
@@ -200,7 +200,7 @@ static int process_header()
 
 static void process_local_time_table()
 { /* points when time changes */
-    unsigned long tmp;
+    time_t tmp;
     int i;
 
     begin_timechanges = in_head;
@@ -209,9 +209,9 @@ static void process_local_time_table()
     for (i = 0; i < timecnt; i++) {
         tmp = get_long();
         if (debug > 3) {
-            printf("GMT %d: %lu =  %s", i, tmp
+            printf("GMT %d: %d =  %s", i, (int)tmp
                     , asctime(gmtime((const time_t*)&tmp)));
-            printf("\tLOC %d: %lu =  %s", i, tmp
+            printf("\tLOC %d: %d =  %s", i, (int)tmp
                     , asctime(localtime((const time_t*)&tmp)));
         }
     }
diff --git a/tz_convert/tz_convert.c b/tz_convert/tz_convert.c
index 903c6bb..08dacc8 100644
--- a/tz_convert/tz_convert.c
+++ b/tz_convert/tz_convert.c
@@ -141,14 +141,14 @@ void read_file(const char *file_name, const struct stat *file_stat)
         printf("read_file: end\n");
 }
 
-long get_long()
+int get_long()
 {
-    unsigned long tmp;
+    int tmp;
 
-    tmp = (((long)in_head[0]<<24)
-         + ((long)in_head[1]<<16)
-         + ((long)in_head[2]<<8)
-         +  (long)in_head[3]);
+    tmp = (((int)in_head[0]<<24)
+         + ((int)in_head[1]<<16)
+         + ((int)in_head[2]<<8)
+         +  (int)in_head[3]);
     in_head += 4;
     return(tmp);
 }
@@ -187,7 +187,7 @@ int process_header()
 
 void process_local_time_table()
 { /* points when time changes */
-    unsigned long tmp;
+    time_t tmp;
     int i;
 
     begin_timechanges = in_head;
@@ -196,9 +196,9 @@ void process_local_time_table()
     for (i = 0; i < timecnt; i++) {
         tmp = get_long();
         if (debug > 3) {
-            printf("GMT %d: %lu =  %s", i, tmp
+            printf("GMT %d: %d =  %s", i, (int)tmp
                     , asctime(gmtime((const time_t*)&tmp)));
-            printf("\tLOC %d: %lu =  %s", i, tmp
+            printf("\tLOC %d: %d =  %s", i, (int)tmp
                     , asctime(localtime((const time_t*)&tmp)));
         }
     }
@@ -252,7 +252,8 @@ void process_abbr_table()
     tmp = in_head;
     for (i = 0; i < charcnt; i++) { /* we need to walk over the table */
         if (debug > 3)
-            printf("Abbr:%d (%d)(%s)\n", i, strlen((char *)(tmp + i)), tmp + i);
+            printf("Abbr:%d (%d)(%s)\n", i, (int)strlen((char *)(tmp + i))
+                    , tmp + i);
         i += strlen((char *)(tmp + i));
     }
     in_head += charcnt;



More information about the Xfce4-commits mailing list