From 4277349743343e0e2b608e8aa11e5bdb9f5acf1f Mon Sep 17 00:00:00 2001 From: George Lebl Date: Wed, 23 Dec 1998 12:18:36 +0000 Subject: [PATCH] don't cast to timeval since timeval is for some reason not always a struct Wed Dec 23 04:18:11 1998 George Lebl * 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 | 5 +++++ ChangeLog.pre-2-0 | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-12 | 5 +++++ ChangeLog.pre-2-2 | 5 +++++ ChangeLog.pre-2-4 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ glib/gmain.c | 7 ++++++- gmain.c | 7 ++++++- 10 files changed, 52 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1daff076e..9f188aa8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Dec 23 04:18:11 1998 George Lebl + + * 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 * ghook.c (g_hook_first_valid): fixed buglet that could cause bogus diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 1daff076e..9f188aa8c 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,8 @@ +Wed Dec 23 04:18:11 1998 George Lebl + + * 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 * ghook.c (g_hook_first_valid): fixed buglet that could cause bogus diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 1daff076e..9f188aa8c 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Wed Dec 23 04:18:11 1998 George Lebl + + * 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 * ghook.c (g_hook_first_valid): fixed buglet that could cause bogus diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 1daff076e..9f188aa8c 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +Wed Dec 23 04:18:11 1998 George Lebl + + * 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 * ghook.c (g_hook_first_valid): fixed buglet that could cause bogus diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 1daff076e..9f188aa8c 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +Wed Dec 23 04:18:11 1998 George Lebl + + * 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 * ghook.c (g_hook_first_valid): fixed buglet that could cause bogus diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 1daff076e..9f188aa8c 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +Wed Dec 23 04:18:11 1998 George Lebl + + * 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 * ghook.c (g_hook_first_valid): fixed buglet that could cause bogus diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 1daff076e..9f188aa8c 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Wed Dec 23 04:18:11 1998 George Lebl + + * 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 * ghook.c (g_hook_first_valid): fixed buglet that could cause bogus diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 1daff076e..9f188aa8c 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Wed Dec 23 04:18:11 1998 George Lebl + + * 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 * ghook.c (g_hook_first_valid): fixed buglet that could cause bogus diff --git a/glib/gmain.c b/glib/gmain.c index 2a5e25a8d..d5e3f848f 100644 --- a/glib/gmain.c +++ b/glib/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 */ diff --git a/gmain.c b/gmain.c index 2a5e25a8d..d5e3f848f 100644 --- 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 */