/pidgin/main: 82144489893c: Fix some warnings (ref: Felipe Contr...

Tomasz Wasilczyk twasilczyk at pidgin.im
Fri Apr 11 06:28:30 EDT 2014


Changeset: 82144489893c150d27b6cd1d4d26a3f0cd4c192f
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-04-11 12:28 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/82144489893c

Description:

Fix some warnings (ref: Felipe Contreras @ devel list)

diffstat:

 libpurple/proxy.c |   2 +-
 libpurple/util.c  |  30 +++++++++++++++---------------
 2 files changed, 16 insertions(+), 16 deletions(-)

diffs (69 lines):

diff --git a/libpurple/proxy.c b/libpurple/proxy.c
--- a/libpurple/proxy.c
+++ b/libpurple/proxy.c
@@ -982,7 +982,7 @@ http_canread(gpointer data, gint source,
 				p++;
 				status = strtol(p, &p, 10);
 				error = (*p != ' ');
-				(void)minor; /* we don't need it's value */
+				(void)minor; /* we don't need its value */
 			}
 		}
 	}
diff --git a/libpurple/util.c b/libpurple/util.c
--- a/libpurple/util.c
+++ b/libpurple/util.c
@@ -507,16 +507,16 @@ const char *purple_get_tzoff_str(const s
 #ifdef _WIN32
 	if ((off = wpurple_get_tz_offset()) == -1)
 		return "";
-#else
-# ifdef HAVE_TM_GMTOFF
+#elif defined(HAVE_TM_GMTOFF)
 	off = new_tm.tm_gmtoff;
-# else
-#  ifdef HAVE_TIMEZONE
+#elif defined(HAVE_TIMEZONE)
 	tzset();
 	off = -1 * timezone;
-#  endif /* HAVE_TIMEZONE */
-# endif /* !HAVE_TM_GMTOFF */
-#endif /* _WIN32 */
+#else
+	purple_debug_warning("util",
+		"there is no possibility to obtain tz offset");
+	return "";
+#endif
 
 	min = (off / 60) % 60;
 	hrs = ((off / 60) - min) / 60;
@@ -566,10 +566,10 @@ static size_t purple_internal_strftime(c
 		if (*c == 'z')
 		{
 			char *tmp = g_strdup_printf("%s%.*s%s",
-			                            fmt ? fmt : "",
-			                            c - start - 1,
-			                            start,
-			                            purple_get_tzoff_str(tm, FALSE));
+				fmt ? fmt : "",
+				(int)(c - start - 1),
+				start,
+				purple_get_tzoff_str(tm, FALSE));
 			g_free(fmt);
 			fmt = tmp;
 			start = c + 1;
@@ -579,10 +579,10 @@ static size_t purple_internal_strftime(c
 		if (*c == 'Z')
 		{
 			char *tmp = g_strdup_printf("%s%.*s%s",
-			                            fmt ? fmt : "",
-			                            c - start - 1,
-			                            start,
-			                            wpurple_get_timezone_abbreviation(tm));
+				fmt ? fmt : "",
+				(int)(c - start - 1),
+				start,
+				wpurple_get_timezone_abbreviation(tm));
 			g_free(fmt);
 			fmt = tmp;
 			start = c + 1;



More information about the Commits mailing list