stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r676093 - /stdcxx/branches/4.2.x/src/wcodecvt.cpp
Date Fri, 11 Jul 2008 22:20:17 GMT
Author: sebor
Date: Fri Jul 11 15:20:16 2008
New Revision: 676093

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

	Merged rev 649665 from 4.3.x.

	* src/wcodecvt.cpp (__rw_libstd_do_out): Replaced the local equivalent
	of _RWSTD_UWCHAR_INT_T newly introduced in r649646 with the said type.

Modified:
    stdcxx/branches/4.2.x/src/wcodecvt.cpp

Modified: stdcxx/branches/4.2.x/src/wcodecvt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/wcodecvt.cpp?rev=676093&r1=676092&r2=676093&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/wcodecvt.cpp (original)
+++ stdcxx/branches/4.2.x/src/wcodecvt.cpp Fri Jul 11 15:20:16 2008
@@ -762,20 +762,12 @@
             // in strict mode check wide character for validity
             // (i.e., diagnose surrogate pairs as illegal)
 
-#  if _RWSTD_WCHAR_SIZE == _RWSTD_CHAR_SIZE
-            typedef unsigned char WIntT;
-#  elif _RWSTD_WCHAR_SIZE == _RWSTD_SHRT_SIZE
-            typedef unsigned short WIntT;
-#  elif _RWSTD_WCHAR_SIZE ==_RWSTD_INT_SIZE
-            typedef unsigned int WIntT;
-#  elif _RWSTD_WCHAR_SIZE ==_RWSTD_LLONG_SIZE
-            typedef unsigned _RWSTD_LONG_LONG WIntT;
-#  else
-            typedef unsigned long WIntT;
-#  endif
+            typedef _RWSTD_UWCHAR_INT_T WIntT;
 
-            // convert wchar_t to an unsigned integer safe for comaprison
-            const unsigned long wi = _RWSTD_STATIC_CAST (WIntT, *from_next);
+            // convert wchar_t to the unsigned form of its underlying
+            // integer type that's safe in arithmetic comaprisons and
+            // doesn't generate signed/unsigned compiler warnings
+            const WIntT wi = _RWSTD_STATIC_CAST (WIntT, *from_next);
 
             if (   WIntT (0xd800U) <= wi && wi <= WIntT (0xdfffU)
                 || WIntT (0xfffeU) <= wi && wi <= WIntT (0xffffU)) {



Mime
View raw message