From: George Lebl Date: Wed, 23 Dec 1998 12:18:36 +0000 (+0000) Subject: don't cast to timeval since timeval is for some reason not always a struct X-Git-Tag: GLIB_1_1_10~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4277349743343e0e2b608e8aa11e5bdb9f5acf1f;p=platform%2Fupstream%2Fglib.git 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 --- diff --git a/ChangeLog b/ChangeLog index 1daff07..9f188aa 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 1daff07..9f188aa 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 1daff07..9f188aa 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 1daff07..9f188aa 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 1daff07..9f188aa 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 1daff07..9f188aa 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 1daff07..9f188aa 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 1daff07..9f188aa 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 2a5e25a..d5e3f84 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 2a5e25a..d5e3f84 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 */