Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61789 - in trunk: boost/regex/v4 libs/regex/src
From: john_at_[hidden]
Date: 2010-05-05 13:40:09


Author: johnmaddock
Date: 2010-05-05 13:40:07 EDT (Wed, 05 May 2010)
New Revision: 61789
URL: http://svn.boost.org/trac/boost/changeset/61789

Log:
Change "id" to "idx" to be Objective C++ compatible.
Fixes #2306.
Fixes #4132.
Fixes #4191.
Text files modified:
   trunk/boost/regex/v4/basic_regex_creator.hpp | 23 ++++----
   trunk/boost/regex/v4/perl_matcher.hpp | 4
   trunk/boost/regex/v4/perl_matcher_common.hpp | 8 +-
   trunk/boost/regex/v4/perl_matcher_non_recursive.hpp | 20 +++---
   trunk/boost/regex/v4/perl_matcher_recursive.hpp | 6 +-
   trunk/libs/regex/src/c_regex_traits.cpp | 10 +-
   trunk/libs/regex/src/icu.cpp | 18 +++---
   trunk/libs/regex/src/w32_regex_traits.cpp | 108 ++++++++++++++++++++--------------------
   trunk/libs/regex/src/wc_regex_traits.cpp | 10 +-
   9 files changed, 104 insertions(+), 103 deletions(-)

