Boost logo

Boost-Commit :

From: DDeakins_at_[hidden]
Date: 2007-11-24 23:30:02


Author: davedeakins
Date: 2007-11-24 23:30:02 EST (Sat, 24 Nov 2007)
New Revision: 41350
URL: http://svn.boost.org/trac/boost/changeset/41350

Log:
A few corrections to the WinCE patches
Text files modified:
   trunk/libs/regex/src/w32_regex_traits.cpp | 31 ++++++++++++++++---------------
   1 files changed, 16 insertions(+), 15 deletions(-)

Modified: trunk/libs/regex/src/w32_regex_traits.cpp
==============================================================================
--- trunk/libs/regex/src/w32_regex_traits.cpp (original)
+++ trunk/libs/regex/src/w32_regex_traits.cpp 2007-11-24 23:30:02 EST (Sat, 24 Nov 2007)
@@ -182,25 +182,10 @@
 
 BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_lower(wchar_t c, lcid_type id)
 {
-#ifndef BOOST_NO_ANSI_APIS
    WORD mask;
    if(::GetStringTypeExW(id, CT_CTYPE1, &c, 1, &mask) && (mask & C1_LOWER))
       return true;
    return false;
-#else
- UINT code_page = get_code_page_for_locale_id(id);
- if (code_page == 0)
- return false;
-
- WCHAR wide_c;
- if (::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0)
- return false;
-
- WORD mask;
- if(::GetStringTypeExW(id, CT_CTYPE1, &wide_c, 1, &mask) && (mask & C1_UPPER))
- return true;
- return false;
-#endif
 }
 #ifdef BOOST_REGEX_HAS_OTHER_WCHAR_T
 BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_lower(unsigned short ca, lcid_type id)
@@ -215,10 +200,25 @@
 
 BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_upper(char c, lcid_type id)
 {
+#ifndef BOOST_NO_ANSI_APIS
    WORD mask;
    if(::GetStringTypeExA(id, CT_CTYPE1, &c, 1, &mask) && (mask & C1_UPPER))
       return true;
    return false;
+#else
+ UINT code_page = get_code_page_for_locale_id(id);
+ if (code_page == 0)
+ return false;
+
+ WCHAR wide_c;
+ if (::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0)
+ return false;
+
+ WORD mask;
+ if(::GetStringTypeExW(id, CT_CTYPE1, &wide_c, 1, &mask) && (mask & C1_UPPER))
+ return true;
+ return false;
+#endif
 }
 
 BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_upper(wchar_t c, lcid_type id)
@@ -255,6 +255,7 @@
        return cat_type();
 
    cat_type result(::LoadLibraryW(wide_name), &free_module);
+ return result;
 #endif
 }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk