stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r495423 - in /incubator/stdcxx/trunk/tests: include/21.strings.h strings/21.string.cons.cpp strings/21.string.io.cpp strings/21.string.operators.cpp
Date Thu, 11 Jan 2007 22:59:32 GMT
Author: sebor
Date: Thu Jan 11 14:59:31 2007
New Revision: 495423

URL: http://svn.apache.org/viewvc?view=rev&rev=495423
Log:
2007-01-11  Martin Sebor  <sebor@roguewave.com>

	* 21.strings.h (arg_type): Explicitly cast an enum to int before
	applying bitwise operators to it to silence bogus Sun C++ warning:
	"Comparing different enum types."
	* 21.string.operators.cpp (test_operators): Same.
	* 21.string.cons.cpp (test_cons): Same.
	* 21.string.io.cpp (test_io): Same.

Modified:
    incubator/stdcxx/trunk/tests/include/21.strings.h
    incubator/stdcxx/trunk/tests/strings/21.string.cons.cpp
    incubator/stdcxx/trunk/tests/strings/21.string.io.cpp
    incubator/stdcxx/trunk/tests/strings/21.string.operators.cpp

Modified: incubator/stdcxx/trunk/tests/include/21.strings.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/include/21.strings.h?view=diff&rev=495423&r1=495422&r2=495423
==============================================================================
--- incubator/stdcxx/trunk/tests/include/21.strings.h (original)
+++ incubator/stdcxx/trunk/tests/include/21.strings.h Thu Jan 11 14:59:31 2007
@@ -645,7 +645,7 @@
 #undef MEMBER_5
 
     static ArgId arg_type (OverloadId id, int argno) {
-        return ArgId (((id >> fid_bits) >> argno * arg_bits) & arg_mask);
+        return ArgId (((int (id) >> fid_bits) >> argno * arg_bits) & arg_mask);
     }
 };
 

Modified: incubator/stdcxx/trunk/tests/strings/21.string.cons.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.cons.cpp?view=diff&rev=495423&r1=495422&r2=495423
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.cons.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.cons.cpp Thu Jan 11 14:59:31 2007
@@ -1038,7 +1038,9 @@
 {
     typedef std::basic_string<charT, Traits, Allocator> String;
 
-    if (StringIds::fid_op_set == (tdata.func_.which_ & StringIds::fid_mask)) {
+    const int fid = int (tdata.func_.which_) & StringIds::fid_mask;
+
+    if (StringIds::fid_op_set == fid) {
         test_op_set ((charT*)0, (Traits*)0, (Allocator*)0, tdata);
         return;
     }

Modified: incubator/stdcxx/trunk/tests/strings/21.string.io.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.io.cpp?view=diff&rev=495423&r1=495422&r2=495423
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.io.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.io.cpp Thu Jan 11 14:59:31 2007
@@ -1242,7 +1242,7 @@
         break;
     }
 
-    if (StringIds::fid_inserter == (func.which_ & StringIds::fid_mask)) {
+    if (StringIds::fid_inserter == (StringIds::fid_mask & int (func.which_))) {
         // verify that const string object was not modified during
         // the call to the inserter (input functions may, obviously,
         // modify it)

Modified: incubator/stdcxx/trunk/tests/strings/21.string.operators.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.operators.cpp?view=diff&rev=495423&r1=495422&r2=495423
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.operators.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.operators.cpp Thu Jan 11 14:59:31 2007
@@ -477,7 +477,7 @@
 
             // form the expected result
             bool exp_res = false;
-            switch (func.which_ & StringIds::fid_mask) {
+            switch (StringIds::fid_mask & int (func.which_)) {
                 case StringIds::fid_op_equal: 
                     exp_res = 0 == tcase.nres;
                     break;
@@ -510,9 +510,9 @@
 
             // verify that Traits::length was used
             std::size_t exp_len_used = 
-                (StringIds::arg_cstr << StringIds::fid_bits) 
-              | (StringIds::arg_cstr << StringIds::arg_bits 
-                                     << StringIds::fid_bits);
+                (StringIds::arg_cstr << int (StringIds::fid_bits))
+              | (StringIds::arg_cstr << int (StringIds::arg_bits)
+                                     << int (StringIds::fid_bits));
 
             std::size_t verlen = 
                 func.which_ & ~StringIds::fid_mask & ~exp_len_used;



Mime
View raw message