components/stdcxx/patches/066-6920783-locale.patch
changeset 402 94ae4d75524c
child 1407 d5f91d0f4487
equal deleted inserted replaced
401:bf52ef48020c 402:94ae4d75524c
       
     1 --- stdcxx-4.2.1/include/loc/_codecvt.h	2008-04-24 17:23:39.000000000 -0700
       
     2 +++ stdcxx-4.2.1/include/loc/_codecvt.h	2011-06-23 11:56:07.510860582 -0700
       
     3 @@ -48,9 +48,12 @@
       
     4  
       
     5  // 22.2.1.5 - Template class codecvt
       
     6  
       
     7 -struct codecvt_base
       
     8 +class codecvt_base
       
     9  {
       
    10 +public:
       
    11      enum result { ok, partial, error, noconv };
       
    12 +
       
    13 +    virtual ~codecvt_base () { }
       
    14  };
       
    15  
       
    16  
       
    17 @@ -73,6 +76,8 @@
       
    18  
       
    19  protected:
       
    20  
       
    21 +    virtual ~codecvt ();
       
    22 +
       
    23      // extension: where reasonable, the default behavior of the primary
       
    24      // template is the same as that of codecvt<char, char, mbstate_t> if
       
    25      // sizeof (intern_type) == sizeof (extern_type) to allow iostream
       
    26 @@ -188,8 +193,6 @@
       
    27  
       
    28      _EXPLICIT codecvt (_RWSTD_SIZE_T = 0);
       
    29  
       
    30 -    virtual ~codecvt ();
       
    31 -
       
    32      result out (state_type &__state,
       
    33                  const intern_type *__from, const intern_type* __from_end,
       
    34                  const intern_type *&__from_next,
       
    35 @@ -234,6 +237,8 @@
       
    36  
       
    37  protected:
       
    38  
       
    39 +    virtual ~codecvt ();
       
    40 +
       
    41      virtual result
       
    42      do_out (state_type&,
       
    43              const intern_type*, const intern_type*, const intern_type*&,
       
    44 @@ -303,6 +308,8 @@
       
    45  
       
    46  protected:
       
    47  
       
    48 +    virtual ~codecvt ();
       
    49 +
       
    50      virtual result
       
    51      do_out (state_type&, const intern_type*, const intern_type*,
       
    52              const intern_type*&,
       
    53 @@ -398,6 +405,11 @@
       
    54          : codecvt <_InternT, _ExternT, _StateT> (__ref) {
       
    55          this->_C_set_name (__name, _C_namebuf, sizeof _C_namebuf);
       
    56      }
       
    57 +
       
    58 +protected:
       
    59 +
       
    60 +    virtual ~codecvt_byname () { }
       
    61 +
       
    62  };
       
    63  
       
    64  
       
    65 @@ -417,6 +429,8 @@
       
    66  
       
    67  protected:
       
    68  
       
    69 +    virtual ~codecvt_byname () { }
       
    70 +
       
    71      virtual codecvt_base::result
       
    72      do_out (state_type&,
       
    73              const intern_type*, const intern_type*, const intern_type*&,
       
    74 #===========================================================================#
       
    75 
       
    76 --- stdcxx-4.2.1/include/loc/_collate.h	2008-04-24 20:23:39.000000000 -0400
       
    77 +++ stdcxx-4.2.1/include/loc/_collate.h	2011-01-07 18:26:19.591751655 -0500
       
    78 @@ -86,6 +86,8 @@
       
    79  
       
    80  protected:
       
    81  
       
    82 +    virtual ~collate () { }
       
    83 +
       
    84      // protected virtual members are not defined
       
    85      virtual int
       
    86      do_compare (const char_type*, const char_type*,
       
    87 @@ -133,6 +135,8 @@
       
    88  
       
    89  protected:
       
    90  
       
    91 +    virtual ~collate () { }
       
    92 +
       
    93      virtual int
       
    94      do_compare (const char_type*, const char_type*,
       
    95                  const char_type*, const char_type*) const;
       
    96 @@ -179,6 +183,7 @@
       
    97  
       
    98  protected:
       
    99  
       
   100 +    virtual ~collate () { }
       
   101      virtual int
       
   102      do_compare (const char_type*, const char_type*,
       
   103                  const char_type*, const char_type*) const;
       
   104 @@ -204,6 +209,10 @@
       
   105          : collate<_CharT>(__ref) {
       
   106          this->_C_set_name (__name, _C_namebuf, sizeof _C_namebuf);
       
   107      }
       
   108 +
       
   109 +protected:
       
   110 +
       
   111 +    virtual collate_byname () { }
       
   112  };
       
   113  
       
   114  
       
   115 @@ -220,6 +229,8 @@
       
   116  
       
   117  protected:
       
   118  
       
   119 +    virtual ~collate_byname() { }
       
   120 +
       
   121      virtual int
       
   122      do_compare (const char_type*, const char_type*,
       
   123                  const char_type*, const char_type*) const;
       
   124 @@ -244,6 +255,8 @@
       
   125  
       
   126  protected:
       
   127  
       
   128 +    virtual ~collate_byname () { }
       
   129 +
       
   130      virtual int
       
   131      do_compare (const char_type*, const char_type*,
       
   132                  const char_type*, const char_type*) const;
       
   133 @@ -263,3 +276,4 @@
       
   134  
       
   135  
       
   136  #endif   // _RWSTD_LOC_COLLATE_H_INCLUDED
       
   137 +
       
   138 
       
   139 #===========================================================================#
       
   140 
       
   141 --- stdcxx-4.2.1/include/loc/_ctype.h	2008-04-24 17:23:39.000000000 -0700
       
   142 +++ stdcxx-4.2.1/include/loc/_ctype.h	2011-06-23 12:55:19.000540849 -0700
       
   143 @@ -64,11 +64,12 @@
       
   144  
       
   145  _RWSTD_NAMESPACE (std) { 
       
   146  
       
   147 -struct _RWSTD_CLASS_EXPORT locale;
       
   148 +class _RWSTD_CLASS_EXPORT locale;
       
   149  
       
   150  // 22.2.1
       
   151 -struct _RWSTD_EXPORT ctype_base
       
   152 +class _RWSTD_EXPORT ctype_base
       
   153  {
       
   154 +public:
       
   155      // 22.2.1, p1 - mask is a bitmask type (see 17.3.3.1.2)
       
   156      typedef _RWSTD_BITMASK_ENUM (_RW::__rw_ctype_mask) mask;
       
   157  
       
   158 @@ -83,6 +84,8 @@
       
   159      _RWSTD_STATIC_CONST (mask, xdigit = _RW::__rw_xdigit);
       
   160      _RWSTD_STATIC_CONST (mask, alnum  = _RW::__rw_alnum);
       
   161      _RWSTD_STATIC_CONST (mask, graph  = _RW::__rw_graph);
       
   162 +
       
   163 +    virtual ~ctype_base () { }
       
   164  };
       
   165  
       
   166  
       
   167 @@ -103,7 +106,8 @@
       
   168      typedef _CharT char_type;
       
   169  
       
   170      _EXPLICIT ctype (_RWSTD_SIZE_T __ref = 0)
       
   171 -        : _RW::__rw_facet (__ref) { }
       
   172 +        : _RW::__rw_facet (__ref),
       
   173 +   		ctype_base () 	{ }
       
   174  
       
   175  
       
   176      // 22.2.1.1.1, p1
       
   177 @@ -171,6 +175,8 @@
       
   178  
       
   179  protected:
       
   180  
       
   181 +    virtual ~ctype() { }
       
   182 +
       
   183      // 22.2.1.1.2, p1
       
   184      virtual bool do_is (mask, char_type) const {
       
   185          return false;
       
   186 @@ -286,14 +292,14 @@
       
   187  
       
   188  protected:
       
   189  
       
   190 +    virtual ~ctype ();
       
   191 +
       
   192      const mask* table () const _THROWS (()) {
       
   193          return _C_mask_tab;
       
   194      }
       
   195  
       
   196      static const mask* classic_table () _THROWS (());
       
   197  
       
   198 -    virtual ~ctype ();
       
   199 -
       
   200      virtual const char_type*
       
   201      do_toupper (char_type*, const char_type*) const;
       
   202  
       
   203 @@ -394,6 +400,10 @@
       
   204          : ctype<_CharT>(__ref) {
       
   205          this->_C_set_name (__name, _C_namebuf, sizeof _C_namebuf);
       
   206      }
       
   207 +
       
   208 +protected:
       
   209 +
       
   210 +    virtual ~ctype_byname () { }
       
   211  };
       
   212  
       
   213  
       
   214 @@ -405,6 +415,10 @@
       
   215  public:
       
   216  
       
   217      _EXPLICIT ctype_byname (const char*, _RWSTD_SIZE_T = 0);
       
   218 +
       
   219 +protected:
       
   220 +
       
   221 +    virtual ~ctype_byname () { }
       
   222  };
       
   223  
       
   224  
       
   225 @@ -653,3 +667,4 @@
       
   226  
       
   227  
       
   228  #endif   // _RWSTD_LOC_CTYPE_H_INCLUDED
       
   229 +
       
   230 #===========================================================================#
       
   231 
       
   232 --- stdcxx-4.2.1/include/loc/_facet.h	2008-04-24 20:23:39.000000000 -0400
       
   233 +++ stdcxx-4.2.1/include/loc/_facet.h	2011-01-07 14:25:25.827689177 -0500
       
   234 @@ -39,19 +39,20 @@
       
   235  
       
   236  _RWSTD_NAMESPACE (std) { 
       
   237  
       
   238 -struct _RWSTD_CLASS_EXPORT locale;
       
   239 +class _RWSTD_CLASS_EXPORT locale;
       
   240  
       
   241  }   // namespace std
       
   242  
       
   243  
       
   244  _RWSTD_NAMESPACE (__rw) { 
       
   245  
       
   246 -class _RWSTD_EXPORT __rw_locale;
       
   247 +class _RWSTD_CLASS_EXPORT __rw_locale;
       
   248  
       
   249  struct __rw_access;
       
   250  
       
   251 -struct _RWSTD_EXPORT __rw_facet: __rw_synchronized
       
   252 +class _RWSTD_CLASS_EXPORT __rw_facet : public __rw_synchronized
       
   253  {
       
   254 +public:
       
   255      // the type of a "constructor" function used to create facet objects
       
   256      // of standard types by the library
       
   257      typedef __rw_facet* (_C_ctor_t)(_RWSTD_SIZE_T, const char*);
       
   258 @@ -225,15 +226,16 @@
       
   259      static __rw_facet*
       
   260      _C_manage (__rw_facet*, _C_facet_type, const char*, _C_ctor_t*);
       
   261  
       
   262 -    friend struct _STD::locale;
       
   263 +    friend class _STD::locale;
       
   264      friend class __rw_locale;
       
   265      friend struct __rw_facet_id;
       
   266      friend struct __rw_access;
       
   267  };
       
   268  
       
   269  
       
   270 -struct _RWSTD_EXPORT __rw_facet_id
       
   271 +class _RWSTD_EXPORT __rw_facet_id
       
   272  {
       
   273 +public:
       
   274  #ifdef _RWSTD_NO_SPECIALIZED_FACET_ID
       
   275  
       
   276      __rw_facet_id () {
       
   277 
       
   278 #===========================================================================#
       
   279 
       
   280 --- stdcxx-4.2.1/include/loc/_locale.h	2008-04-24 20:23:39.000000000 -0400
       
   281 +++ stdcxx-4.2.1/include/loc/_locale.h	2011-01-07 14:37:52.736687266 -0500
       
   282 @@ -119,36 +119,37 @@
       
   283  class ctype;
       
   284  
       
   285  _EXPORT template <class _CharT, class _Iter>
       
   286 -struct money_get;
       
   287 +class money_get;
       
   288  
       
   289  _EXPORT template <class _CharT, class _Iter>
       
   290 -struct money_put;
       
   291 +class money_put;
       
   292  
       
   293  _EXPORT template <class _CharT, bool _Intl>
       
   294 -struct moneypunct;
       
   295 +class moneypunct;
       
   296  
       
   297  _EXPORT template <class _CharT, class _Iter>
       
   298 -struct num_get;
       
   299 +class num_get;
       
   300  
       
   301  _EXPORT template <class _CharT, class _Iter>
       
   302 -struct num_put;
       
   303 +class num_put;
       
   304  
       
   305  _EXPORT template <class _CharT>
       
   306 -struct numpunct;
       
   307 +class numpunct;
       
   308  
       
   309  _EXPORT template <class _CharT, class _Iter>
       
   310  class time_get;
       
   311  
       
   312  _EXPORT template <class _CharT, class _Iter>
       
   313 -struct time_put;
       
   314 +class time_put;
       
   315  
       
   316  _EXPORT template <class _CharT>
       
   317  class messages;
       
   318  
       
   319   
       
   320  // 22.1.1
       
   321 -struct _RWSTD_CLASS_EXPORT locale
       
   322 +class _RWSTD_CLASS_EXPORT locale
       
   323  {
       
   324 +public:
       
   325      // 22.1.1.1.1, p1
       
   326      typedef int category;
       
   327  
       
   328 @@ -251,12 +252,11 @@
       
   329  
       
   330  #endif   // _RWSTD_NO_MEMBER_TEMPLATES
       
   331  
       
   332 -
       
   333      // 22.1.1.2, p14
       
   334      _RWSTD_MEMBER_EXPORT locale (const locale&, const locale&, category);
       
   335  
       
   336      // 22.1.1.2, p16
       
   337 -    _RWSTD_MEMBER_EXPORT ~locale() _THROWS (());
       
   338 +    _RWSTD_MEMBER_EXPORT virtual ~locale() _THROWS (());
       
   339  
       
   340      // 22.1.1.2, p4
       
   341      _RWSTD_MEMBER_EXPORT const locale& operator= (const locale&) _THROWS (());
       
   342 
       
   343 #===========================================================================#
       
   344 --- stdcxx-4.2.1/include/loc/_messages.h	2008-04-24 17:23:39.000000000 -0700
       
   345 +++ stdcxx-4.2.1/include/loc/_messages.h	2011-06-16 10:59:37.994304507 -0700
       
   346 @@ -63,9 +63,12 @@
       
   347  _RWSTD_NAMESPACE (std) { 
       
   348  
       
   349  
       
   350 -struct _RWSTD_EXPORT messages_base
       
   351 +class _RWSTD_EXPORT messages_base
       
   352  {
       
   353 +public:
       
   354      typedef int catalog;
       
   355 +
       
   356 +    virtual ~messages_base () { }
       
   357  };
       
   358  
       
   359  
       
   360 @@ -102,6 +105,8 @@
       
   361  
       
   362  protected:
       
   363  
       
   364 +    virtual ~messages () { }
       
   365 +
       
   366      virtual catalog do_open (const string&, const locale&) const;
       
   367  
       
   368      virtual string_type do_get (catalog, int, int, const string_type&) const;
       
   369 @@ -128,6 +133,7 @@
       
   370  template <class _CharT>
       
   371  class messages_byname: public messages<_CharT>
       
   372  {
       
   373 +public:
       
   374      char _C_namebuf [32];
       
   375  
       
   376  public:
       
   377 @@ -136,6 +142,10 @@
       
   378          : messages<_CharT>(__refs) {
       
   379          this->_C_set_name (__name, _C_namebuf, sizeof _C_namebuf);
       
   380      }
       
   381 +
       
   382 +protected:
       
   383 +
       
   384 +    virtual ~messages_byname () { }
       
   385  };
       
   386  
       
   387  }   // namespace std
       
   388 #===========================================================================#
       
   389 
       
   390 --- stdcxx-4.2.1/include/loc/_money_get.h	2008-04-24 20:23:39.000000000 -0400
       
   391 +++ stdcxx-4.2.1/include/loc/_money_get.h	2011-01-07 18:30:40.252939791 -0500
       
   392 @@ -50,8 +50,9 @@
       
   393  
       
   394  _EXPORT
       
   395  template <class _CharT, class _InputIter = istreambuf_iterator<_CharT> >
       
   396 -struct money_get: _RW::__rw_facet
       
   397 +class money_get : public _RW::__rw_facet
       
   398  {
       
   399 +public:
       
   400      typedef _CharT     char_type;
       
   401      typedef _InputIter iter_type;
       
   402      typedef
       
   403 @@ -95,6 +96,8 @@
       
   404  
       
   405  #endif   // _RWSTD_NO_LONG_DOUBLE
       
   406  
       
   407 +	virtual ~money_get () { }
       
   408 +
       
   409      virtual iter_type
       
   410      do_get (iter_type __it, iter_type __end, bool __intl, ios_base &__fl,
       
   411              _RWSTD_IOSTATE &__err, string_type &__str) const {
       
   412 @@ -134,13 +137,13 @@
       
   413  
       
   414  #if _RWSTD_INSTANTIATE (_MONEY_GET, _CHAR)
       
   415  
       
   416 -_RWSTD_INSTANTIATE_1 (struct _RWSTD_TI_EXPORT money_get<char>);
       
   417 +_RWSTD_INSTANTIATE_1 (class _RWSTD_TI_EXPORT money_get<char>);
       
   418  
       
   419  #endif   // _RWSTD_INSTANTIATE (_MONEY_GET, _CHAR)
       
   420  
       
   421  #if _RWSTD_INSTANTIATE (_MONEY_GET, _WCHAR_T)
       
   422  
       
   423 -_RWSTD_INSTANTIATE_1 (struct _RWSTD_TI_EXPORT money_get<wchar_t>);
       
   424 +_RWSTD_INSTANTIATE_1 (class _RWSTD_TI_EXPORT money_get<wchar_t>);
       
   425  
       
   426  #endif   // _RWSTD_INSTANTIATE (_MONEY_GET, _WCHAR_T)
       
   427  
       
   428 @@ -153,3 +156,4 @@
       
   429  
       
   430  
       
   431  #endif   // _RWSTD_LOC_MONEY_GET_H_INCLUDED
       
   432 +
       
   433 
       
   434 #===========================================================================#
       
   435 
       
   436 --- stdcxx-4.2.1/include/loc/_moneypunct.h	2008-04-24 17:23:39.000000000 -0700
       
   437 +++ stdcxx-4.2.1/include/loc/_moneypunct.h	2011-06-16 11:01:58.479524965 -0700
       
   438 @@ -46,27 +46,31 @@
       
   439  
       
   440  _RWSTD_NAMESPACE (std) { 
       
   441  
       
   442 -
       
   443  // 22.2.6.3
       
   444 -struct money_base
       
   445 +class money_base
       
   446  {
       
   447 +public:
       
   448      enum part { none, space, symbol, sign, value };
       
   449      struct pattern { char field [4]; };
       
   450 +
       
   451 +    virtual ~money_base () { }
       
   452  };
       
   453  
       
   454  
       
   455  // 22.2.6.3
       
   456  _EXPORT
       
   457  template <class _CharT, bool _Intl = false>
       
   458 -struct moneypunct: _RW::__rw_facet, public money_base
       
   459 +class moneypunct : public _RW::__rw_facet, public money_base
       
   460  {
       
   461 +public:
       
   462      typedef _CharT char_type;
       
   463      typedef
       
   464      basic_string<char_type, char_traits<char_type>, allocator<char_type> >
       
   465      string_type;
       
   466  
       
   467      _EXPLICIT moneypunct (_RWSTD_SIZE_T __refs = 0)
       
   468 -        : _RW::__rw_facet (__refs) { }
       
   469 +        : _RW::__rw_facet (__refs),
       
   470 +		money_base () { }
       
   471  
       
   472      char_type decimal_point () const {
       
   473          return do_decimal_point ();
       
   474 @@ -110,6 +114,8 @@
       
   475  
       
   476  protected:
       
   477  
       
   478 +    virtual ~moneypunct () { }
       
   479 +
       
   480      // 22.2.6.3.1, p1
       
   481      virtual char_type do_decimal_point () const {
       
   482          return *_C_get (this, _RW::__rw_dp);
       
   483 @@ -211,6 +217,10 @@
       
   484          : moneypunct<_CharT, _Intl>(__ref) {
       
   485              this->_C_set_name (__name, _C_namebuf, sizeof _C_namebuf);
       
   486          }
       
   487 +
       
   488 +protected:
       
   489 +
       
   490 +    virtual ~moneypunct_byname () { }
       
   491  };
       
   492  
       
   493  
       
   494 @@ -226,15 +236,15 @@
       
   495  
       
   496  #if _RWSTD_INSTANTIATE (_MONEYPUNCT, _CHAR)
       
   497  
       
   498 -_RWSTD_INSTANTIATE_2 (struct _RWSTD_TI_EXPORT moneypunct<char, true>);
       
   499 -_RWSTD_INSTANTIATE_2 (struct _RWSTD_TI_EXPORT moneypunct<char, false>);
       
   500 +_RWSTD_INSTANTIATE_2 (class _RWSTD_TI_EXPORT moneypunct<char, true>);
       
   501 +_RWSTD_INSTANTIATE_2 (class _RWSTD_TI_EXPORT moneypunct<char, false>);
       
   502  
       
   503  #endif   // _RWSTD_INSTANTIATE (_MONEYPUNCT, _CHAR)
       
   504  
       
   505  #if _RWSTD_INSTANTIATE (_MONEYPUNCT, _WCHAR_T)
       
   506  
       
   507 -_RWSTD_INSTANTIATE_2 (struct _RWSTD_TI_EXPORT moneypunct<wchar_t, true>);
       
   508 -_RWSTD_INSTANTIATE_2 (struct _RWSTD_TI_EXPORT moneypunct<wchar_t, false>);
       
   509 +_RWSTD_INSTANTIATE_2 (class _RWSTD_TI_EXPORT moneypunct<wchar_t, true>);
       
   510 +_RWSTD_INSTANTIATE_2 (class _RWSTD_TI_EXPORT moneypunct<wchar_t, false>);
       
   511  
       
   512  #endif   // _RWSTD_INSTANTIATE (_MONEYPUNCT, _WCHAR_T)
       
   513  
       
   514 @@ -247,3 +257,4 @@
       
   515  
       
   516  
       
   517  #endif   // _RWSTD_LOC_MONEYPUNCT_H_INCLUDED
       
   518 +
       
   519 #===========================================================================#
       
   520 
       
   521 --- stdcxx-4.2.1/include/loc/_money_put.h	2008-04-24 20:23:39.000000000 -0400
       
   522 +++ stdcxx-4.2.1/include/loc/_money_put.h	2011-01-07 18:31:43.278708402 -0500
       
   523 @@ -51,8 +51,10 @@
       
   524  // 22.2.6.2
       
   525  _EXPORT
       
   526  template <class _CharT, class _OutputIter = ostreambuf_iterator<_CharT> >
       
   527 -struct money_put: _RW::__rw_facet
       
   528 +class money_put : public _RW::__rw_facet
       
   529  {
       
   530 +public:
       
   531 +
       
   532      typedef _CharT      char_type;
       
   533      typedef _OutputIter iter_type;
       
   534  
       
   535 @@ -78,6 +80,8 @@
       
   536  
       
   537  protected:
       
   538  
       
   539 +    virtual ~money_put () { }
       
   540 +
       
   541      // 22.2.6.2.2, p1
       
   542      virtual iter_type
       
   543      do_put (iter_type, bool, ios_base&, char_type, long double) const;
       
   544 
       
   545 #===========================================================================#
       
   546 
       
   547 --- stdcxx-4.2.1/include/loc/_num_get.h	2008-04-24 17:23:39.000000000 -0700
       
   548 +++ stdcxx-4.2.1/include/loc/_num_get.h	2011-06-23 11:45:25.850740566 -0700
       
   549 @@ -51,8 +51,9 @@
       
   550  // 22.2.2.1
       
   551  _EXPORT
       
   552  template <class _CharT, class _InputIter = istreambuf_iterator<_CharT> >
       
   553 -struct num_get: _RW::__rw_facet
       
   554 +class num_get : public _RW::__rw_facet
       
   555  {
       
   556 +public:
       
   557      typedef _CharT     char_type;
       
   558      typedef _InputIter iter_type;
       
   559  
       
   560 @@ -157,6 +158,8 @@
       
   561  
       
   562  protected:
       
   563  
       
   564 +    virtual ~num_get() { }
       
   565 +
       
   566  #ifndef _RWSTD_NO_NATIVE_BOOL
       
   567  
       
   568      virtual iter_type
       
   569 @@ -357,13 +360,13 @@
       
   570  
       
   571  #if _RWSTD_INSTANTIATE (_NUM_GET, _CHAR)
       
   572  
       
   573 -_RWSTD_INSTANTIATE_1 (struct _RWSTD_TI_EXPORT num_get<char>);
       
   574 +_RWSTD_INSTANTIATE_1 (class _RWSTD_TI_EXPORT num_get<char>);
       
   575  
       
   576  #endif   // _RWSTD_INSTANTIATE (_NUM_GET, _CHAR)
       
   577  
       
   578  #if _RWSTD_INSTANTIATE (_NUM_GET, _WCHAR_T)
       
   579  
       
   580 -_RWSTD_INSTANTIATE_1 (struct _RWSTD_TI_EXPORT num_get<wchar_t>);
       
   581 +_RWSTD_INSTANTIATE_1 (class _RWSTD_TI_EXPORT num_get<wchar_t>);
       
   582  
       
   583  #endif   // _RWSTD_INSTANTIATE (_NUM_GET, _WCHAR_T)
       
   584 
       
   585 #===========================================================================#
       
   586 
       
   587 --- stdcxx-4.2.1/include/loc/_numpunct.h	2008-04-24 20:23:39.000000000 -0400
       
   588 +++ stdcxx-4.2.1/include/loc/_numpunct.h	2011-01-07 18:35:01.795823207 -0500
       
   589 @@ -53,8 +53,9 @@
       
   590  // 22.2.3.1
       
   591  _EXPORT
       
   592  template <class _CharT>
       
   593 -struct numpunct: _RW::__rw_facet
       
   594 +class numpunct : public _RW::__rw_facet
       
   595  {
       
   596 +public:
       
   597      typedef _CharT char_type;
       
   598      typedef
       
   599      basic_string<char_type, char_traits<char_type>, allocator<char_type> >
       
   600 @@ -63,8 +64,6 @@
       
   601      _EXPLICIT numpunct (_RWSTD_SIZE_T __ref = 0)
       
   602          : _RW::__rw_facet (__ref), _C_flags (0) { }
       
   603  
       
   604 -    virtual ~numpunct ();
       
   605 -
       
   606      // 22.2.3.1.1, p1
       
   607      char_type decimal_point () const;
       
   608  
       
   609 @@ -84,6 +83,8 @@
       
   610  
       
   611  protected:
       
   612  
       
   613 +    virtual ~numpunct () { }
       
   614 +
       
   615      // 22.2.3.1.2, p1
       
   616      virtual char_type do_decimal_point () const {
       
   617          return *_RW::__rw_get_punct (this, _RW::__rw_dp, char_type ());
       
   618 @@ -238,6 +239,10 @@
       
   619          : numpunct<_CharT>(__refs) {
       
   620          this->_C_set_name (__name, _C_namebuf, sizeof _C_namebuf);
       
   621      }
       
   622 +
       
   623 +protected:
       
   624 +
       
   625 +    virtual ~numpunct_byname () { }
       
   626  };
       
   627  
       
   628  }   // namespace std
       
   629 @@ -252,13 +257,13 @@
       
   630  
       
   631  #if _RWSTD_INSTANTIATE (_NUMPUNCT, _CHAR)
       
   632  
       
   633 -_RWSTD_INSTANTIATE_1 (struct _RWSTD_TI_EXPORT numpunct<char>);
       
   634 +_RWSTD_INSTANTIATE_1 (class _RWSTD_TI_EXPORT numpunct<char>);
       
   635  
       
   636  #endif   // _RWSTD_INSTANTIATE (_NUMPUNCT, _CHAR)
       
   637  
       
   638  #if _RWSTD_INSTANTIATE (_NUMPUNCT, _WCHAR_T)
       
   639  
       
   640 -_RWSTD_INSTANTIATE_1 (struct _RWSTD_TI_EXPORT numpunct<wchar_t>);
       
   641 +_RWSTD_INSTANTIATE_1 (class _RWSTD_TI_EXPORT numpunct<wchar_t>);
       
   642  
       
   643  #endif   // _RWSTD_INSTANTIATE (_NUMPUNCT, _WCHAR_T)
       
   644  
       
   645 
       
   646 #===========================================================================#
       
   647 
       
   648 --- stdcxx-4.2.1/include/loc/_num_put.cc	2008-04-24 20:23:39.000000000 -0400
       
   649 +++ stdcxx-4.2.1/include/loc/_num_put.cc	2011-01-07 18:34:22.399689475 -0500
       
   650 @@ -63,7 +63,7 @@
       
   651  
       
   652  
       
   653  template <class _CharT, class _OutputIter /* = ostreambuf_iterator<_CharT> */>
       
   654 -/* virtual */ num_put<_CharT, _OutputIter>::~num_put ()
       
   655 +/* virtual */ num_put<_CharT, _OutputIter>::~num_put ()
       
   656  {
       
   657      // no-op
       
   658  }
       
   659 
       
   660 #===========================================================================#
       
   661 
       
   662 --- stdcxx-4.2.1/include/loc/_num_put.h	2008-04-24 17:23:39.000000000 -0700
       
   663 +++ stdcxx-4.2.1/include/loc/_num_put.h	2011-06-23 11:45:54.213483922 -0700
       
   664 @@ -51,16 +51,15 @@
       
   665  // 22.2.2.2
       
   666  _EXPORT
       
   667  template <class _CharT, class _OutputIter = ostreambuf_iterator<_CharT> >
       
   668 -struct num_put: _RW::__rw_facet
       
   669 +class num_put : public _RW::__rw_facet
       
   670  {
       
   671 +public:
       
   672      typedef _CharT      char_type;
       
   673      typedef _OutputIter iter_type;
       
   674  
       
   675      _EXPLICIT num_put (_RWSTD_SIZE_T __refs = 0)
       
   676          : _RW::__rw_facet (__refs) { }
       
   677  
       
   678 -    virtual ~num_put ();
       
   679 -
       
   680  #ifndef _RWSTD_NO_BOOL
       
   681  
       
   682      iter_type put (iter_type __it, ios_base& __flags, char_type __fill,
       
   683 @@ -122,6 +121,8 @@
       
   684  
       
   685  protected:
       
   686  
       
   687 +    virtual ~num_put ();
       
   688 +
       
   689  #ifndef _RWSTD_NO_BOOL
       
   690  
       
   691      virtual iter_type
       
   692 @@ -218,13 +219,13 @@
       
   693  
       
   694  #if _RWSTD_INSTANTIATE (_NUM_PUT, _CHAR)
       
   695  
       
   696 -_RWSTD_INSTANTIATE_1 (struct _RWSTD_TI_EXPORT num_put<char>);
       
   697 +_RWSTD_INSTANTIATE_1 (class _RWSTD_TI_EXPORT num_put<char>);
       
   698  
       
   699  #endif   // _RWSTD_INSTANTIATE (_NUM_PUT, _CHAR)
       
   700  
       
   701  #if _RWSTD_INSTANTIATE (_NUM_PUT, _WCHAR_T)
       
   702  
       
   703 -_RWSTD_INSTANTIATE_1 (struct _RWSTD_TI_EXPORT num_put<wchar_t>);
       
   704 +_RWSTD_INSTANTIATE_1 (class _RWSTD_TI_EXPORT num_put<wchar_t>);
       
   705  
       
   706  #endif   // _RWSTD_INSTANTIATE (_NUM_PUT, _WCHAR_T)
       
   707  
       
   708 #===========================================================================#
       
   709 
       
   710 --- stdcxx-4.2.1/include/loc/_time_get.h	2008-04-24 20:23:39.000000000 -0400
       
   711 +++ stdcxx-4.2.1/include/loc/_time_get.h	2011-01-07 17:52:39.964752529 -0500
       
   712 @@ -57,23 +57,29 @@
       
   713  
       
   714  
       
   715  // 22.2.5.1
       
   716 -struct _RWSTD_EXPORT time_base
       
   717 +class _RWSTD_EXPORT time_base
       
   718  {
       
   719 +public:
       
   720     enum dateorder { no_order, dmy, mdy, ymd, ydm };
       
   721 +
       
   722 +   time_base() { }
       
   723 +   virtual ~time_base() { }
       
   724  };
       
   725  
       
   726  
       
   727  // 22.2.5.1
       
   728  _EXPORT
       
   729  template <class _CharT, class _InputIter = istreambuf_iterator<_CharT> >
       
   730 -class time_get: public _RW::__rw_facet, public time_base
       
   731 +class time_get : public _RW::__rw_facet,
       
   732 +				 public time_base
       
   733  {
       
   734  public:
       
   735      typedef _CharT                         char_type;
       
   736      typedef _InputIter                     iter_type;
       
   737  
       
   738      _EXPLICIT time_get (_RWSTD_SIZE_T __ref = 0)
       
   739 -        : _RW::__rw_facet (__ref) { }
       
   740 +        : _RW::__rw_facet (__ref),
       
   741 +   		time_base () { }
       
   742  
       
   743      dateorder date_order() const { 
       
   744          return do_date_order(); 
       
   745 @@ -134,6 +140,8 @@
       
   746  
       
   747  protected:
       
   748  
       
   749 +    virtual ~time_get () { }
       
   750 +
       
   751      virtual dateorder do_date_order()  const {
       
   752          return dateorder ();
       
   753      }
       
   754 @@ -207,6 +215,9 @@
       
   755          : time_get<_CharT, _InputIter>(__ref) {
       
   756          this->_C_set_name (__name, _C_namebuf, sizeof _C_namebuf);
       
   757      }
       
   758 +
       
   759 +protected:
       
   760 +    virtual ~time_get_byname () { }
       
   761  };
       
   762  
       
   763  }   // namespace std
       
   764 
       
   765 #===========================================================================#
       
   766 
       
   767 --- stdcxx-4.2.1/include/loc/_time_put.h	2008-04-24 20:23:39.000000000 -0400
       
   768 +++ stdcxx-4.2.1/include/loc/_time_put.h	2011-01-07 18:36:06.500939415 -0500
       
   769 @@ -53,8 +53,9 @@
       
   770  // 22.2.5.3
       
   771  _EXPORT
       
   772  template <class _CharT, class _OutputIter = ostreambuf_iterator<_CharT> >
       
   773 -struct time_put: _RW::__rw_facet
       
   774 +class time_put : public _RW::__rw_facet
       
   775  {
       
   776 +public:
       
   777      typedef _CharT      char_type;
       
   778      typedef _OutputIter iter_type;
       
   779  
       
   780 @@ -74,6 +75,9 @@
       
   781  
       
   782  protected:
       
   783  
       
   784 +    // 22.2.5.3
       
   785 +    virtual ~time_put() { }
       
   786 +
       
   787      // 22.2.5.3.2, p1
       
   788      virtual iter_type
       
   789      do_put (iter_type, ios_base&, char_type, const tm*, char, char) const;
       
   790 @@ -101,11 +105,14 @@
       
   791      char _C_namebuf [32];
       
   792  
       
   793  public:
       
   794 -
       
   795 +    //22.2.5.4
       
   796      _EXPLICIT time_put_byname (const char *__name, _RWSTD_SIZE_T __ref = 0)
       
   797          : time_put<_CharT, _OutputIter>(__ref) {
       
   798          this->_C_set_name (__name, _C_namebuf, sizeof _C_namebuf);
       
   799      }
       
   800 +
       
   801 +protected:
       
   802 +    virtual ~time_put_byname() { }
       
   803  };
       
   804  
       
   805  }   // namespace std
       
   806 @@ -120,13 +127,13 @@
       
   807  
       
   808  #if _RWSTD_INSTANTIATE (_TIME_PUT, _CHAR)
       
   809  
       
   810 -_RWSTD_INSTANTIATE_1 (struct _RWSTD_TI_EXPORT time_put<char>);
       
   811 +_RWSTD_INSTANTIATE_1 (class _RWSTD_TI_EXPORT time_put<char>);
       
   812  
       
   813  #endif   // _RWSTD_INSTANTIATE (_TIME_PUT, _CHAR)
       
   814  
       
   815  #if _RWSTD_INSTANTIATE (_TIME_PUT, _WCHAR_T)
       
   816  
       
   817 -_RWSTD_INSTANTIATE_1 (struct _RWSTD_TI_EXPORT time_put<wchar_t>);
       
   818 +_RWSTD_INSTANTIATE_1 (class _RWSTD_TI_EXPORT time_put<wchar_t>);
       
   819  
       
   820  #endif   // _RWSTD_INSTANTIATE (_TIME_PUT, _WCHAR_T)
       
   821  
       
   822 @@ -139,3 +146,4 @@
       
   823  
       
   824  
       
   825  #endif   // _RWSTD_LOC_TIME_PUT_H_INCLUDED
       
   826 +
       
   827 
       
   828 #===========================================================================#
       
   829 
       
   830 --- stdcxx-4.2.1/src/codecvt.cpp	2008-04-24 20:25:19.000000000 -0400
       
   831 +++ stdcxx-4.2.1/src/codecvt.cpp	2011-01-07 18:25:48.692939914 -0500
       
   832 @@ -105,7 +105,8 @@
       
   833  }
       
   834  
       
   835  
       
   836 -/* virtual */ codecvt<char, char, _RWSTD_MBSTATE_T>::~codecvt ()
       
   837 +/* virtual */
       
   838 +codecvt<char, char, _RWSTD_MBSTATE_T>::~codecvt ()
       
   839  {
       
   840      // no-op
       
   841  }
       
   842 @@ -264,6 +265,12 @@
       
   843      return 1;   // 22.2.1.5.2, p11
       
   844  }
       
   845  
       
   846 +/* virtual */
       
   847 +codecvt<wchar_t, char, _RWSTD_MBSTATE_T>::~codecvt ()
       
   848 +{
       
   849 +	// no-op
       
   850 +}
       
   851 +
       
   852  
       
   853  }   // namespace std
       
   854  
       
   855 @@ -272,3 +279,4 @@
       
   856  _RWSTD_DEFINE_FACET_FACTORY (static, codecvt, TARGS_C, codecvt);
       
   857  _RWSTD_SPECIALIZE_USE_FACET (codecvt);
       
   858  
       
   859 +
       
   860 
       
   861 #===========================================================================#
       
   862 
       
   863 --- stdcxx-4.2.1/src/ctype.cpp	2011-01-04 06:08:35.707605814 -0500
       
   864 +++ stdcxx-4.2.1/src/ctype.cpp	2011-01-07 18:27:32.253787318 -0500
       
   865 @@ -693,7 +693,7 @@
       
   866  }
       
   867  
       
   868  
       
   869 -ctype<char>::~ctype ()
       
   870 +ctype<char>::~ctype ()
       
   871  {
       
   872      if (_C_delete_it) {
       
   873          delete[] _RWSTD_CONST_CAST (mask*, _C_mask_tab);
       
   874 
       
   875 #===========================================================================#
       
   876 
       
   877 --- stdcxx-4.2.1/src/wctype.cpp	2008-04-24 20:25:19.000000000 -0400
       
   878 +++ stdcxx-4.2.1/src/wctype.cpp	2011-01-07 18:38:16.685689748 -0500
       
   879 @@ -442,7 +442,7 @@
       
   880  }
       
   881  
       
   882  
       
   883 -ctype<wchar_t>::~ctype ()
       
   884 +ctype<wchar_t>::~ctype ()
       
   885  {
       
   886      if (_C_delete_it) {
       
   887          delete[] _RWSTD_CONST_CAST (mask*, _C_mask_tab);
       
   888 @@ -759,8 +759,7 @@
       
   889  }
       
   890  
       
   891  
       
   892 -ctype_byname<wchar_t>::
       
   893 -~ctype_byname ()
       
   894 +ctype_byname<wchar_t>::~ctype_byname ()
       
   895  {
       
   896      // Release the codecvt database at this level
       
   897      if (_C_cvtimpl != 0 && _C_cvtsize != 0)
       
   898 
       
   899 #===========================================================================#
       
   900 
       
   901 --- stdcxx-4.2.1/tests/localization/22.locale.numpunct.cpp	2011-01-04 06:08:35.659216745 -0500
       
   902 +++ stdcxx-4.2.1/tests/localization/22.locale.numpunct.cpp	2011-01-07 21:12:45.448937997 -0500
       
   903 @@ -252,6 +252,19 @@
       
   904      return true;
       
   905  }
       
   906  
       
   907 +template <class charT>
       
   908 +class test_numpunct : public std::numpunct<charT>
       
   909 +{
       
   910 +public:
       
   911 +
       
   912 +	typedef std::basic_string<charT> string_type;
       
   913 +
       
   914 +	explicit test_numpunct(size_t refs = 0)
       
   915 +	: std::numpunct<charT> (refs) { }
       
   916 +
       
   917 +	virtual ~test_numpunct () { }
       
   918 +};
       
   919 +
       
   920  /**************************************************************************/
       
   921  
       
   922  template <class charT>
       
   923 @@ -259,11 +272,11 @@
       
   924                            const char        *tname,
       
   925                            const std::locale *loc)
       
   926  {
       
   927 -    typedef std::numpunct<charT>    Punct;
       
   928 +    typedef test_numpunct<charT>    Punct;
       
   929      typedef std::char_traits<charT> Traits;
       
   930  
       
   931      const charT c = loc ?
       
   932 -          _STD_USE_FACET (Punct, *loc).decimal_point ()
       
   933 +          _STD_USE_FACET (std::numpunct<charT>, *loc).decimal_point ()
       
   934          : Punct ().decimal_point ();
       
   935  
       
   936  
       
   937 @@ -279,11 +292,11 @@
       
   938                            const char        *tname,
       
   939                            const std::locale *loc)
       
   940  {
       
   941 -    typedef std::numpunct<charT>    Punct;
       
   942 +    typedef test_numpunct<charT>    Punct;
       
   943      typedef std::char_traits<charT> Traits;
       
   944  
       
   945      const charT c = loc ?
       
   946 -          _STD_USE_FACET (Punct, *loc).thousands_sep ()
       
   947 +          _STD_USE_FACET (std::numpunct<charT>, *loc).thousands_sep ()
       
   948          : Punct ().thousands_sep ();
       
   949  
       
   950      rw_assert (Traits::eq (c, expect), 0, __LINE__,
       
   951 @@ -299,10 +312,10 @@
       
   952                       const std::string &expect,
       
   953                       const std::locale *loc)
       
   954  {
       
   955 -    typedef std::numpunct<charT> Punct;
       
   956 +    typedef test_numpunct<charT> Punct;
       
   957  
       
   958      const std::string s = loc ?
       
   959 -          _STD_USE_FACET (Punct, *loc).grouping ()
       
   960 +          _STD_USE_FACET (std::numpunct<charT>, *loc).grouping ()
       
   961          : Punct ().grouping ();
       
   962  
       
   963      if (   s != expect
       
   964 @@ -338,10 +351,10 @@
       
   965                        const char                     *tname,
       
   966                        const std::locale              *loc)
       
   967  {
       
   968 -    typedef std::numpunct<charT> Punct;
       
   969 +    typedef test_numpunct<charT> Punct;
       
   970  
       
   971      const std::basic_string<charT> s = loc ?
       
   972 -          _STD_USE_FACET (Punct, *loc).falsename ()
       
   973 +          _STD_USE_FACET (std::numpunct<charT>, *loc).falsename ()
       
   974          : Punct ().falsename ();
       
   975  
       
   976      const int char_size = int (sizeof (charT));
       
   977 @@ -358,10 +371,10 @@
       
   978                       const char                     *tname,
       
   979                       const std::locale              *loc)
       
   980  {
       
   981 -    typedef std::numpunct<charT> Punct;
       
   982 +    typedef test_numpunct<charT> Punct;
       
   983  
       
   984      const std::basic_string<charT> s = loc ?
       
   985 -          _STD_USE_FACET (Punct, *loc).truename ()
       
   986 +          _STD_USE_FACET (std::numpunct<charT>, *loc).truename ()
       
   987          : Punct ().truename ();
       
   988  
       
   989      const int char_size = int (sizeof (charT));
       
   990 
       
   991 --- stdcxx-4.2.1/src/locale_body.cpp	2011-01-12 23:02:08.654127020 -0500
       
   992 +++ stdcxx-4.2.1/src/locale_body.cpp	2011-01-13 10:07:31.079752886 -0500
       
   993 @@ -859,6 +859,22 @@
       
   994          return tmp;
       
   995      }
       
   996  
       
   997 +	if (plocale && (plocale == classic)) {
       
   998 +		// optimize the "destruction" of the classic C locale
       
   999 +		// the object is never destroyed and its reference count
       
  1000 +		// never drops to 0
       
  1001 +		_RWSTD_ASSERT (__rw_is_C (locname));
       
  1002 +		_RWSTD_ASSERT (__rw_is_C (plocale->_C_name));
       
  1003 +
       
  1004 +		const size_t ref =
       
  1005 +			_RWSTD_ATOMIC_PREDECREMENT (plocale->_C_ref, false);
       
  1006 +
       
  1007 +		_RWSTD_ASSERT (ref + 1U != 0);
       
  1008 +		_RWSTD_UNUSED (ref);
       
  1009 +
       
  1010 +		return 0;
       
  1011 +	}
       
  1012 +
       
  1013  
       
  1014      // re-entrant to protect static local data structures
       
  1015      // (not the locales themselves)
       
  1016 @@ -1079,24 +1095,33 @@
       
  1017              return false;
       
  1018          }
       
  1019  
       
  1020 +		_RWSTD_ASSERT (0 == _C_usr_facets);
       
  1021 +
       
  1022 +		if ((_C_all == _C_std_facet_bits) && (0 == _C_byname_facet_bits)) {
       
  1023 +			// optimized for the C locale
       
  1024 +			_RWSTD_ASSERT (__rw_is_C (_C_name));
       
  1025 +
       
  1026 +			return true;
       
  1027 +		}
       
  1028 +
       
  1029          // unless all facets in the same category come either from
       
  1030          // the C locale or from some named locale the locale object
       
  1031          // containing the facets is not managed (this test doesn't
       
  1032          // detect categores of all byname facets not all of which
       
  1033          // belong to the same named locale)
       
  1034          if (   (_C_std_facet_bits & _C_all) != _C_all
       
  1035 -            || (_C_byname_facet_bits & _C_collate)
       
  1036 -            && (_C_byname_facet_bits & _C_collate)  != _C_collate
       
  1037 -            || (_C_byname_facet_bits & _C_ctype)
       
  1038 -            && (_C_byname_facet_bits & _C_ctype)    != _C_ctype
       
  1039 -            || (_C_byname_facet_bits & _C_monetary)
       
  1040 -            && (_C_byname_facet_bits & _C_monetary) != _C_monetary
       
  1041 -            || (_C_byname_facet_bits & _C_numeric)
       
  1042 -            && (_C_byname_facet_bits & _C_numeric)  != _C_numeric
       
  1043 -            || (_C_byname_facet_bits & _C_time)
       
  1044 -            && (_C_byname_facet_bits & _C_time)     != _C_time
       
  1045 -            || (_C_byname_facet_bits & _C_messages)
       
  1046 -            && (_C_byname_facet_bits & _C_messages) != _C_messages)
       
  1047 +            || ((_C_byname_facet_bits & _C_collate)
       
  1048 +            && (_C_byname_facet_bits & _C_collate)  != _C_collate)
       
  1049 +            || ((_C_byname_facet_bits & _C_ctype)
       
  1050 +            && (_C_byname_facet_bits & _C_ctype)    != _C_ctype)
       
  1051 +            || ((_C_byname_facet_bits & _C_monetary)
       
  1052 +            && (_C_byname_facet_bits & _C_monetary) != _C_monetary)
       
  1053 +            || ((_C_byname_facet_bits & _C_numeric)
       
  1054 +            && (_C_byname_facet_bits & _C_numeric)  != _C_numeric)
       
  1055 +            || ((_C_byname_facet_bits & _C_time)
       
  1056 +            && (_C_byname_facet_bits & _C_time)     != _C_time)
       
  1057 +            || ((_C_byname_facet_bits & _C_messages)
       
  1058 +            && (_C_byname_facet_bits & _C_messages) != _C_messages))
       
  1059              return false;
       
  1060  
       
  1061          // check whether all _byname facets in each category belong
       
  1062 
       
  1063 #===========================================================================#
       
  1064 
       
  1065 --- stdcxx-4.2.1/src/locale_combine.cpp	2008-04-24 20:25:19.000000000 -0400
       
  1066 +++ stdcxx-4.2.1/src/locale_combine.cpp	2011-01-13 11:28:33.684689143 -0500
       
  1067 @@ -235,11 +235,11 @@
       
  1068      // compute and assign facet bitmaps
       
  1069      const int bits = _C_LC2facet_bits (cat);
       
  1070  
       
  1071 -    _C_std_facet_bits    =   one._C_std_facet_bits & ~bits
       
  1072 -                           | other._C_std_facet_bits & bits;
       
  1073 +    _C_std_facet_bits    =   (one._C_std_facet_bits & ~bits)
       
  1074 +                           | (other._C_std_facet_bits & bits);
       
  1075  
       
  1076 -    _C_byname_facet_bits =   one._C_byname_facet_bits & ~bits
       
  1077 -                           | other._C_byname_facet_bits & bits;
       
  1078 +    _C_byname_facet_bits =   (one._C_byname_facet_bits & ~bits)
       
  1079 +                           | (other._C_byname_facet_bits & bits);
       
  1080  
       
  1081      for (_RWSTD_SIZE_T i = 0; i != _C_n_std_facets; ++i) {
       
  1082  
       
  1083 @@ -502,15 +502,12 @@
       
  1084          const char *pcatnames [__rw_n_cats] = { 0 };
       
  1085  
       
  1086          // try the libc "native" separator first, semicolon next
       
  1087 -        const char *sep = strchr (locname, *_RWSTD_CAT_SEP);
       
  1088 -        if (!sep)
       
  1089 -            sep = ";";
       
  1090 -
       
  1091 -        for (const char *s = locname; *s; ) {
       
  1092 -
       
  1093 -            const char *next = strchr (s, *sep);
       
  1094 -            if (!next)
       
  1095 -                next = s + strlen (s);
       
  1096 +	const char* const psep = strchr (locname, *_RWSTD_CAT_SEP);
       
  1097 +        const char sep = psep ? *psep : ';';
       
  1098 +
       
  1099 +		// redundant check for s being non-null shuts up a bogus
       
  1100 +		// cadvise null pointer derefence warning
       
  1101 +        for (const char *s = locname; s && *s; ) {
       
  1102  
       
  1103              const char* const endcat = strchr (s, '=');
       
  1104              if (!endcat)
       
  1105 @@ -530,7 +527,9 @@
       
  1106                  }
       
  1107              }
       
  1108  
       
  1109 -            s = *next ? next + 1 : next;
       
  1110 +			// advance just past the next separator if one exists
       
  1111 +			const char* const next = strchr (s, sep);
       
  1112 +			s = next ? next + 1 : s + strlen (s);
       
  1113          }
       
  1114  
       
  1115          // compose a normalized locale name out of category names
       
  1116 @@ -542,7 +541,7 @@
       
  1117                  pcatnames [i] = "C";
       
  1118              }
       
  1119  
       
  1120 -            const char *endcat = strchr (pcatnames [i], *sep);
       
  1121 +            const char *endcat = strchr (pcatnames [i], sep);
       
  1122  
       
  1123              if (!endcat)
       
  1124                  endcat = pcatnames [i] + strlen (pcatnames [i]);
       
  1125 
       
  1126 #===========================================================================#
       
  1127 
       
  1128 --- stdcxx-4.2.1/include/loc/_num_get.cc	2008-04-24 20:23:39.000000000 -0400
       
  1129 +++ stdcxx-4.2.1/include/loc/_num_get.cc	2011-02-18 10:59:44.609114465 -0500
       
  1130 @@ -190,15 +190,26 @@
       
  1131          _RWSTD_USE_FACET (numpunct<char_type>, __loc);
       
  1132  
       
  1133      // 22.2.2.1.2, p8: Stage 2
       
  1134 +#if defined(_STDCXX_SIZEOF_NUM_GET_BUFFER)
       
  1135 +    // size of allocated buffer
       
  1136 +    _RWSTD_SIZE_T __bufsize =
       
  1137 +        static_cast<_RWSTD_SIZE_T>(_STDCXX_SIZEOF_NUM_GET_BUFFER);
       
  1138 +    // dynamically allocated buffer
       
  1139 +    char* __buf = new (nothrow) char[__bufsize];
       
  1140 +	 if (!__buf) {
       
  1141 +        __err |= _RW::__rw_failbit;
       
  1142 +		 return __begin;
       
  1143 +	 }
       
  1144 +#else
       
  1145 +    // default statically-alocated buffer (1024 bits + 2)
       
  1146 +    char __buf [1024 + 2];                    // default buffer (1024 bits + 2)
       
  1147 +    _RWSTD_SIZE_T __bufsize = sizeof __buf;   // size of allocated buffer
       
  1148 +#endif
       
  1149  
       
  1150 -    char __buf [128 + 2];                     // default buffer (128 bits + 2)
       
  1151      char *__pbuf            = __buf;          // pointer to allocated buffer
       
  1152      char *__pcur            = __buf;          // currently processed digit
       
  1153 -    _RWSTD_SIZE_T __bufsize = sizeof __buf;   // size of allocated buffer
       
  1154  
       
  1155 -    _RWSTD_UNUSED (__bufsize);
       
  1156 -
       
  1157 -    const ctype<char_type> &__ctp = _RWSTD_USE_FACET (ctype<char_type>, __loc);
       
  1158 +    const ctype<char_type> &__ctp = _RWSTD_USE_FACET (std::ctype<char_type>, __loc);
       
  1159  
       
  1160      const _CharT __decimal_point = __pun.decimal_point ();
       
  1161      const _CharT __thousands_sep = __pun.thousands_sep ();
       
  1162 @@ -210,7 +221,15 @@
       
  1163  
       
  1164      // buffer containing the sizes of thousands_sep-separated
       
  1165      // groups of digits and a pointer to the next grouping
       
  1166 +#if defined(_STDCXX_SIZEOF_NUM_GET_BUFFER)
       
  1167 +    char* __grpbuf = new (nothrow) char[__bufsize];
       
  1168 +	 if (!__grpbuf) { 
       
  1169 +        __err |= _RW::__rw_failbit;
       
  1170 +		return __begin;
       
  1171 +	 }
       
  1172 +#else
       
  1173      char __grpbuf [sizeof __buf];
       
  1174 +#endif
       
  1175      char *__pgrp = __grpbuf;
       
  1176  
       
  1177      const char *__grpbeg = 0;   // the beginning of the last group
       
  1178 @@ -252,7 +271,7 @@
       
  1179              break;
       
  1180          }
       
  1181  
       
  1182 -        if (__pcur == __buf + sizeof __buf - 1) {
       
  1183 +        if (__pcur == (__buf + __bufsize - 1)) {
       
  1184              // FIXME: handle long strings of digits
       
  1185              __err |= _RW::__rw_failbit;
       
  1186              break;
       
  1187 @@ -293,6 +312,10 @@
       
  1188                  // fatal error: thousands_sep characters must be separated
       
  1189                  // by groups of one or more digits
       
  1190                  __err |= _RW::__rw_failbit;                
       
  1191 +#if defined(_STDCXX_SIZEOF_NUM_GET_BUFFER)
       
  1192 +                delete[] __buf;
       
  1193 +                delete[] __grpbuf;
       
  1194 +#endif
       
  1195                  return __begin;
       
  1196              }
       
  1197  
       
  1198 @@ -456,6 +479,10 @@
       
  1199              if (   'e' == __pcur [-1]
       
  1200                  || '-' == __pcur [-1] || '+' == __pcur [-1]) {
       
  1201                  __err |= _RW::__rw_failbit;
       
  1202 +#if defined(_STDCXX_SIZEOF_NUM_GET_BUFFER)
       
  1203 +                delete[] __buf;
       
  1204 +                delete[] __grpbuf;
       
  1205 +#endif
       
  1206                  return __begin;
       
  1207              }
       
  1208  
       
  1209 @@ -474,6 +501,10 @@
       
  1210              // or more digits (i.e., valid input cannot start or end with
       
  1211              // a thousands_sep); this needs to be clarified in the text
       
  1212              __err |= _RW::__rw_failbit;
       
  1213 +#if defined(_STDCXX_SIZEOF_NUM_GET_BUFFER)
       
  1214 +            delete[] __buf;
       
  1215 +            delete[] __grpbuf;
       
  1216 +#endif
       
  1217              return __begin;
       
  1218          }
       
  1219  
       
  1220 @@ -484,15 +515,15 @@
       
  1221      *__pcur = '\0';
       
  1222  
       
  1223      // verify that the buffers haven't overflowed
       
  1224 -    _RWSTD_ASSERT (__pgrp < __grpbuf + sizeof __grpbuf);
       
  1225 +    _RWSTD_ASSERT (__pgrp < __grpbuf + __bufsize);
       
  1226      _RWSTD_ASSERT (__pcur < __pbuf + __bufsize);
       
  1227  
       
  1228      // set the base determined above
       
  1229 -    const unsigned __fl2 =
       
  1230 -          __fl & ~_RWSTD_IOS_BASEFIELD
       
  1231 -        & ~(   _RWSTD_STATIC_CAST (unsigned, _RWSTD_IOS_BASEMASK)
       
  1232 -            << _RWSTD_IOS_BASEOFF)
       
  1233 -        | __base << _RWSTD_IOS_BASEOFF;
       
  1234 +    const unsigned int __fl2 =
       
  1235 +          (__fl & ~_RWSTD_IOS_BASEFIELD)
       
  1236 +        & ~((   _RWSTD_STATIC_CAST (unsigned int, _RWSTD_IOS_BASEMASK)
       
  1237 +            << _RWSTD_IOS_BASEOFF))
       
  1238 +        | (__base << _RWSTD_IOS_BASEOFF);
       
  1239  
       
  1240      // 22.2.2.1.2, p11: Stage 3
       
  1241      const int __errtmp =
       
  1242 @@ -502,6 +533,11 @@
       
  1243  
       
  1244      __err |= _RWSTD_IOSTATE (__errtmp);
       
  1245  
       
  1246 +#if defined(_STDCXX_SIZEOF_NUM_GET_BUFFER)
       
  1247 +    delete[] __buf;
       
  1248 +    delete[] __grpbuf;
       
  1249 +#endif
       
  1250 +
       
  1251      return __begin;
       
  1252  }
       
  1253 
       
  1254 #===========================================================================#
       
  1255 
       
  1256 --- stdcxx-4.2.1/include/loc/_time_get.cc	2008-04-24 17:23:39.000000000 -0700
       
  1257 +++ stdcxx-4.2.1/include/loc/_time_get.cc	2011-03-22 15:24:06.922851958 -0700
       
  1258 @@ -127,10 +127,13 @@
       
  1259          _RWSTD_IOSTATE &__err, tm *__tmb,
       
  1260          char __fmt, char __modifier /* = '\0' */) const
       
  1261  {
       
  1262 -    // enough pointers for 100 alternative numeric symbols and their sizes
       
  1263 -    const char_type* __names [100];
       
  1264 +    // enough pointers for 128 alternative numeric symbols and their sizes
       
  1265 +    const char_type* __names [128];
       
  1266      _RWSTD_SIZE_T    __sizes [sizeof __names / sizeof *__names];
       
  1267  
       
  1268 +    (void) memset(__names, '\0', sizeof(__names));
       
  1269 +    (void) memset(__sizes, '\0', sizeof(__sizes));
       
  1270 +
       
  1271      const void** __pv =
       
  1272          _RWSTD_REINTERPRET_CAST (const void**, __names);
       
  1273  
       
  1274 @@ -138,7 +141,9 @@
       
  1275  
       
  1276      int *__pmem = 0;   // pointer to std::tm member
       
  1277  
       
  1278 -    _RWSTD_SIZE_T __dup;   // number of allowed duplicates
       
  1279 +    _RWSTD_SIZE_T __dup = 0;   // number of allowed duplicates
       
  1280 +
       
  1281 +    _RWSTD_SIZE_T __nread = 0; // parse numeric input
       
  1282  
       
  1283      const ctype<char_type> &__ctp =
       
  1284          _RWSTD_USE_FACET (ctype<char_type>, __fl.getloc ());
       
  1285 @@ -151,6 +156,21 @@
       
  1286          __dup = 2;
       
  1287          break;
       
  1288  
       
  1289 +    case 'e': {
       
  1290 +        while (__ctp.is (ctype_base::space, *__it)) {
       
  1291 +	    ++__it;
       
  1292 +	    ++__nread;
       
  1293 +	}
       
  1294 +
       
  1295 +	if (__it == __end) {
       
  1296 +	    __err |= _RW::__rw_eofbit;
       
  1297 +	    break;
       
  1298 +	}
       
  1299 +
       
  1300 +	__dup = 1;
       
  1301 +	break;
       
  1302 +    }
       
  1303 +
       
  1304      case 'n': case 't': {   // any whitespace
       
  1305          
       
  1306          for ( ; ; ++__it) {
       
  1307 @@ -279,10 +299,6 @@
       
  1308      }
       
  1309      else if (__pmem) {
       
  1310  
       
  1311 -        // parse numeric input
       
  1312 -
       
  1313 -        _RWSTD_SIZE_T __nread = 0;
       
  1314 -
       
  1315          int __mem = 0;
       
  1316  
       
  1317          for ( ; ; ++__it, ++__nread) {
       
  1318 
       
  1319 #===========================================================================#
       
  1320 
       
  1321 --- stdcxx-4.2.1/include/loc/_money_get.cc	2008-04-24 20:23:39.000000000 -0400
       
  1322 +++ stdcxx-4.2.1/include/loc/_money_get.cc	2011-01-13 15:21:44.879687845 -0500
       
  1323 @@ -83,7 +83,7 @@
       
  1324      const ctype<_CharT> &__ctp = 
       
  1325          _RWSTD_USE_FACET (ctype<_CharT>, __flags.getloc ());
       
  1326  
       
  1327 -    char __buf [304];
       
  1328 +    char __buf [1024];
       
  1329      char *__pcur = __buf;
       
  1330  
       
  1331      typedef _TYPENAME string_type::traits_type _Traits;
       
  1332 @@ -93,6 +93,8 @@
       
  1333      const char *__grpstart = 0;      // the start of the last group
       
  1334      const char *__grpend   = 0;      // the end of the last group
       
  1335  
       
  1336 +	(void) memset(__buf, '\0', sizeof(__buf));
       
  1337 +	(void) memset(__grpbuf, '\0', sizeof(__grpbuf));
       
  1338  
       
  1339      int __sign = 0;    // the sign of the result if detected (-1, 0, or +1)
       
  1340  
       
  1341 @@ -100,7 +102,7 @@
       
  1342      // use a '+' and overwrite it with a '-' if necessary
       
  1343      *__pcur++ = '+';
       
  1344  
       
  1345 -    const int __fl = __flags.flags ();
       
  1346 +    const unsigned int __fl = __flags.flags ();
       
  1347  
       
  1348      typedef _RWSTD_SIZE_T _SizeT;
       
  1349  
       
  1350 @@ -144,11 +146,11 @@
       
  1351              // it is consumed only if it is followed by characters
       
  1352              // required to complete the pattern (see example in
       
  1353              // 22.2.6.1.2, p3)
       
  1354 -            if (   __fl & _RW::__rw_showbase
       
  1355 -                || __i < 2
       
  1356 -                || 2 == __i && (money_base::none != __pat.field [3])
       
  1357 -                || __sign < 0 && __ns.size () > 1
       
  1358 -                || __sign > 0 && __ps.size () > 1) {
       
  1359 +            if (   (__fl & _RW::__rw_showbase)
       
  1360 +                || (__i < 2)
       
  1361 +                || ((2 == __i) && (money_base::none != __pat.field [3]))
       
  1362 +                || ((__sign < 0) && (__ns.size () > 1))
       
  1363 +                || ((__sign > 0) && (__ps.size () > 1)) ) {
       
  1364  
       
  1365                  for (_SizeT __nc = 0; __nc != __cs.size ();
       
  1366                       ++__nc, ++__it) {
       
  1367 @@ -156,7 +158,7 @@
       
  1368  
       
  1369                          // 22.2.6.1.2, p2: unless showbase is set,
       
  1370                          //                 curr_symbol is optional
       
  1371 -                        if (__nc || __fl & _RW::__rw_showbase)
       
  1372 +                        if (__nc || (__fl & _RW::__rw_showbase))
       
  1373                              __ebits |= _RW::__rw_failbit;
       
  1374                          break;
       
  1375                      }
       
  1376 
       
  1377 #===========================================================================#
       
  1378 
       
  1379 --- stdcxx-4.2.1/include/rw/_rawiter.h	2008-04-24 17:23:43.000000000 -0700
       
  1380 +++ stdcxx-4.2.1/include/rw/_rawiter.h	2011-03-17 18:50:56.176110516 -0700
       
  1381 @@ -133,7 +133,7 @@
       
  1382  inline pair<_TypeT*, _Distance>
       
  1383  get_temporary_buffer (_Distance __nelems, _TypeT*)
       
  1384  {
       
  1385 -    pair<_TypeT*, _Distance> __res (0, 0);
       
  1386 +    pair<_TypeT*, _Distance> __res (0UL, 0);
       
  1387  
       
  1388  #if __GNUG__ >= 4
       
  1389  
       
  1390 @@ -148,7 +148,7 @@
       
  1391  
       
  1392      __res.second =
       
  1393          _RW::__rw_tmpbuf (_RWSTD_REINTERPRET_CAST (_VoidPtrT*, &__res.first),
       
  1394 -                          __nelems < 0 ? 0 : __nelems, sizeof (_TypeT));
       
  1395 +		((__nelems < 0) ? 0 : __nelems), sizeof (_TypeT));
       
  1396  
       
  1397      return __res;
       
  1398  }
       
  1399