summary refs log tree commit diff stats
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/cfgfiles.c4
-rw-r--r--src/common/hexchat.c15
-rw-r--r--src/common/inbound.c3
-rw-r--r--src/common/modes.c8
-rw-r--r--src/common/proto-irc.c4
5 files changed, 18 insertions, 16 deletions
diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c
index 735bbfe2..12b66ac4 100644
--- a/src/common/cfgfiles.c
+++ b/src/common/cfgfiles.c
@@ -586,10 +586,10 @@ const struct prefs vars[] =
 	{0, 0, 0},
 };
 
-static char *
+static const char *
 convert_with_fallback (const char *str, const char *fallback)
 {
-	char *utf;
+	const char *utf;
 
 #ifndef WIN32
 	/* On non-Windows, g_get_user_name and g_get_real_name return a string in system locale, so convert it to utf-8. */
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
diff --git a/src/common/inbound.c b/src/common/inbound.c
index b80553b3..f7232ce4 100644
--- a/src/common/inbound.c
+++ b/src/common/inbound.c
@@ -682,7 +682,8 @@ inbound_nameslist (server *serv, char *chan, char *names,
 	char **name_list;
 	char *host, *nopre_name;
 	char name[NICKLEN];
-	int i, offset;
+	int i;
+	size_t offset;
 
 	sess = find_channel (serv, chan);
 	if (!sess)
diff --git a/src/common/modes.c b/src/common/modes.c
index b7cd471f..23f75b1d 100644
--- a/src/common/modes.c
+++ b/src/common/modes.c
@@ -677,10 +677,10 @@ handle_mode (server * serv, char *word[], char *word_eol[],
 	char *argstr;
 	char sign;
 	int len;
-	int arg;
-	int i, num_args;
+	size_t arg;
+	size_t i, num_args;
 	int num_modes;
-	int offset = 3;
+	size_t offset = 3;
 	int all_modes_have_args = FALSE;
 	int using_front_tab = FALSE;
 	mode_run mr;
@@ -762,7 +762,7 @@ handle_mode (server * serv, char *word[], char *word_eol[],
 			break;
 		default:
 			argstr = "";
-			if ((all_modes_have_args || mode_has_arg (serv, sign, *modes)) && arg < (num_args+1))
+			if ((all_modes_have_args || mode_has_arg (serv, sign, *modes)) && arg < (num_args + 1))
 			{
 				arg++;
 				argstr = word[arg + offset];
diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c
index 34b4ece1..2bfcb393 100644
--- a/src/common/proto-irc.c
+++ b/src/common/proto-irc.c
@@ -1355,8 +1355,8 @@ process_named_servermsg (session *sess, char *buf, char *rawname, char *word_eol
 /* Returns the timezone offset. This should be the same as the variable
  * "timezone" in time.h, but *BSD doesn't have it.
  */
-static int
-get_timezone(void)
+static time_t
+get_timezone (void)
 {
 	struct tm tm_utc, tm_local;
 	time_t t, time_utc, time_local;