remove GTimeVal following glib 2.61.2 deprecation

This commit is contained in:
ailin-nemui 2019-12-06 10:56:25 +01:00
commit 1cdb4bc311
14 changed files with 74 additions and 69 deletions

View file

@ -94,8 +94,11 @@ int g_input_add_poll(int fd, int priority, int condition,
return ret;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
int g_timeval_cmp(const GTimeVal *tv1, const GTimeVal *tv2)
{
#pragma GCC diagnostic pop
if (tv1->tv_sec < tv2->tv_sec)
return -1;
if (tv1->tv_sec > tv2->tv_sec)
@ -105,8 +108,11 @@ int g_timeval_cmp(const GTimeVal *tv1, const GTimeVal *tv2)
tv1->tv_usec > tv2->tv_usec ? 1 : 0;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
long get_timeval_diff(const GTimeVal *tv1, const GTimeVal *tv2)
{
#pragma GCC diagnostic pop
long secs, usecs;
secs = tv1->tv_sec - tv2->tv_sec;

View file

@ -11,11 +11,14 @@ int g_input_add_poll(int fd, int priority, int condition,
typedef void* (*FOREACH_FIND_FUNC) (void *item, void *data);
typedef int (*COLUMN_LEN_FUNC)(void *data);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
/* Returns 1 if tv1 > tv2, -1 if tv2 > tv1 or 0 if they're equal. */
int g_timeval_cmp(const GTimeVal *tv1, const GTimeVal *tv2);
int g_timeval_cmp(const GTimeVal *tv1, const GTimeVal *tv2) G_GNUC_DEPRECATED;
/* Returns "tv1 - tv2", returns the result in milliseconds. Note that
if the difference is too large, the result might be invalid. */
long get_timeval_diff(const GTimeVal *tv1, const GTimeVal *tv2);
long get_timeval_diff(const GTimeVal *tv1, const GTimeVal *tv2) G_GNUC_DEPRECATED;
#pragma GCC diagnostic pop
GSList *gslist_find_string(GSList *list, const char *key);
GSList *gslist_find_icase_string(GSList *list, const char *key);

View file

@ -37,7 +37,7 @@ unsigned int usermode_away:1;
unsigned int banned:1; /* not allowed to connect to this server */
unsigned int dns_error:1; /* DNS said the host doesn't exist */
GTimeVal lag_sent; /* 0 or time when last lag query was sent to server */
gint64 lag_sent; /* 0 or time when last lag query was sent to server */
time_t lag_last_check; /* last time we checked lag */
int lag; /* server lag in milliseconds */