don't cast to timeval since timeval is for some reason not always a struct
authorGeorge Lebl <jirka@5z.com>
Wed, 23 Dec 1998 12:18:36 +0000 (12:18 +0000)
committerGeorge Lebl <jirka@src.gnome.org>
Wed, 23 Dec 1998 12:18:36 +0000 (12:18 +0000)
Wed Dec 23 04:18:11 1998  George Lebl  <jirka@5z.com>

        * gmain.c: (g_get_current_time) don't cast to timeval since
          timeval is for some reason not always a struct of longs, weird

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/gmain.c
gmain.c

index 1daff07..9f188aa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Dec 23 04:18:11 1998  George Lebl  <jirka@5z.com>
+
+       * gmain.c: (g_get_current_time) don't cast to timeval since
+         timeval is for some reason not always a struct of longs, weird
+
 Tue Dec 22 10:32:11 1998  Tim Janik  <timj@gtk.org>
 
        * ghook.c (g_hook_first_valid): fixed buglet that could cause bogus
index 1daff07..9f188aa 100644 (file)
@@ -1,3 +1,8 @@
+Wed Dec 23 04:18:11 1998  George Lebl  <jirka@5z.com>
+
+       * gmain.c: (g_get_current_time) don't cast to timeval since
+         timeval is for some reason not always a struct of longs, weird
+
 Tue Dec 22 10:32:11 1998  Tim Janik  <timj@gtk.org>
 
        * ghook.c (g_hook_first_valid): fixed buglet that could cause bogus
index 1daff07..9f188aa 100644 (file)
@@ -1,3 +1,8 @@
+Wed Dec 23 04:18:11 1998  George Lebl  <jirka@5z.com>
+
+       * gmain.c: (g_get_current_time) don't cast to timeval since
+         timeval is for some reason not always a struct of longs, weird
+
 Tue Dec 22 10:32:11 1998  Tim Janik  <timj@gtk.org>
 
        * ghook.c (g_hook_first_valid): fixed buglet that could cause bogus
index 1daff07..9f188aa 100644 (file)
@@ -1,3 +1,8 @@
+Wed Dec 23 04:18:11 1998  George Lebl  <jirka@5z.com>
+
+       * gmain.c: (g_get_current_time) don't cast to timeval since
+         timeval is for some reason not always a struct of longs, weird
+
 Tue Dec 22 10:32:11 1998  Tim Janik  <timj@gtk.org>
 
        * ghook.c (g_hook_first_valid): fixed buglet that could cause bogus
index 1daff07..9f188aa 100644 (file)
@@ -1,3 +1,8 @@
+Wed Dec 23 04:18:11 1998  George Lebl  <jirka@5z.com>
+
+       * gmain.c: (g_get_current_time) don't cast to timeval since
+         timeval is for some reason not always a struct of longs, weird
+
 Tue Dec 22 10:32:11 1998  Tim Janik  <timj@gtk.org>
 
        * ghook.c (g_hook_first_valid): fixed buglet that could cause bogus
index 1daff07..9f188aa 100644 (file)
@@ -1,3 +1,8 @@
+Wed Dec 23 04:18:11 1998  George Lebl  <jirka@5z.com>
+
+       * gmain.c: (g_get_current_time) don't cast to timeval since
+         timeval is for some reason not always a struct of longs, weird
+
 Tue Dec 22 10:32:11 1998  Tim Janik  <timj@gtk.org>
 
        * ghook.c (g_hook_first_valid): fixed buglet that could cause bogus
index 1daff07..9f188aa 100644 (file)
@@ -1,3 +1,8 @@
+Wed Dec 23 04:18:11 1998  George Lebl  <jirka@5z.com>
+
+       * gmain.c: (g_get_current_time) don't cast to timeval since
+         timeval is for some reason not always a struct of longs, weird
+
 Tue Dec 22 10:32:11 1998  Tim Janik  <timj@gtk.org>
 
        * ghook.c (g_hook_first_valid): fixed buglet that could cause bogus
index 1daff07..9f188aa 100644 (file)
@@ -1,3 +1,8 @@
+Wed Dec 23 04:18:11 1998  George Lebl  <jirka@5z.com>
+
+       * gmain.c: (g_get_current_time) don't cast to timeval since
+         timeval is for some reason not always a struct of longs, weird
+
 Tue Dec 22 10:32:11 1998  Tim Janik  <timj@gtk.org>
 
        * ghook.c (g_hook_first_valid): fixed buglet that could cause bogus
index 2a5e25a..d5e3f84 100644 (file)
@@ -346,9 +346,14 @@ g_source_remove_by_source_data (gpointer source_data)
 void
 g_get_current_time (GTimeVal *result)
 {
+  struct timeval r;
   g_return_if_fail (result != NULL);
 
-  gettimeofday ((struct timeval *) result, NULL);
+  /*this is required on alpha, there the timeval structs are int's
+    not longs and a cast only would fail horribly*/
+  gettimeofday (&r, NULL);
+  result->tv_sec = r.tv_sec;
+  result->tv_usec = r.tv_usec;
 }
 
 /* Running the main loop */
diff --git a/gmain.c b/gmain.c
index 2a5e25a..d5e3f84 100644 (file)
--- a/gmain.c
+++ b/gmain.c
@@ -346,9 +346,14 @@ g_source_remove_by_source_data (gpointer source_data)
 void
 g_get_current_time (GTimeVal *result)
 {
+  struct timeval r;
   g_return_if_fail (result != NULL);
 
-  gettimeofday ((struct timeval *) result, NULL);
+  /*this is required on alpha, there the timeval structs are int's
+    not longs and a cast only would fail horribly*/
+  gettimeofday (&r, NULL);
+  result->tv_sec = r.tv_sec;
+  result->tv_usec = r.tv_usec;
 }
 
 /* Running the main loop */