summaryrefslogtreecommitdiff
path: root/src/core/screen.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-02-03 13:39:55 +0100
committerraveit65 <[email protected]>2020-02-21 17:31:50 +0100
commit3b6919c5eafb76f36f240f8c5651698539860853 (patch)
treeba8ada86c24155c94aca9ade30d194eebec7adfc /src/core/screen.c
parent7ffa17976ba5d0549ac2fb8a81c65dd19aac3767 (diff)
downloadmarco-3b6919c5eafb76f36f240f8c5651698539860853.tar.bz2
marco-3b6919c5eafb76f36f240f8c5651698539860853.tar.xz
remove warning: 'GTimeVal' is deprecated
Diffstat (limited to 'src/core/screen.c')
-rw-r--r--src/core/screen.c16
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);