From 8062bce835681d8200666ad183fe8cf3f6d87468 Mon Sep 17 00:00:00 2001 From: Arnavion Date: Thu, 4 Dec 2014 04:06:38 -0800 Subject: Fix some obvious type warnings. --- src/common/hexchat.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/common/hexchat.c') diff --git a/src/common/hexchat.c b/src/common/hexchat.c index 5bb76f72..30e95ca9 100644 --- a/src/common/hexchat.c +++ b/src/common/hexchat.c @@ -260,7 +260,7 @@ lag_check (void) unsigned long tim; char tbuf[128]; time_t now = time (0); - int lag; + time_t lag; tim = make_ping_time (); @@ -270,14 +270,15 @@ lag_check (void) if (serv->connected && serv->end_of_motd) { lag = now - serv->ping_recv; - if (prefs.hex_net_ping_timeout && lag > prefs.hex_net_ping_timeout && lag > 0) + if (prefs.hex_net_ping_timeout != 0 && lag > prefs.hex_net_ping_timeout && lag > 0) { - sprintf (tbuf, "%d", lag); + sprintf (tbuf, "%" G_GINT64_FORMAT, (gint64) lag); EMIT_SIGNAL (XP_TE_PINGTIMEOUT, serv->server_session, tbuf, NULL, NULL, NULL, 0); if (prefs.hex_net_auto_reconnect) serv->auto_reconnect (serv, FALSE, -1); - } else + } + else { snprintf (tbuf, sizeof (tbuf), "LAG%lu", tim); serv->p_ping (serv, "", tbuf); @@ -396,7 +397,6 @@ irc_init (session *sess) { static int done_init = FALSE; char *buf; - int i; if (done_init) return; @@ -431,7 +431,8 @@ irc_init (session *sess) if (arg_urls != NULL) { - for (i = 0; i < g_strv_length(arg_urls); i++) + guint i; + for (i = 0; i < g_strv_length (arg_urls); i++) { buf = g_strdup_printf ("%s %s", i==0? "server" : "newserver", arg_urls[i]); handle_command (sess, buf, FALSE); @@ -1012,7 +1013,7 @@ main (int argc, char *argv[]) int i; int ret; - srand (time (0)); /* CL: do this only once! */ + srand ((unsigned int) time (NULL)); /* CL: do this only once! */ /* We must check for the config dir parameter, otherwise load_config() will behave incorrectly. * load_config() must come before fe_args() because fe_args() calls gtk_init() which needs to -- cgit 1.4.1