From 78af10fa1f79b7b3b8162304f01a731be66640df Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Mon, 23 Jun 2014 10:57:27 +0200 Subject: [PATCH 1/2] Cast time to "time_t" --- src/friendlist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/friendlist.c b/src/friendlist.c index a1573de..7efe008 100644 --- a/src/friendlist.c +++ b/src/friendlist.c @@ -91,7 +91,7 @@ void sort_friendlist_index(void) static void update_friend_last_online(int32_t num, uint64_t timestamp) { friends[num].last_online.last_on = timestamp; - friends[num].last_online.tm = *localtime(×tamp); + friends[num].last_online.tm = *localtime((const time_t*)×tamp); /* if the format changes make sure TIME_STR_SIZE is the correct size */ const char *t = user_settings->time == TIME_12 ? "%I:%M %p" : "%H:%M"; @@ -383,7 +383,7 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m) getmaxyx(self->window, y2, x2); uint64_t cur_time = get_unix_time(); - struct tm cur_loc_tm = *localtime(&cur_time); + struct tm cur_loc_tm = *localtime((const time_t*)&cur_time); bool fix_statuses = x2 != self->x; /* true if window x axis has changed */ From cb93c6ec650cf0aad81b7ffd2482a8dbd4bbc89f Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Mon, 23 Jun 2014 10:58:24 +0200 Subject: [PATCH 2/2] Cast time to "time_t" --- src/misc_tools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc_tools.c b/src/misc_tools.c index 01cf96a..001ad88 100644 --- a/src/misc_tools.c +++ b/src/misc_tools.c @@ -55,7 +55,7 @@ struct tm *get_time(void) { struct tm *timeinfo; uint64_t t = get_unix_time(); - timeinfo = localtime(&t); + timeinfo = localtime((const time_t*)&t); return timeinfo; }