diff options
-rw-r--r-- | src/common/cfgfiles.c | 49 | ||||
-rw-r--r-- | src/common/common-xp.vcxproj | 2 | ||||
-rw-r--r-- | src/common/common.vcxproj | 2 | ||||
-rw-r--r-- | src/common/outbound.c | 3 | ||||
-rw-r--r-- | src/common/server.c | 12 | ||||
-rw-r--r-- | src/fe-gtk/fe-gtk-xp.vcxproj | 2 | ||||
-rw-r--r-- | src/fe-gtk/fe-gtk.vcxproj | 2 | ||||
-rw-r--r-- | src/fe-gtk/setup.c | 9 |
8 files changed, 53 insertions, 28 deletions
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;j<dots;j++) + + for (j = 0; j < dots; j++) + { tbuf[j + len] = '.'; + } + len += j; + switch (var->type) { - 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 @@ <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <MultiProcessorCompilation>true</MultiProcessorCompilation> - <DisableSpecificWarnings>4244;4267</DisableSpecificWarnings> + <DisableSpecificWarnings></DisableSpecificWarnings> </ClCompile> <Link> <SubSystem>Windows</SubSystem> 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 @@ <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <MultiProcessorCompilation>true</MultiProcessorCompilation> - <DisableSpecificWarnings>4244;4267;4996</DisableSpecificWarnings> + <DisableSpecificWarnings>4996</DisableSpecificWarnings> </ClCompile> <Link> <SubSystem>Windows</SubSystem> 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;i<len;i++) + char three[3] = {0,0,0}; + unsigned int i; + for (i = 0; i < len; i++) + { three[i] = *from++; + } three_to_four (three, to); if (len == 1) + { to[2] = to[3] = '='; + } else if (len == 2) + { to[3] = '='; + } to += 4; }; to[0] = 0; diff --git a/src/fe-gtk/fe-gtk-xp.vcxproj b/src/fe-gtk/fe-gtk-xp.vcxproj index 753a71f0..94ebd4a0 100644 --- a/src/fe-gtk/fe-gtk-xp.vcxproj +++ b/src/fe-gtk/fe-gtk-xp.vcxproj @@ -65,7 +65,7 @@ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <MultiProcessorCompilation>true</MultiProcessorCompilation> - <DisableSpecificWarnings>4244;4267</DisableSpecificWarnings> + <DisableSpecificWarnings>4244</DisableSpecificWarnings> </ClCompile> <Link> <SubSystem>Windows</SubSystem> 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 @@ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <MultiProcessorCompilation>true</MultiProcessorCompilation> - <DisableSpecificWarnings>4244;4267;4996</DisableSpecificWarnings> + <DisableSpecificWarnings>4244;4996</DisableSpecificWarnings> </ClCompile> <Link> <SubSystem>Windows</SubSystem> 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 |