stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r526961 - in /incubator/stdcxx/trunk/tests/strings: 21.string.access.cpp 21.string.append.cpp
Date Tue, 10 Apr 2007 00:06:13 GMT
Author: sebor
Date: Mon Apr  9 17:06:12 2007
New Revision: 526961

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

	* 21.string.access.cpp (test_access): Cast an argument to
	a (potentially) wider type to silence the pesky HP aCC 3.73
	Warning (suggestion) 887: Type T is smaller than type U,
	unwanted widening in value may result.
	* 21.string.append.cpp (test_append): Same.

Modified:
    incubator/stdcxx/trunk/tests/strings/21.string.access.cpp
    incubator/stdcxx/trunk/tests/strings/21.string.append.cpp

Modified: incubator/stdcxx/trunk/tests/strings/21.string.access.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.access.cpp?view=diff&rev=526961&r1=526960&r2=526961
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.access.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.access.cpp Mon Apr  9 17:06:12 2007
@@ -202,6 +202,7 @@
                   const StringTestCase &tcase)
 {
     typedef std::basic_string <charT, Traits, Allocator> String;
+    typedef typename String::size_type                   SizeT;
 
     static const std::size_t BUFSIZE = 256;
 
@@ -238,19 +239,19 @@
         switch (func.which_) {
 
         case OpIndex (size):
-            pres = &str [tcase.off];
+            pres = &str [SizeT (tcase.off)];
             break;
 
         case OpIndex (const_size):
-            pres = &const_str [tcase.off];
+            pres = &const_str [SizeT (tcase.off)];
             break;
 
         case At (size):
-            pres = &str.at (tcase.off);
+            pres = &str.at (SizeT (tcase.off));
             break;
 
         case At (const_size):
-            pres = &const_str.at (tcase.off);
+            pres = &const_str.at (SizeT (tcase.off));
             break;
 
         default:

Modified: incubator/stdcxx/trunk/tests/strings/21.string.append.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.append.cpp?view=diff&rev=526961&r1=526960&r2=526961
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.append.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.append.cpp Mon Apr  9 17:06:12 2007
@@ -569,6 +569,7 @@
                   const StringTestCaseData<charT>                    &tdata)
 {
     typedef std::basic_string <charT, Traits, Allocator> String;
+    typedef typename String::size_type                   SizeT;
     typedef typename String::iterator                    StringIter;
     typedef typename UserTraits<charT>::MemFun           TraitsFunc;
 
@@ -660,7 +661,8 @@
                 break;
 
             case Append (cstr_size_size):
-                ret_ptr = &str.append (str_arg, tcase.off2, tcase.size2);
+                ret_ptr = &str.append (str_arg,
+                                       SizeT (tcase.off2), SizeT (tcase.size2));
                 break;
 
             case Append (size_val):



Mime
View raw message