/pidgin/main: a2bc71cb4712: Add -Wfloat-equal compiler switch an...

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Thu Aug 22 09:34:06 EDT 2013


Changeset: a2bc71cb4712c52c8cc588b6db370bd2837099d8
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2013-08-22 15:33 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/a2bc71cb4712

Description:

Add -Wfloat-equal compiler switch and fix a warning about that

diffstat:

 configure.ac                                 |  6 +-----
 libpurple/plugins/perl/Makefile.am           |  3 ++-
 libpurple/plugins/perl/common/Makefile.PL.in |  2 +-
 pidgin/gtkft.c                               |  2 +-
 pidgin/plugins/perl/common/Makefile.PL.in    |  2 +-
 5 files changed, 6 insertions(+), 9 deletions(-)

diffs (69 lines):

diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1424,11 +1424,6 @@ if test "x$GCC" = "xyes"; then
 	dnl	This leads to spurious warnings using GPOINTER_TO_INT(), et al. directly on a function call.
 	dnl		We'd need an intermediate variable.
 	dnl
-	dnl Consider adding -Wfloat-equal.
-	dnl	This leads to warnings with Perl.
-	dnl		Perhaps we could write ugly configure magic and pass -Wno-float-equal down to that subdirectory.
-	dnl		On the other hand, it's probably actually broken, so maybe the Perl folks should fix that?
-	dnl
 	for newflag in \
 			"-Waggregate-return" \
 			"-Wcast-align" \
@@ -1443,6 +1438,7 @@ if test "x$GCC" = "xyes"; then
 			"-Wmissing-noreturn" \
 			"-Wmissing-prototypes" \
 			"-Wpointer-arith" \
+			"-Wfloat-equal" \
 			"-Wundef" \
 	; do
 		orig_CFLAGS="$CFLAGS"
diff --git a/libpurple/plugins/perl/Makefile.am b/libpurple/plugins/perl/Makefile.am
--- a/libpurple/plugins/perl/Makefile.am
+++ b/libpurple/plugins/perl/Makefile.am
@@ -169,4 +169,5 @@ AM_CPPFLAGS = \
 	$(DEBUG_CFLAGS) \
 	$(GLIB_CFLAGS) \
 	$(PLUGIN_CFLAGS) \
-	$(PERL_CFLAGS)
+	$(PERL_CFLAGS) \
+	-Wno-float-equal
diff --git a/libpurple/plugins/perl/common/Makefile.PL.in b/libpurple/plugins/perl/common/Makefile.PL.in
--- a/libpurple/plugins/perl/common/Makefile.PL.in
+++ b/libpurple/plugins/perl/common/Makefile.PL.in
@@ -9,7 +9,7 @@ WriteMakefile(
     ($] >= 5.005 ? ## Add these new keywords supported since 5.005
       (ABSTRACT_FROM    => '@srcdir@/Purple.pm', # finds $ABSTRACT
        AUTHOR           => 'Purple <https://pidgin.im/>') : ()),
-    'DEFINE'            => '@DEBUG_CFLAGS@',
+    'DEFINE'            => '@DEBUG_CFLAGS@ -Wno-float-equal',
     'dynamic_lib'       => { 'OTHERLDFLAGS' => '@LDFLAGS@' },
     'INC'               => '-I. -I at srcdir@ -I at top_srcdir@ -I at top_srcdir@/libpurple @GLIB_CFLAGS@',
     'OBJECT'            => '$(O_FILES)', # link all the C files too
diff --git a/pidgin/gtkft.c b/pidgin/gtkft.c
--- a/pidgin/gtkft.c
+++ b/pidgin/gtkft.c
@@ -158,7 +158,7 @@ get_xfer_info_strings(PurpleXfer *xfer, 
 		else if (purple_xfer_is_cancelled(xfer)) {
 			*time_remaining = g_strdup(_("Cancelled"));
 		}
-		else if (purple_xfer_get_size(xfer) == 0 || (kb_sent > 0 && kbps == 0)) {
+		else if (purple_xfer_get_size(xfer) == 0 || (kb_sent > 0 && kbps < 0.001)) {
 			*time_remaining = g_strdup(_("Unknown"));
 		}
 		else if (kb_sent <= 0) {
diff --git a/pidgin/plugins/perl/common/Makefile.PL.in b/pidgin/plugins/perl/common/Makefile.PL.in
--- a/pidgin/plugins/perl/common/Makefile.PL.in
+++ b/pidgin/plugins/perl/common/Makefile.PL.in
@@ -8,7 +8,7 @@ WriteMakefile(
     ($] >= 5.005 ? ## Add these new keywords supported since 5.005
       ('ABSTRACT_FROM' => '@srcdir@/Pidgin.pm', # finds $ABSTRACT
        'AUTHOR'        => 'Pidgin <https://pidgin.im/>') :  ()),
-    'DEFINE'        => '@DEBUG_CFLAGS@',
+    'DEFINE'        => '@DEBUG_CFLAGS@ -Wno-float-equal',
     'dynamic_lib'       => { 'OTHERLDFLAGS' => '@LDFLAGS@' },
     'INC'           => '-I. -I at srcdir@ -I at top_srcdir@ -I at top_srcdir@/libpurple -I at top_srcdir@/pidgin @GTK_CFLAGS@ @WEBKIT_CFLAGS@',
     'OBJECT'        => '$(O_FILES)', # link all the C files too



More information about the Commits mailing list