You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2007/07/08 21:30:31 UTC

svn commit: r554421 - in /incubator/stdcxx/trunk: etc/config/src/ include/ include/ansi/ include/tr1/ src/ tests/localization/ tests/self/ tests/src/ util/

Author: sebor
Date: Sun Jul  8 12:30:29 2007
New Revision: 554421

URL: http://svn.apache.org/viewvc?view=rev&rev=554421
Log:
2007-07-08  Martin Sebor  <se...@roguewave.com>

	STDCXX-395
	* etc/config/src/LIMITS.cpp (_RWSTD_WCHAR_T_MAX, _RWSTD_WCHAR_T_MIN,
	_RWSTD_WCHAR_T_SIZE): Renamed to _RWSTD_WCHAR_MAX, _RWSTD_WCHAR_MIN,
	and _RWSTD_WCHAR_SIZE, respectively, for consistency with the libc
	macros.
	* tests/src/locale.cpp: Same.
	* tests/src/char.cpp: Same.
	* tests/src/printf.cpp: Same.
	* tests/localization/22.locale.codecvt.out.cpp: Same.
	* tests/self/0.printf.cpp: Same.
	* include/limits: Same.
	* include/tr1/cstdint: Same.
	* include/ansi/_cwchar.h: Same.
	* src/wctype.cpp: Same.
	* src/wcodecvt.cpp: Same.
	* util/ctype.cpp: Same.
	* util/charmap.cpp: Same.

Modified:
    incubator/stdcxx/trunk/etc/config/src/LIMITS.cpp
    incubator/stdcxx/trunk/include/ansi/_cwchar.h
    incubator/stdcxx/trunk/include/limits
    incubator/stdcxx/trunk/include/tr1/cstdint
    incubator/stdcxx/trunk/src/wcodecvt.cpp
    incubator/stdcxx/trunk/src/wctype.cpp
    incubator/stdcxx/trunk/tests/localization/22.locale.codecvt.out.cpp
    incubator/stdcxx/trunk/tests/self/0.printf.cpp
    incubator/stdcxx/trunk/tests/src/char.cpp
    incubator/stdcxx/trunk/tests/src/locale.cpp
    incubator/stdcxx/trunk/tests/src/printf.cpp
    incubator/stdcxx/trunk/util/charmap.cpp
    incubator/stdcxx/trunk/util/ctype.cpp

Modified: incubator/stdcxx/trunk/etc/config/src/LIMITS.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/LIMITS.cpp?view=diff&rev=554421&r1=554420&r2=554421
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/LIMITS.cpp (original)
+++ incubator/stdcxx/trunk/etc/config/src/LIMITS.cpp Sun Jul  8 12:30:29 2007
@@ -331,14 +331,14 @@
 
 #ifndef _RWSTD_NO_WCHAR_T
 
