stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r590129 - /incubator/stdcxx/branches/4.2.x/util/display.cpp
Date Tue, 30 Oct 2007 15:55:55 GMT
Author: faridz
Date: Tue Oct 30 08:55:53 2007
New Revision: 590129

URL: http://svn.apache.org/viewvc?rev=590129&view=rev
Log:
2007-10-30 Farid Zaripov <farid_zaripov@epam.com>

	Merged r581626 from trunk
	* display.cpp (print_status_plain): Use float arithmetic when
	calculating the percent of the failed assertions to avoid
	overflow of the unsigned int type.

Modified:
    incubator/stdcxx/branches/4.2.x/util/display.cpp

Modified: incubator/stdcxx/branches/4.2.x/util/display.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.x/util/display.cpp?rev=590129&r1=590128&r2=590129&view=diff
==============================================================================
--- incubator/stdcxx/branches/4.2.x/util/display.cpp (original)
+++ incubator/stdcxx/branches/4.2.x/util/display.cpp Tue Oct 30 08:55:53 2007
@@ -205,8 +205,10 @@
         && 0 == status->status 
         && 0 == status->exit) {
         if (status->assert) {
-            printf (" %7u %6u %5d%%", status->assert, status->failed, 
-                    100 * (status->assert - status->failed) / status->assert);
+            const int percnt = int (  100.0
+                                    * (status->assert - status->failed)
+                                    / status->assert);
+            printf (" %7u %6u %5d%%", status->assert, status->failed, percnt);
         }
         else {
             printf ("       0 %6u   100%%", status->failed);



Mime
View raw message