From ed970381fb914c413b88718bb7756b0f1282cfad Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sat, 10 Nov 2012 18:26:45 +0100 Subject: Eliminate some more warnings and hide less warnings in VS --- src/common/cfgfiles.c | 49 +++++++++++++++++++++++++++++--------------- src/common/common-xp.vcxproj | 2 +- src/common/common.vcxproj | 2 +- src/common/outbound.c | 3 ++- src/common/server.c | 12 ++++++++--- src/fe-gtk/fe-gtk-xp.vcxproj | 2 +- src/fe-gtk/fe-gtk.vcxproj | 2 +- src/fe-gtk/setup.c | 9 +++++--- 8 files changed, 53 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index a4d272bf..516de473 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c @@ -45,7 +45,8 @@ void list_addentry (GSList ** list, char *cmd, char *name) { struct popup *pop; - int cmd_len = 1, name_len; + size_t name_len; + size_t cmd_len = 1; /* remove <2.8.0 stuff */ if (!strcmp (cmd, "away") && !strcmp (name, "BACK")) @@ -909,35 +910,49 @@ save_config (void) static void set_showval (session *sess, const struct prefs *var, char *tbuf) { - int len, dots, j; + size_t len; + size_t dots; + size_t j; len = strlen (var->name); memcpy (tbuf, var->name, len); dots = 29 - len; + if (dots < 0) + { dots = 0; + } + tbuf[len++] = '\003'; tbuf[len++] = '2'; - for (j=0;jtype) { - case TYPE_STR: - sprintf (tbuf + len, "\0033:\017 %s\n", - (char *) &prefs + var->offset); - break; - case TYPE_INT: - sprintf (tbuf + len, "\0033:\017 %d\n", - *((int *) &prefs + var->offset)); - break; - case TYPE_BOOL: - if (*((int *) &prefs + var->offset)) - sprintf (tbuf + len, "\0033:\017 %s\n", "ON"); - else - sprintf (tbuf + len, "\0033:\017 %s\n", "OFF"); - break; + case TYPE_STR: + sprintf (tbuf + len, "\0033:\017 %s\n", (char *) &prefs + var->offset); + break; + case TYPE_INT: + sprintf (tbuf + len, "\0033:\017 %d\n", *((int *) &prefs + var->offset)); + break; + case TYPE_BOOL: + if (*((int *) &prefs + var->offset)) + { + sprintf (tbuf + len, "\0033:\017 %s\n", "ON"); + } + else + { + sprintf (tbuf + len, "\0033:\017 %s\n", "OFF"); + } + break; } + PrintText (sess, tbuf); } diff --git a/src/common/common-xp.vcxproj b/src/common/common-xp.vcxproj index 9d0be560..2b5979b6 100644 --- a/src/common/common-xp.vcxproj +++ b/src/common/common-xp.vcxproj @@ -127,7 +127,7 @@ WIN32;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions) $(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories) true - 4244;4267 + Windows diff --git a/src/common/common.vcxproj b/src/common/common.vcxproj index f750e947..60267b2d 100644 --- a/src/common/common.vcxproj +++ b/src/common/common.vcxproj @@ -124,7 +124,7 @@ WIN32;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions) $(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories) true - 4244;4267;4996 + 4996 Windows diff --git a/src/common/outbound.c b/src/common/outbound.c index 4e6846e3..05910df9 100644 --- a/src/common/outbound.c +++ b/src/common/outbound.c @@ -4241,7 +4241,8 @@ handle_say (session *sess, char *text, int check_spch) if (strlen (text) > max) { - int i = 0, size; + unsigned int i = 0; + int size; /* traverse the utf8 string and find the nearest cut point that doesn't split 1 char in half */ diff --git a/src/common/server.c b/src/common/server.c index 6c4b3543..360fb2c6 100644 --- a/src/common/server.c +++ b/src/common/server.c @@ -1379,15 +1379,21 @@ base64_encode (char *to, char *from, unsigned int len) } if (len) { - char three[3]={0,0,0}; - int i=0; - for (i=0;iWIN32;NDEBUG;_WINDOWS;$(OwnFlags);%(PreprocessorDefinitions) $(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories) true - 4244;4267 + 4244 Windows diff --git a/src/fe-gtk/fe-gtk.vcxproj b/src/fe-gtk/fe-gtk.vcxproj index 0bc479c7..45abf752 100644 --- a/src/fe-gtk/fe-gtk.vcxproj +++ b/src/fe-gtk/fe-gtk.vcxproj @@ -62,7 +62,7 @@ WIN32;NDEBUG;_WINDOWS;$(OwnFlags);%(PreprocessorDefinitions) $(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories) true - 4244;4267;4996 + 4244;4996 Windows diff --git a/src/fe-gtk/setup.c b/src/fe-gtk/setup.c index d3964557..7f6e37ff 100644 --- a/src/fe-gtk/setup.c +++ b/src/fe-gtk/setup.c @@ -837,9 +837,12 @@ setup_hscale_cb (GtkHScale *wid, const setting *set) { static int tag = 0; - setup_set_int (&setup_prefs, set, gtk_range_get_value(GTK_RANGE(wid))); - if(tag == 0) - tag = g_idle_add ((GSourceFunc)setup_apply_tint, &tag); + setup_set_int (&setup_prefs, set, (int) gtk_range_get_value (GTK_RANGE (wid))); + + if (tag == 0) + { + tag = g_idle_add ((GSourceFunc) setup_apply_tint, &tag); + } } static void -- cgit 1.4.1