stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r554467 - /incubator/stdcxx/trunk/src/locale_eq.cpp
Date Sun, 08 Jul 2007 23:08:00 GMT
Author: sebor
Date: Sun Jul  8 16:07:59 2007
New Revision: 554467

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

	STDCXX-477
	* locale_eq.cpp (operator==): Considered the names of locales when
	all their standard and byname facet masks are the same and all their
	facet pointers are the same.

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

Modified: incubator/stdcxx/trunk/src/locale_eq.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/src/locale_eq.cpp?view=diff&rev=554467&r1=554466&r2=554467
==============================================================================
--- incubator/stdcxx/trunk/src/locale_eq.cpp (original)
+++ incubator/stdcxx/trunk/src/locale_eq.cpp Sun Jul  8 16:07:59 2007
@@ -61,19 +61,24 @@
     if (!_C_body->_C_n_usr_facets && !rhs._C_body->_C_n_usr_facets) {
 
         // in order to compare equal, both bodies must have the same
-        // sets of facets (some slots may still be uninitialized)
+        // sets of facets (some slots may still be uninitialized) and
+        // not have different names
         const bool eql =
            _C_body->_C_std_facet_bits == rhs._C_body->_C_std_facet_bits
         && _C_body->_C_byname_facet_bits == rhs._C_body->_C_byname_facet_bits
         && !memcmp (_C_body->_C_std_facets, rhs._C_body->_C_std_facets,
-                    _C_body->_C_n_std_facets * sizeof *_C_body->_C_std_facets);
+                    _C_body->_C_n_std_facets * sizeof *_C_body->_C_std_facets)
+        && !strcmp (_C_body->_C_name, rhs._C_body->_C_name);
 
         // at least some standard facets must have been replaced in order
-        // for two locale objects not to share the same body
-        _RWSTD_ASSERT (   _C_body->_C_std_facet_bits        != _C_body->_C_all
+        // for two "equal" locale objects not to share the same body, or
+        // the locales' names must be different
+        _RWSTD_ASSERT (   eql
+                       || _C_body->_C_std_facet_bits        != _C_body->_C_all
                        || rhs._C_body->_C_std_facet_bits    != _C_body->_C_all
                        || _C_body->_C_byname_facet_bits     != _C_body->_C_all
-                       || rhs._C_body->_C_byname_facet_bits != _C_body->_C_all);
+                       || rhs._C_body->_C_byname_facet_bits != _C_body->_C_all
+                       || strcmp (_C_body->_C_name, rhs._C_body->_C_name));
 
         // facet bits of both objects must be the same if the two objects
         // share the exact same facets (otherwise the bits may or may not



Mime
View raw message