-    printf ("#define _RWSTD_WCHAR_T_SIZE  %2u /* sizeof (wchar_t) */\n",
+    printf ("#define _RWSTD_WCHAR_SIZE  %2u /* sizeof (wchar_t) */\n",
             SIZEOF (wchar_t));
 
     const char *suffix = "U";
     if ((wchar_t)~0 < (wchar_t)0)
         suffix = "";
     
-    compute_limits ((wchar_t)0, "WCHAR_T", suffix, "wchar_t");
+    compute_limits ((wchar_t)0, "WCHAR", suffix, "wchar_t");
 
 #endif   // _RWSTD_NO_WCHAR_T
 

Modified: incubator/stdcxx/trunk/include/ansi/_cwchar.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/ansi/_cwchar.h?view=diff&rev=554421&r1=554420&r2=554421
==============================================================================
--- incubator/stdcxx/trunk/include/ansi/_cwchar.h (original)
+++ incubator/stdcxx/trunk/include/ansi/_cwchar.h Sun Jul  8 12:30:29 2007
@@ -56,11 +56,11 @@
 struct tm;
 
 #ifndef WCHAR_MIN
-#  define WCHAR_MIN _RWSTD_WCHAR_T_MIN
+#  define WCHAR_MIN _RWSTD_WCHAR_MIN
 #endif   // WCHAR_MIN
 
 #ifndef WCHAR_MAX
-#  define WCHAR_MAX _RWSTD_WCHAR_T_MAX
+#  define WCHAR_MAX _RWSTD_WCHAR_MAX
 #endif   // WCHAR_MAX
 
 #ifndef WEOF

Modified: incubator/stdcxx/trunk/include/limits
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/limits?view=diff&rev=554421&r1=554420&r2=554421
==============================================================================
--- incubator/stdcxx/trunk/include/limits (original)
+++ incubator/stdcxx/trunk/include/limits Sun Jul  8 12:30:29 2007
@@ -531,7 +531,7 @@
 #ifndef _RWSTD_NO_WCHAR_T
 #  ifndef _RWSTD_NO_NATIVE_WCHAR_T
 
-_RWSTD_SPECIALIZE_LIMITS (wchar_t, _RWSTD_WCHAR_T)
+_RWSTD_SPECIALIZE_LIMITS (wchar_t, _RWSTD_WCHAR)
 
 #  endif   // _RWSTD_NO_NATIVE_WCHAR_T
 #endif   // _RWSTD_NO_WCHAR_T

Modified: incubator/stdcxx/trunk/include/tr1/cstdint
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/tr1/cstdint?view=diff&rev=554421&r1=554420&r2=554421
==============================================================================
--- incubator/stdcxx/trunk/include/tr1/cstdint (original)
+++ incubator/stdcxx/trunk/include/tr1/cstdint Sun Jul  8 12:30:29 2007
@@ -324,8 +324,8 @@
 
 #define SIZE_MAX            _RWSTD_SIZE_MAX
 
-#define WCHAR_MIN           _RWSTD_WCHAR_T_MIN
-#define WCHAR_MAX           _RWSTD_WCHAR_T_MAX
+#define WCHAR_MIN           _RWSTD_WCHAR_MIN
+#define WCHAR_MAX           _RWSTD_WCHAR_MAX
 
 #define WINT_MIN            _RWSTD_WINT_MIN
 #define WINT_MAX            _RWSTD_WINT_MAX

Modified: incubator/stdcxx/trunk/src/wcodecvt.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/src/wcodecvt.cpp?view=diff&rev=554421&r1=554420&r2=554421
==============================================================================
--- incubator/stdcxx/trunk/src/wcodecvt.cpp (original)
+++ incubator/stdcxx/trunk/src/wcodecvt.cpp Sun Jul  8 12:30:29 2007
@@ -804,13 +804,13 @@
             // in strict mode check wide character for validity
             // (i.e., diagnose surrogate pairs as illegal)
 
-#  if _RWSTD_WCHAR_T_SIZE == _RWSTD_CHAR_SIZE
+#  if _RWSTD_WCHAR_SIZE == _RWSTD_CHAR_SIZE
             typedef unsigned char WIntT;
-#  elif _RWSTD_WCHAR_T_SIZE == _RWSTD_SHRT_SIZE
+#  elif _RWSTD_WCHAR_SIZE == _RWSTD_SHRT_SIZE
             typedef unsigned short WIntT;
-#  elif _RWSTD_WCHAR_T_SIZE ==_RWSTD_INT_SIZE
+#  elif _RWSTD_WCHAR_SIZE ==_RWSTD_INT_SIZE
             typedef unsigned int WIntT;
-#  elif _RWSTD_WCHAR_T_SIZE ==_RWSTD_LLONG_SIZE
+#  elif _RWSTD_WCHAR_SIZE ==_RWSTD_LLONG_SIZE
             typedef unsigned _RWSTD_LONG_LONG WIntT;
 #  else
             typedef unsigned long WIntT;

Modified: incubator/stdcxx/trunk/src/wctype.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/src/wctype.cpp?view=diff&rev=554421&r1=554420&r2=554421
==============================================================================
--- incubator/stdcxx/trunk/src/wctype.cpp (original)
+++ incubator/stdcxx/trunk/src/wctype.cpp Sun Jul  8 12:30:29 2007
@@ -856,19 +856,19 @@
 ctype_byname<wchar_t>::
 do_narrow (char_type c, char dfault) const
 {
-#if _RWSTD_WCHAR_T_MIN < 0
+#if _RWSTD_WCHAR_MIN < 0
 
     // wchar_t is a signed type
     if (c > L'\0' && c < SCHAR_MAX)
         return char (c);
 
-#else   // if _RWSTD_WCHAR_T_MIN >= 0
+#else   // if _RWSTD_WCHAR_MIN >= 0
 
     // wchar_t is an unsigned type
     if (c < SCHAR_MAX)
         return char (c);
 
-#endif   // _RWSTD_WCHAR_T_MIN
+#endif   // _RWSTD_WCHAR_MIN
 
     const _RW::__rw_codecvt_t* cvt = 
         _RWSTD_STATIC_CAST(const _RW::__rw_codecvt_t*, _C_cvtimpl);
@@ -898,11 +898,11 @@
     }
     else {
         
-#if _RWSTD_WCHAR_T_MIN < 0
+#if _RWSTD_WCHAR_MIN < 0
         // For a signed wchar_t test if the character has a negative value
         if (c < 0)
             return dfault;
-#endif // _RWSTD_WCHAR_T_MIN < 0
+#endif // _RWSTD_WCHAR_MIN < 0
 
         // Look up narrow character value in database; be aware that there 
         // is no way to know what the internal representation is for this 
@@ -918,12 +918,12 @@
         char* ptmp = tmp;
         _RWSTD_SIZE_T utf8_sz = _RW::__rw_itoutf8 (c, tmp);
 
-#if _RWSTD_WCHAR_T_MIN < 0
+#if _RWSTD_WCHAR_MIN < 0
         // compute the invalid bit mask (the MSB set)
-        const wchar_t imask = wchar_t (~(_RWSTD_WCHAR_T_MAX));
+        const wchar_t imask = wchar_t (~(_RWSTD_WCHAR_MAX));
 #else
-        const wchar_t imask = wchar_t (~(_RWSTD_WCHAR_T_MAX >> 1));
-#endif // _RWSTD_WCHAR_T_MIN < 0
+        const wchar_t imask = wchar_t (~(_RWSTD_WCHAR_MAX >> 1));
+#endif // _RWSTD_WCHAR_MIN < 0
 
         typedef unsigned char UChar;
         
@@ -931,7 +931,7 @@
         wc = ptbl [UChar (*ptmp)];
         while (wc & imask) {
             // check validity of the value
-            if (wc == (imask | _RWSTD_WCHAR_T_MAX)) 
+            if (wc == (imask | _RWSTD_WCHAR_MAX)) 
                 return dfault;
 
             ptbl = tbl + 256 * (wc & (~imask));
@@ -1014,12 +1014,12 @@
     }
     else {
 
-#if _RWSTD_WCHAR_T_MIN < 0
+#if _RWSTD_WCHAR_MIN < 0
         // compute the invalid bit mask (the MSB set)
-        const char_type imask = char_type (~(_RWSTD_WCHAR_T_MAX));
+        const char_type imask = char_type (~(_RWSTD_WCHAR_MAX));
 #else
-        const char_type imask = char_type (~(_RWSTD_WCHAR_T_MAX >> 1));
-#endif   // _RWSTD_WCHAR_T_MIN < 0
+        const char_type imask = char_type (~(_RWSTD_WCHAR_MAX >> 1));
+#endif   // _RWSTD_WCHAR_MIN < 0
 
         // Lookup the narrow character in the table; be aware that 
         // the result of the lookup might be the index for another

Modified: incubator/stdcxx/trunk/tests/localization/22.locale.codecvt.out.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/localization/22.locale.codecvt.out.cpp?view=diff&rev=554421&r1=554420&r2=554421
==============================================================================
--- incubator/stdcxx/trunk/tests/localization/22.locale.codecvt.out.cpp (original)
+++ incubator/stdcxx/trunk/tests/localization/22.locale.codecvt.out.cpp Sun Jul  8 12:30:29 2007
@@ -148,7 +148,7 @@
         *mbchar = '\0';
     }
 
-#if 2 < _RWSTD_WCHAR_T_SIZE
+#if 2 < _RWSTD_WCHAR_SIZE
 
     // if a multibyte character of the requested size is not found
     // in the low 64K range, try to find one using a random search

Modified: incubator/stdcxx/trunk/tests/self/0.printf.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/self/0.printf.cpp?view=diff&rev=554421&r1=554420&r2=554421
==============================================================================
--- incubator/stdcxx/trunk/tests/self/0.printf.cpp (original)
+++ incubator/stdcxx/trunk/tests/self/0.printf.cpp Sun Jul  8 12:30:29 2007
@@ -763,7 +763,7 @@
     TEST ("%{#1S}", S ("a\0\0"),  0, 0, "\"a\\0\\0\"");
     TEST ("%{#1S}", S ("\0\0\0"), 0, 0, "\"\\0\\0\\0\"");
 
-#if 2 == _RWSTD_WCHAR_T_SIZE
+#if 2 == _RWSTD_WCHAR_SIZE
 
     TEST ("%{#2S}",  0,             0, 0, "(null)");
     TEST ("%{#2S}",  WS (""),       0, 0, "L\"\"");
@@ -777,7 +777,7 @@
     TEST ("%{#2S}",  WS ("a\0\0"),  0, 0, "L\"a\\0\\0\"");
     TEST ("%{#2S}",  WS ("\0\0\0"), 0, 0, "L\"\\0\\0\\0\"");
 
-#elif 4 == _RWSTD_WCHAR_T_SIZE
+#elif 4 == _RWSTD_WCHAR_SIZE
 
     TEST ("%{#4S}",  0,             0, 0, "(null)");
     TEST ("%{#4S}",  WS (""),       0, 0, "L\"\"");
@@ -791,7 +791,7 @@
     TEST ("%{#4S}",  WS ("a\0\0"),  0, 0, "L\"a\\0\\0\"");
     TEST ("%{#4S}",  WS ("\0\0\0"), 0, 0, "L\"\\0\\0\\0\"");
 
-#endif   // _RWSTD_WCHAR_T_SIZE
+#endif   // _RWSTD_WCHAR_SIZE
 
 }
 

Modified: incubator/stdcxx/trunk/tests/src/char.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/src/char.cpp?view=diff&rev=554421&r1=554420&r2=554421
==============================================================================
--- incubator/stdcxx/trunk/tests/src/char.cpp (original)
+++ incubator/stdcxx/trunk/tests/src/char.cpp Sun Jul  8 12:30:29 2007
@@ -1287,7 +1287,7 @@
 
         nbytes = rw_asnprintf (pbuf, pbufsize, "%{+}%{#*s}", nelems, beg.pc);
     }
