diff options
author | rbuj <[email protected]> | 2020-02-03 13:39:55 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2020-02-21 17:30:49 +0100 |
commit | db25f27fd3670e2ebc8ed6f6fa5f918a3251fc96 (patch) | |
tree | d101c7c47ceb828c7717273709be80cc99518aea /src/core/screen.c | |
parent | 9f9647d27b1d7d01b39241ee3a86f3dfc24196e0 (diff) | |
download | marco-db25f27fd3670e2ebc8ed6f6fa5f918a3251fc96.tar.bz2 marco-db25f27fd3670e2ebc8ed6f6fa5f918a3251fc96.tar.xz |
remove warning: 'GTimeVal' is deprecated
Diffstat (limited to 'src/core/screen.c')
-rw-r--r-- | src/core/screen.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/core/screen.c b/src/core/screen.c index 78a41d83..feaac951 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -2607,7 +2607,7 @@ remove_sequence (MetaScreen *screen, typedef struct { GSList *list; - GTimeVal now; + gint64 now; } CollectTimedOutData; /* This should be fairly long, as it should never be required unless @@ -2623,14 +2623,15 @@ collect_timed_out_foreach (void *element, { CollectTimedOutData *ctod = data; SnStartupSequence *sequence = element; - long tv_sec, tv_usec; double elapsed; - sn_startup_sequence_get_last_active_time (sequence, &tv_sec, &tv_usec); + time_t tv_sec; + suseconds_t tv_usec; + gint64 tv; - elapsed = - ((((double)ctod->now.tv_sec - tv_sec) * G_USEC_PER_SEC + - (ctod->now.tv_usec - tv_usec))) / 1000.0; + sn_startup_sequence_get_last_active_time (sequence, &tv_sec, &tv_usec); + tv = (tv_sec * G_USEC_PER_SEC) + tv_usec; + elapsed = (ctod->now - tv) / 1000.0; meta_topic (META_DEBUG_STARTUP, "Sequence used %g seconds vs. %g max: %s\n", @@ -2649,7 +2650,8 @@ startup_sequence_timeout (void *data) GSList *tmp; ctod.list = NULL; - g_get_current_time (&ctod.now); + + ctod.now = g_get_real_time (); g_slist_foreach (screen->startup_sequences, collect_timed_out_foreach, &ctod); |