Modified: trunk/boost/regex/v4/basic_regex_creator.hpp
==============================================================================
--- trunk/boost/regex/v4/basic_regex_creator.hpp (original)
+++ trunk/boost/regex/v4/basic_regex_creator.hpp 2010-05-05 13:40:07 EDT (Wed, 05 May 2010)
@@ -769,14 +769,14 @@
       case syntax_element_assert_backref:
          {
             // just check that the index is valid:
- int id = static_cast<const re_brace*>(state)->index;
- if(id < 0)
+ int idx = static_cast<const re_brace*>(state)->index;
+ if(idx < 0)
             {
- id = -id-1;
- if(id >= 10000)
+ idx = -idx-1;
+ if(idx >= 10000)
                {
- id = m_pdata->get_id(id);
- if(id <= 0)
+ idx = m_pdata->get_id(idx);
+ if(idx <= 0)
                   {
                      // check of sub-expression that doesn't exist:
                      if(0 == this->m_pdata->m_status) // update the error code if not already set
@@ -804,12 +804,12 @@
          {
             bool ok = false;
             re_syntax_base* p = base;
- std::ptrdiff_t id = static_cast<re_jump*>(state)->alt.i;
- if(id > 10000)
- id = m_pdata->get_id(id);
+ std::ptrdiff_t idx = static_cast<re_jump*>(state)->alt.i;
+ if(idx > 10000)
+ idx = m_pdata->get_id(idx);
             while(p)
             {
- if((p->type == syntax_element_startmark) && (static_cast<re_brace*>(p)->index == id))
+ if((p->type == syntax_element_startmark) && (static_cast<re_brace*>(p)->index == idx))
                {
                   //
                   // We've found the target of the recursion, set the jump target:
@@ -833,7 +833,7 @@
                         next_rep_id = static_cast<re_repeat*>(p)->state_id;
                         break;
                      case syntax_element_endmark:
- if(static_cast<const re_brace*>(p)->index == id)
+ if(static_cast<const re_brace*>(p)->index == idx)
                            next_rep_id = -1;
                         break;
                      default:
@@ -1543,3 +1543,4 @@
 #endif
 
 #endif
+

Modified: trunk/boost/regex/v4/perl_matcher.hpp
==============================================================================
--- trunk/boost/regex/v4/perl_matcher.hpp (original)
+++ trunk/boost/regex/v4/perl_matcher.hpp 2010-05-05 13:40:07 EDT (Wed, 05 May 2010)
@@ -336,7 +336,7 @@
 {
    typedef typename Results::value_type value_type;
    typedef typename value_type::iterator iterator;
- int id;
+ int idx;
    const re_syntax_base* preturn_address;
    Results results;
    repeater_count<iterator>* repeater_stack;
@@ -522,7 +522,7 @@
    void push_repeater_count(int i, repeater_count<BidiIterator>** s);
    void push_single_repeat(std::size_t c, const re_repeat* r, BidiIterator last_position, int state_id);
    void push_non_greedy_repeat(const re_syntax_base* ps);
- void push_recursion(int id, const re_syntax_base* p, results_type* presults);
+ void push_recursion(int idx, const re_syntax_base* p, results_type* presults);
    void push_recursion_pop();
 
    // pointer to base of stack:

Modified: trunk/boost/regex/v4/perl_matcher_common.hpp
==============================================================================
--- trunk/boost/regex/v4/perl_matcher_common.hpp (original)
+++ trunk/boost/regex/v4/perl_matcher_common.hpp 2010-05-05 13:40:07 EDT (Wed, 05 May 2010)
@@ -732,10 +732,10 @@
    {
       // Have we recursed into subexpression "index"?
       // If index == 0 then check for any recursion at all, otherwise for recursion to -index-1.
- int id = -index-1;
- if(id >= 10000)
- id = re.get_data().get_id(id);
- result = !recursion_stack.empty() && ((recursion_stack.back().id == id) || (index == 0));
+ int idx = -index-1;
+ if(idx >= 10000)
+ idx = re.get_data().get_id(idx);
+ result = !recursion_stack.empty() && ((recursion_stack.back().idx == idx) || (index == 0));
       pstate = pstate->next.p;
    }
    return result;

Modified: trunk/boost/regex/v4/perl_matcher_non_recursive.hpp
==============================================================================
--- trunk/boost/regex/v4/perl_matcher_non_recursive.hpp (original)
+++ trunk/boost/regex/v4/perl_matcher_non_recursive.hpp 2010-05-05 13:40:07 EDT (Wed, 05 May 2010)
@@ -130,8 +130,8 @@
 template <class Results>
 struct saved_recursion : public saved_state
 {
- saved_recursion(int id, const re_syntax_base* p, Results* pr)
- : saved_state(14), recursion_id(id), preturn_address(p), results(*pr)
+ saved_recursion(int idx, const re_syntax_base* p, Results* pr)
+ : saved_state(14), recursion_id(idx), preturn_address(p), results(*pr)
    {}
    int recursion_id;
    const re_syntax_base* preturn_address;
@@ -329,7 +329,7 @@
 }
 
 template <class BidiIterator, class Allocator, class traits>
-inline void perl_matcher<BidiIterator, Allocator, traits>::push_recursion(int id, const re_syntax_base* p, results_type* presults)
+inline void perl_matcher<BidiIterator, Allocator, traits>::push_recursion(int idx, const re_syntax_base* p, results_type* presults)
 {
    saved_recursion<results_type>* pmp = static_cast<saved_recursion<results_type>*>(m_backup_state);
    --pmp;
@@ -339,7 +339,7 @@
       pmp = static_cast<saved_recursion<results_type>*>(m_backup_state);
       --pmp;
    }
- (void) new (pmp)saved_recursion<results_type>(id, p, presults);
+ (void) new (pmp)saved_recursion<results_type>(idx, p, presults);
    m_backup_state = pmp;
 }
 
@@ -910,7 +910,7 @@
       push_repeater_count(static_cast<const re_recurse*>(pstate)->state_id, &next_count);
    }
    pstate = static_cast<const re_jump*>(pstate)->alt.p;
- recursion_stack.back().id = static_cast<const re_brace*>(pstate)->index;
+ recursion_stack.back().idx = static_cast<const re_brace*>(pstate)->index;
 
    return true;
 }
@@ -928,11 +928,11 @@
       }
       if(!recursion_stack.empty())
       {
- if(index == recursion_stack.back().id)
+ if(index == recursion_stack.back().idx)
          {
             pstate = recursion_stack.back().preturn_address;
             *m_presult = recursion_stack.back().results;
- push_recursion(recursion_stack.back().id, recursion_stack.back().preturn_address, &recursion_stack.back().results);
+ push_recursion(recursion_stack.back().idx, recursion_stack.back().preturn_address, &recursion_stack.back().results);
             recursion_stack.pop_back();
          }
       }
@@ -952,10 +952,10 @@
 {
    if(!recursion_stack.empty())
    {
- BOOST_ASSERT(0 == recursion_stack.back().id);
+ BOOST_ASSERT(0 == recursion_stack.back().idx);
       pstate = recursion_stack.back().preturn_address;
       *m_presult = recursion_stack.back().results;
- push_recursion(recursion_stack.back().id, recursion_stack.back().preturn_address, &recursion_stack.back().results);
+ push_recursion(recursion_stack.back().idx, recursion_stack.back().preturn_address, &recursion_stack.back().results);
       recursion_stack.pop_back();
       return true;
    }
@@ -1523,7 +1523,7 @@
    if(!r)
    {
       recursion_stack.push_back(recursion_info<results_type>());
- recursion_stack.back().id = pmp->recursion_id;
+ recursion_stack.back().idx = pmp->recursion_id;
       recursion_stack.back().preturn_address = pmp->preturn_address;
       recursion_stack.back().results = pmp->results;
    }

Modified: trunk/boost/regex/v4/perl_matcher_recursive.hpp
==============================================================================
--- trunk/boost/regex/v4/perl_matcher_recursive.hpp (original)
+++ trunk/boost/regex/v4/perl_matcher_recursive.hpp 2010-05-05 13:40:07 EDT (Wed, 05 May 2010)
@@ -866,7 +866,7 @@
    recursion_stack.back().results = *m_presult;
    recursion_stack.back().repeater_stack = next_count;
    pstate = static_cast<const re_jump*>(pstate)->alt.p;
- recursion_stack.back().id = static_cast<const re_brace*>(pstate)->index;
+ recursion_stack.back().idx = static_cast<const re_brace*>(pstate)->index;
 
    repeater_count<BidiIterator>* saved = next_count;
    repeater_count<BidiIterator> r(&next_count); // resets all repeat counts since we're recursing and starting fresh on those
@@ -897,7 +897,7 @@
       }
       if(!recursion_stack.empty())
       {
- if(index == recursion_stack.back().id)
+ if(index == recursion_stack.back().idx)
          {
             recursion_info<results_type> saved = recursion_stack.back();
             recursion_stack.pop_back();
@@ -929,7 +929,7 @@
 {
    if(!recursion_stack.empty())
    {
- BOOST_ASSERT(0 == recursion_stack.back().id);
+ BOOST_ASSERT(0 == recursion_stack.back().idx);
       const re_syntax_base* saved_state = pstate = recursion_stack.back().preturn_address;
       *m_presult = recursion_stack.back().results;
       recursion_stack.pop_back();

Modified: trunk/libs/regex/src/c_regex_traits.cpp
==============================================================================
--- trunk/libs/regex/src/c_regex_traits.cpp (original)
+++ trunk/libs/regex/src/c_regex_traits.cpp 2010-05-05 13:40:07 EDT (Wed, 05 May 2010)
@@ -155,16 +155,16 @@
       char_class_xdigit,
    };
 
- int id = ::boost::re_detail::get_default_class_id(p1, p2);
- if(id < 0)
+ int idx = ::boost::re_detail::get_default_class_id(p1, p2);
+ if(idx < 0)
    {
       std::string s(p1, p2);
       for(std::string::size_type i = 0; i < s.size(); ++i)
          s[i] = static_cast<char>((std::tolower)(static_cast<unsigned char>(s[i])));
- id = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
+ idx = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
    }
- BOOST_ASSERT(std::size_t(id+1) < sizeof(masks) / sizeof(masks[0]));
- return masks[id+1];
+ BOOST_ASSERT(std::size_t(idx+1) < sizeof(masks) / sizeof(masks[0]));
+ return masks[idx+1];
 }
 
 bool BOOST_REGEX_CALL c_regex_traits<char>::isctype(char c, char_class_type mask)

Modified: trunk/libs/regex/src/icu.cpp
==============================================================================
--- trunk/libs/regex/src/icu.cpp (original)
+++ trunk/libs/regex/src/icu.cpp 2010-05-05 13:40:07 EDT (Wed, 05 May 2010)
@@ -388,14 +388,14 @@
       char_class_type(U_GC_ND_MASK) | mask_xdigit,
    };
 
- int id = ::boost::re_detail::get_default_class_id(p1, p2);
- if(id >= 0)
- return masks[id+1];
+ int idx = ::boost::re_detail::get_default_class_id(p1, p2);
+ if(idx >= 0)
+ return masks[idx+1];
    char_class_type result = lookup_icu_mask(p1, p2);
    if(result != 0)
       return result;
 
- if(id < 0)
+ if(idx < 0)
    {
       string_type s(p1, p2);
       string_type::size_type i = 0;
@@ -411,16 +411,16 @@
          }
       }
       if(s.size())
- id = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
- if(id >= 0)
- return masks[id+1];
+ idx = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
+ if(idx >= 0)
+ return masks[idx+1];
       if(s.size())
          result = lookup_icu_mask(&*s.begin(), &*s.begin() + s.size());
       if(result != 0)
          return result;
    }
- BOOST_ASSERT(std::size_t(id+1) < sizeof(masks) / sizeof(masks[0]));
- return masks[id+1];
+ BOOST_ASSERT(std::size_t(idx+1) < sizeof(masks) / sizeof(masks[0]));
+ return masks[idx+1];
 }
 
 icu_regex_traits::string_type icu_regex_traits::lookup_collatename(const char_type* p1, const char_type* p2) const

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 2010-05-05 13:40:07 EDT (Wed, 05 May 2010)
@@ -43,10 +43,10 @@
 namespace boost{ namespace re_detail{
 
 #ifdef BOOST_NO_ANSI_APIS
-UINT get_code_page_for_locale_id(lcid_type id)
+UINT get_code_page_for_locale_id(lcid_type idx)
 {
    WCHAR code_page_string[7];
- if (::GetLocaleInfoW(id, LOCALE_IDEFAULTANSICODEPAGE, code_page_string, 7) == 0)
+ if (::GetLocaleInfoW(idx, LOCALE_IDEFAULTANSICODEPAGE, code_page_string, 7) == 0)
        return 0;
 
    return static_cast<UINT>(_wtol(code_page_string));
@@ -157,15 +157,15 @@
    return ::GetUserDefaultLCID();
 }
 
-BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_lower(char c, lcid_type id)
+BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_lower(char c, lcid_type idx)
 {
 #ifndef BOOST_NO_ANSI_APIS
    WORD mask;
- if(::GetStringTypeExA(id, CT_CTYPE1, &c, 1, &mask) && (mask & C1_LOWER))
+ if(::GetStringTypeExA(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_LOWER))
       return true;
    return false;
 #else
- UINT code_page = get_code_page_for_locale_id(id);
+ UINT code_page = get_code_page_for_locale_id(idx);
    if (code_page == 0)
        return false;
 
@@ -174,39 +174,39 @@
        return false;
 
    WORD mask;
- if(::GetStringTypeExW(id, CT_CTYPE1, &wide_c, 1, &mask) && (mask & C1_LOWER))
+ if(::GetStringTypeExW(idx, CT_CTYPE1, &wide_c, 1, &mask) && (mask & C1_LOWER))
       return true;
    return false;
 #endif
 }
 
-BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_lower(wchar_t c, lcid_type id)
+BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_lower(wchar_t c, lcid_type idx)
 {
    WORD mask;
- if(::GetStringTypeExW(id, CT_CTYPE1, &c, 1, &mask) && (mask & C1_LOWER))
+ if(::GetStringTypeExW(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_LOWER))
       return true;
    return false;
 }
 #ifdef BOOST_REGEX_HAS_OTHER_WCHAR_T
-BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_lower(unsigned short ca, lcid_type id)
+BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_lower(unsigned short ca, lcid_type idx)
 {
    WORD mask;
    wchar_t c = ca;
- if(::GetStringTypeExW(id, CT_CTYPE1, &c, 1, &mask) && (mask & C1_LOWER))
+ if(::GetStringTypeExW(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_LOWER))
       return true;
    return false;
 }
 #endif
 
-BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_upper(char c, lcid_type id)
+BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_upper(char c, lcid_type idx)
 {
 #ifndef BOOST_NO_ANSI_APIS
    WORD mask;
- if(::GetStringTypeExA(id, CT_CTYPE1, &c, 1, &mask) && (mask & C1_UPPER))
+ if(::GetStringTypeExA(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_UPPER))
       return true;
    return false;
 #else
- UINT code_page = get_code_page_for_locale_id(id);
+ UINT code_page = get_code_page_for_locale_id(idx);
    if (code_page == 0)
        return false;
 
@@ -215,25 +215,25 @@
        return false;
 
    WORD mask;
- if(::GetStringTypeExW(id, CT_CTYPE1, &wide_c, 1, &mask) && (mask & C1_UPPER))
+ if(::GetStringTypeExW(idx, 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)
+BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_upper(wchar_t c, lcid_type idx)
 {
    WORD mask;
- if(::GetStringTypeExW(id, CT_CTYPE1, &c, 1, &mask) && (mask & C1_UPPER))
+ if(::GetStringTypeExW(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_UPPER))
       return true;
    return false;
 }
 #ifdef BOOST_REGEX_HAS_OTHER_WCHAR_T
-BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_upper(unsigned short ca, lcid_type id)
+BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_upper(unsigned short ca, lcid_type idx)
 {
    WORD mask;
    wchar_t c = ca;
- if(::GetStringTypeExW(id, CT_CTYPE1, &c, 1, &mask) && (mask & C1_UPPER))
+ if(::GetStringTypeExW(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_UPPER))
       return true;
    return false;
 }
@@ -322,11 +322,11 @@
 }
 #endif
 #endif
-BOOST_REGEX_DECL std::string BOOST_REGEX_CALL w32_transform(lcid_type id, const char* p1, const char* p2)
+BOOST_REGEX_DECL std::string BOOST_REGEX_CALL w32_transform(lcid_type idx, const char* p1, const char* p2)
 {
 #ifndef BOOST_NO_ANSI_APIS
    int bytes = ::LCMapStringA(
- id, // locale identifier
+ idx, // locale identifier
       LCMAP_SORTKEY, // mapping transformation type
       p1, // source string
       static_cast<int>(p2 - p1), // number of characters in source string
@@ -337,7 +337,7 @@
       return std::string(p1, p2);
    std::string result(++bytes, '\0');
    bytes = ::LCMapStringA(
- id, // locale identifier
+ idx, // locale identifier
       LCMAP_SORTKEY, // mapping transformation type
       p1, // source string
       static_cast<int>(p2 - p1), // number of characters in source string
@@ -345,7 +345,7 @@
       bytes // size of destination buffer
       );
 #else
- UINT code_page = get_code_page_for_locale_id(id);
+ UINT code_page = get_code_page_for_locale_id(idx);
    if(code_page == 0)
       return std::string(p1, p2);
 
@@ -355,7 +355,7 @@
       return std::string(p1, p2);
 
    int bytes = ::LCMapStringW(
- id, // locale identifier
+ idx, // locale identifier
       LCMAP_SORTKEY, // mapping transformation type
       wide_p1, // source string
       src_len, // number of characters in source string
@@ -366,7 +366,7 @@
       return std::string(p1, p2);
    std::string result(++bytes, '\0');
    bytes = ::LCMapStringW(
- id, // locale identifier
+ idx, // locale identifier
       LCMAP_SORTKEY, // mapping transformation type
       wide_p1, // source string
       src_len, // number of characters in source string
@@ -384,10 +384,10 @@
 }
 
 #ifndef BOOST_NO_WREGEX
-BOOST_REGEX_DECL std::wstring BOOST_REGEX_CALL w32_transform(lcid_type id, const wchar_t* p1, const wchar_t* p2)
+BOOST_REGEX_DECL std::wstring BOOST_REGEX_CALL w32_transform(lcid_type idx, const wchar_t* p1, const wchar_t* p2)
 {
    int bytes = ::LCMapStringW(
- id, // locale identifier
+ idx, // locale identifier
       LCMAP_SORTKEY, // mapping transformation type
       p1, // source string
       static_cast<int>(p2 - p1), // number of characters in source string
@@ -398,7 +398,7 @@
       return std::wstring(p1, p2);
    std::string result(++bytes, '\0');
    bytes = ::LCMapStringW(
- id, // locale identifier
+ idx, // locale identifier
       LCMAP_SORTKEY, // mapping transformation type
       p1, // source string
       static_cast<int>(p2 - p1), // number of characters in source string
@@ -417,10 +417,10 @@
    return r2;
 }
 #ifdef BOOST_REGEX_HAS_OTHER_WCHAR_T
-BOOST_REGEX_DECL std::basic_string<unsigned short> BOOST_REGEX_CALL w32_transform(lcid_type id, const unsigned short* p1, const unsigned short* p2)
+BOOST_REGEX_DECL std::basic_string<unsigned short> BOOST_REGEX_CALL w32_transform(lcid_type idx, const unsigned short* p1, const unsigned short* p2)
 {
    int bytes = ::LCMapStringW(
- id, // locale identifier
+ idx, // locale identifier
       LCMAP_SORTKEY, // mapping transformation type
       (LPCWSTR)p1, // source string
       static_cast<int>(p2 - p1), // number of characters in source string
@@ -431,7 +431,7 @@
       return std::basic_string<unsigned short>(p1, p2);
    std::string result(++bytes, '\0');
    bytes = ::LCMapStringW(
- id, // locale identifier
+ idx, // locale identifier
       LCMAP_SORTKEY, // mapping transformation type
       (LPCWSTR)p1, // source string
       static_cast<int>(p2 - p1), // number of characters in source string
@@ -451,12 +451,12 @@
 }
 #endif
 #endif
-BOOST_REGEX_DECL char BOOST_REGEX_CALL w32_tolower(char c, lcid_type id)
+BOOST_REGEX_DECL char BOOST_REGEX_CALL w32_tolower(char c, lcid_type idx)
 {
    char result[2];
 #ifndef BOOST_NO_ANSI_APIS
    int b = ::LCMapStringA(
- id, // locale identifier
+ idx, // locale identifier
       LCMAP_LOWERCASE, // mapping transformation type
       &c, // source string
       1, // number of characters in source string
@@ -465,7 +465,7 @@
    if(b == 0)
       return c;
 #else
- UINT code_page = get_code_page_for_locale_id(id);
+ UINT code_page = get_code_page_for_locale_id(idx);
    if (code_page == 0)
       return c;
 
@@ -475,7 +475,7 @@
 
    WCHAR wide_result;
    int b = ::LCMapStringW(
- id, // locale identifier
+ idx, // locale identifier
       LCMAP_LOWERCASE, // mapping transformation type
       &wide_c, // source string
       1, // number of characters in source string
@@ -491,11 +491,11 @@
 }
 
 #ifndef BOOST_NO_WREGEX
-BOOST_REGEX_DECL wchar_t BOOST_REGEX_CALL w32_tolower(wchar_t c, lcid_type id)
+BOOST_REGEX_DECL wchar_t BOOST_REGEX_CALL w32_tolower(wchar_t c, lcid_type idx)
 {
    wchar_t result[2];
    int b = ::LCMapStringW(
- id, // locale identifier
+ idx, // locale identifier
       LCMAP_LOWERCASE, // mapping transformation type
       &c, // source string
       1, // number of characters in source string
@@ -506,11 +506,11 @@
    return result[0];
 }
 #ifdef BOOST_REGEX_HAS_OTHER_WCHAR_T
-BOOST_REGEX_DECL unsigned short BOOST_REGEX_CALL w32_tolower(unsigned short c, lcid_type id)
+BOOST_REGEX_DECL unsigned short BOOST_REGEX_CALL w32_tolower(unsigned short c, lcid_type idx)
 {
    wchar_t result[2];
    int b = ::LCMapStringW(
- id, // locale identifier
+ idx, // locale identifier
       LCMAP_LOWERCASE, // mapping transformation type
       (wchar_t const*)&c, // source string
       1, // number of characters in source string
@@ -522,12 +522,12 @@
 }
 #endif
 #endif
-BOOST_REGEX_DECL char BOOST_REGEX_CALL w32_toupper(char c, lcid_type id)
+BOOST_REGEX_DECL char BOOST_REGEX_CALL w32_toupper(char c, lcid_type idx)
 {
    char result[2];
 #ifndef BOOST_NO_ANSI_APIS
    int b = ::LCMapStringA(
- id, // locale identifier
+ idx, // locale identifier
       LCMAP_UPPERCASE, // mapping transformation type
       &c, // source string
       1, // number of characters in source string
@@ -536,7 +536,7 @@
    if(b == 0)
       return c;
 #else
- UINT code_page = get_code_page_for_locale_id(id);
+ UINT code_page = get_code_page_for_locale_id(idx);
    if(code_page == 0)
        return c;
 
@@ -546,7 +546,7 @@
 
    WCHAR wide_result;
    int b = ::LCMapStringW(
- id, // locale identifier
+ idx, // locale identifier
       LCMAP_UPPERCASE, // mapping transformation type
       &wide_c, // source string
       1, // number of characters in source string
@@ -562,11 +562,11 @@
 }
 
 #ifndef BOOST_NO_WREGEX
-BOOST_REGEX_DECL wchar_t BOOST_REGEX_CALL w32_toupper(wchar_t c, lcid_type id)
+BOOST_REGEX_DECL wchar_t BOOST_REGEX_CALL w32_toupper(wchar_t c, lcid_type idx)
 {
    wchar_t result[2];
    int b = ::LCMapStringW(
- id, // locale identifier
+ idx, // locale identifier
       LCMAP_UPPERCASE, // mapping transformation type
       &c, // source string
       1, // number of characters in source string
@@ -577,11 +577,11 @@
    return result[0];
 }
 #ifdef BOOST_REGEX_HAS_OTHER_WCHAR_T
-BOOST_REGEX_DECL unsigned short BOOST_REGEX_CALL w32_toupper(unsigned short c, lcid_type id)
+BOOST_REGEX_DECL unsigned short BOOST_REGEX_CALL w32_toupper(unsigned short c, lcid_type idx)
 {
    wchar_t result[2];
    int b = ::LCMapStringW(
- id, // locale identifier
+ idx, // locale identifier
       LCMAP_UPPERCASE, // mapping transformation type
       (wchar_t const*)&c, // source string
       1, // number of characters in source string
@@ -593,14 +593,14 @@
 }
 #endif
 #endif
-BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is(lcid_type id, boost::uint32_t m, char c)
+BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is(lcid_type idx, boost::uint32_t m, char c)
 {
    WORD mask;
 #ifndef BOOST_NO_ANSI_APIS
- if(::GetStringTypeExA(id, CT_CTYPE1, &c, 1, &mask) && (mask & m & w32_regex_traits_implementation<char>::mask_base))
+ if(::GetStringTypeExA(idx, CT_CTYPE1, &c, 1, &mask) && (mask & m & w32_regex_traits_implementation<char>::mask_base))
       return true;
 #else
- UINT code_page = get_code_page_for_locale_id(id);
+ UINT code_page = get_code_page_for_locale_id(idx);
    if(code_page == 0)
        return false;
 
@@ -608,7 +608,7 @@
    if (::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0)
        return false;
 
- if(::GetStringTypeExW(id, CT_CTYPE1, &wide_c, 1, &mask) && (mask & m & w32_regex_traits_implementation<char>::mask_base))
+ if(::GetStringTypeExW(idx, CT_CTYPE1, &wide_c, 1, &mask) && (mask & m & w32_regex_traits_implementation<char>::mask_base))
       return true;
 #endif
    if((m & w32_regex_traits_implementation<char>::mask_word) && (c == '_'))
@@ -617,10 +617,10 @@
 }
 
 #ifndef BOOST_NO_WREGEX
-BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is(lcid_type id, boost::uint32_t m, wchar_t c)
+BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is(lcid_type idx, boost::uint32_t m, wchar_t c)
 {
    WORD mask;
- if(::GetStringTypeExW(id, CT_CTYPE1, &c, 1, &mask) && (mask & m & w32_regex_traits_implementation<wchar_t>::mask_base))
+ if(::GetStringTypeExW(idx, CT_CTYPE1, &c, 1, &mask) && (mask & m & w32_regex_traits_implementation<wchar_t>::mask_base))
       return true;
    if((m & w32_regex_traits_implementation<wchar_t>::mask_word) && (c == '_'))
       return true;
@@ -629,10 +629,10 @@
    return false;
 }
 #ifdef BOOST_REGEX_HAS_OTHER_WCHAR_T
-BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is(lcid_type id, boost::uint32_t m, unsigned short c)
+BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is(lcid_type idx, boost::uint32_t m, unsigned short c)
 {
    WORD mask;
- if(::GetStringTypeExW(id, CT_CTYPE1, (wchar_t const*)&c, 1, &mask) && (mask & m & w32_regex_traits_implementation<wchar_t>::mask_base))
+ if(::GetStringTypeExW(idx, CT_CTYPE1, (wchar_t const*)&c, 1, &mask) && (mask & m & w32_regex_traits_implementation<wchar_t>::mask_base))
       return true;
    if((m & w32_regex_traits_implementation<wchar_t>::mask_word) && (c == '_'))
       return true;

Modified: trunk/libs/regex/src/wc_regex_traits.cpp
==============================================================================
--- trunk/libs/regex/src/wc_regex_traits.cpp (original)
+++ trunk/libs/regex/src/wc_regex_traits.cpp 2010-05-05 13:40:07 EDT (Wed, 05 May 2010)
@@ -195,16 +195,16 @@
       char_class_xdigit,
    };
 
- int id = ::boost::re_detail::get_default_class_id(p1, p2);
- if(id < 0)
+ int idx = ::boost::re_detail::get_default_class_id(p1, p2);
+ if(idx < 0)
    {
       std::wstring s(p1, p2);
       for(std::wstring::size_type i = 0; i < s.size(); ++i)
          s[i] = (std::towlower)(s[i]);
- id = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
+ idx = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
    }
- BOOST_ASSERT(id+1 < static_cast<int>(sizeof(masks) / sizeof(masks[0])));
- return masks[id+1];
+ BOOST_ASSERT(idx+1 < static_cast<int>(sizeof(masks) / sizeof(masks[0])));
+ return masks[idx+1];
 }
 
 bool BOOST_REGEX_CALL c_regex_traits<wchar_t>::isctype(wchar_t c, char_class_type mask)


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