-    else if (_RWSTD_WCHAR_T_SIZE == elemsize) {
+    else if (_RWSTD_WCHAR_SIZE == elemsize) {
         if (nelems < 0)
             nbytes = rw_asnprintf (pbuf, pbufsize, "%{+}%{#ls}", beg.pwc);
         else

Modified: incubator/stdcxx/trunk/tests/src/locale.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/src/locale.cpp?view=diff&rev=554421&r1=554420&r2=554421
==============================================================================
--- incubator/stdcxx/trunk/tests/src/locale.cpp (original)
+++ incubator/stdcxx/trunk/tests/src/locale.cpp Sun Jul  8 12:30:29 2007
@@ -514,7 +514,7 @@
         *buf = '\0';
     }
 
-#if 2 < _RWSTD_WCHAR_T_SIZE
+#if 2 < _RWSTD_WCHAR_SIZE
 
     // if a multibyte character of the requested size is not found
     // in the low 64K range, try to find one using a random search

Modified: incubator/stdcxx/trunk/tests/src/printf.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/src/printf.cpp?view=diff&rev=554421&r1=554420&r2=554421
==============================================================================
--- incubator/stdcxx/trunk/tests/src/printf.cpp (original)
+++ incubator/stdcxx/trunk/tests/src/printf.cpp Sun Jul  8 12:30:29 2007
@@ -1843,25 +1843,25 @@
 template <class charT>
 int _rw_quotechar (char *buf, charT wc, int noesc)
 {
-#if _RWSTD_WCHAR_T_MIN < 0
+#if _RWSTD_WCHAR_MIN < 0
 
     // wchar_t is signed, convert its value to unsigned long
     // without widening (i.e., treat it as an unsigned type)
 
-#  if _RWSTD_WCHAR_T_MIN == _RWSTD_SHRT_MIN
+#  if _RWSTD_WCHAR_MIN == _RWSTD_SHRT_MIN
     const ULong wi = UShrt (wc);
-#  elif _RWSTD_WCHAR_T_MIN ==_RWSTD_INT_MIN
+#  elif _RWSTD_WCHAR_MIN ==_RWSTD_INT_MIN
     const ULong wi = UInt (wc);
-#  elif _RWSTD_WCHAR_T_MIN == _RWSTD_LONG_MIN
+#  elif _RWSTD_WCHAR_MIN == _RWSTD_LONG_MIN
     const ULong wi = ULong (wc);
 #  endif
 
-#else   // if _RWSTD_WCHAR_T_MIN >= 0
+#else   // if _RWSTD_WCHAR_MIN >= 0
 
     // wchar_t is unsigned
     const ULong wi = ULong (wc);
 
-#endif   // _RWSTD_WCHAR_T_MIN < 0
+#endif   // _RWSTD_WCHAR_MIN < 0
 
     if ((1 == sizeof wc || wi < 0x100) && noesc) {
         buf [0] = char (wc);
@@ -1978,7 +1978,7 @@
             // wchar_t (bot not for an array of wchar_t's being
             // formatted using the {%ls} directive -- the caller
             // can easily stick the 'L' there themselves)
-            if (flags & A_ARRAY && _RWSTD_WCHAR_T_SIZE == sizeof (elemT))
+            if (flags & A_ARRAY && _RWSTD_WCHAR_SIZE == sizeof (elemT))
                 *next++ = 'L';
 
             *next++ = '"';
@@ -2067,7 +2067,7 @@
             if (last_repeat < 0) {
                 if (flags & (A_CHAR | A_WCHAR)) {
                     if (   (flags & A_ARRAY)
-                        && _RWSTD_WCHAR_T_SIZE == sizeof (elemT))
+                        && _RWSTD_WCHAR_SIZE == sizeof (elemT))
                         *s++ = 'L';
 
                     // insert an opening quote

Modified: incubator/stdcxx/trunk/util/charmap.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/charmap.cpp?view=diff&rev=554421&r1=554420&r2=554421
==============================================================================
--- incubator/stdcxx/trunk/util/charmap.cpp (original)
+++ incubator/stdcxx/trunk/util/charmap.cpp Sun Jul  8 12:30:29 2007
@@ -643,7 +643,7 @@
 
     const unsigned long val = std::strtoul (&*++it, (char**)0, 16);
 
-    if (_RWSTD_WCHAR_T_MAX <= val)
+    if (_RWSTD_WCHAR_MAX <= val)
         issue_diag (E_UCS, true, 0, 
                     "UCS value %lu of symbolic character %s out of range.\n",
                     val, sym.c_str ());

Modified: incubator/stdcxx/trunk/util/ctype.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/ctype.cpp?view=diff&rev=554421&r1=554420&r2=554421
==============================================================================
--- incubator/stdcxx/trunk/util/ctype.cpp (original)
+++ incubator/stdcxx/trunk/util/ctype.cpp Sun Jul  8 12:30:29 2007
@@ -55,7 +55,7 @@
 
     long w = std::strtol (t.name.substr (2, t.name.size ()).c_str (),
                                0, 16);
-    if (w > _RWSTD_WCHAR_T_MAX) {
+    if (w > _RWSTD_WCHAR_MAX) {
         // issue_diag intercepted in process_transliteration_statement
         // but will render -w switch useless; just throw here
         throw loc_exception ("symbol could not be converted to UCS-4 "