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 2006/03/03 21:10:58 UTC

svn commit: r382922 - /incubator/stdcxx/trunk/src/wcodecvt.cpp

Author: sebor
Date: Fri Mar  3 12:10:56 2006
New Revision: 382922

URL: http://svn.apache.org/viewcvs?rev=382922&view=rev
Log:
2006-03-03  Martin Sebor  <se...@roguewave.com>

	* wcodecvt.cpp (wcrtomb): Corrected declaration.

Modified:
    incubator/stdcxx/trunk/src/wcodecvt.cpp

Modified: incubator/stdcxx/trunk/src/wcodecvt.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/src/wcodecvt.cpp?rev=382922&r1=382921&r2=382922&view=diff
==============================================================================
--- incubator/stdcxx/trunk/src/wcodecvt.cpp (original)
+++ incubator/stdcxx/trunk/src/wcodecvt.cpp Fri Mar  3 12:10:56 2006
@@ -117,7 +117,7 @@
 #  undef _RWSTD_NO_WCRTOMB
 
 extern "C" _RWSTD_SIZE_T
-wcrtomb (char*, wchar_t, _RWSTD_SIZE_T, _RWSTD_MBSTATE_T*) _LIBC_THROWS();
+wcrtomb (char*, wchar_t, _RWSTD_MBSTATE_T*) _LIBC_THROWS();
 
 #endif   // _RWSTD_NO_WCRTOMB && !_RWSTD_NO_WCRTOMB_IN_LIBC
 
@@ -208,6 +208,28 @@
 
 _RWSTD_NAMESPACE (__rw) {
 
+
+static const struct {
+    const char *mod;
+    int         flags;
+} __rw_ucsmods[] = {
+    { "UCS",         __rw_ucs },
+    { "UCS-4",       __rw_ucs4 },
+    { "UCS-2",       __rw_ucs2 },
+    { "UCS-4-BE",    __rw_ucs4_be },
+    { "UCS-4-LE",    __rw_ucs4_le },
+    { "UCS-2-BE",    __rw_ucs2_be },
+    { "UCS-2-LE",    __rw_ucs2_le },
+    { "UCS-4-BE-LE", __rw_ucs4_be_le },
+    { "UCS-4-LE-BE", __rw_ucs4_le_be },
+    { "UCS-BE",      __rw_ucs_be },
+    { "UCS-LE",      __rw_ucs_le }
+};
+
+static const _RWSTD_SIZE_T
+__rw_n_ucsmods = sizeof __rw_ucsmods / sizeof *__rw_ucsmods;
+
+
 static inline int
 __rw_mbsinit (const StateT *psrc)
 {
@@ -1323,30 +1345,11 @@
         // search for one of the known modifiers
         if (mod_len > 2 && !memcmp (mod_nam, "UCS", 3)) {
 
-            static const struct {
-                const char *mod;
-                int         flags;
-            } mods[] = {
-                { "UCS",         __rw_ucs },
-                { "UCS-4",       __rw_ucs4 },
-                { "UCS-2",       __rw_ucs2 },
-                { "UCS-4-BE",    __rw_ucs4_be },
-                { "UCS-4-LE",    __rw_ucs4_le },
-                { "UCS-2-BE",    __rw_ucs2_be },
-                { "UCS-2-LE",    __rw_ucs2_le },
-                { "UCS-4-BE-LE", __rw_ucs4_be_le },
-                { "UCS-4-LE-BE", __rw_ucs4_le_be },
-                { "UCS-BE",      __rw_ucs_be },
-                { "UCS-LE",      __rw_ucs_le }
-            };
-
-            const _RWSTD_SIZE_T nmods = sizeof mods / sizeof *mods;
-
             int flags = 0;
 
-            for (_RWSTD_SIZE_T i = 0; i != nmods; ++i) {
-                if (!strcmp (mods [i].mod, mod_nam)) {
-                    flags = mods [i].flags;
+            for (_RWSTD_SIZE_T i = 0; i != _RW::__rw_n_ucsmods; ++i) {
+                if (!strcmp (_RW::__rw_ucsmods [i].mod, mod_nam)) {
+                    flags = _RW::__rw_ucsmods [i].flags;
                     break;
                 }
             }