Author: sebor
Date: Thu Sep 6 13:40:52 2007
New Revision: 573366
URL: http://svn.apache.org/viewvc?rev=573366&view=rev
Log:
2007-09-06 Martin Sebor <[EMAIL PROTECTED]>
* _codecvt.h (codecvt, do_always_noconv, do_encoding, do_max_length):
Outlined codecvt<char, char, mbstate_t> ctor and virtual member
functions of the codecvt<wchar_t, char, mbstate_t> specialization
to reduce the size of objects in which these functions end up getting
emitted by most (all?) compilers.
Modified:
incubator/stdcxx/trunk/include/loc/_codecvt.h
incubator/stdcxx/trunk/src/codecvt.cpp
incubator/stdcxx/trunk/src/wcodecvt.cpp
Modified: incubator/stdcxx/trunk/include/loc/_codecvt.h
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/loc/_codecvt.h?rev=573366&r1=573365&r2=573366&view=diff
==============================================================================
--- incubator/stdcxx/trunk/include/loc/_codecvt.h (original)
+++ incubator/stdcxx/trunk/include/loc/_codecvt.h Thu Sep 6 13:40:52 2007
@@ -25,7 +25,7 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
- * Copyright 1994-2006 Rogue Wave Software.
+ * Copyright 1994-2007 Rogue Wave Software, Inc.
*
**************************************************************************/
@@ -186,8 +186,7 @@
typedef char intern_type;
typedef _RWSTD_MBSTATE_T state_type;
- _EXPLICIT codecvt (_RWSTD_SIZE_T __refs = 0)
- : _RW::__rw_facet (__refs), _C_always_noconv (-1) { }
+ _EXPLICIT codecvt (_RWSTD_SIZE_T = 0);
virtual ~codecvt ();
@@ -318,23 +317,16 @@
virtual result
do_unshift (state_type&, extern_type*, extern_type*, extern_type*&) const;
- virtual bool do_always_noconv () const _THROWS (()) {
- return false; // conversion always necessary
- }
+ virtual bool do_always_noconv () const _THROWS (());
- virtual int do_encoding () const _THROWS (()) {
- // 22.2.1.5.2 p6 1(ext.) <=> 1(int.)
- return 1;
- }
+ virtual int do_encoding () const _THROWS (());
// signature follows lwg issue 75
virtual int
do_length (state_type&,
const extern_type*, const extern_type*, _RWSTD_SIZE_T) const;
- virtual int do_max_length () const _THROWS (()) {
- return 1;
- }
+ virtual int do_max_length () const _THROWS (());
public:
Modified: incubator/stdcxx/trunk/src/codecvt.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/src/codecvt.cpp?rev=573366&r1=573365&r2=573366&view=diff
==============================================================================
--- incubator/stdcxx/trunk/src/codecvt.cpp (original)
+++ incubator/stdcxx/trunk/src/codecvt.cpp Thu Sep 6 13:40:52 2007
@@ -22,7 +22,7 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
- * Copyright 1994-2006 Rogue Wave Software.
+ * Copyright 1994-2007 Rogue Wave Software, Inc.
*
**************************************************************************/
@@ -95,6 +95,14 @@
_RW::__rw_facet_id codecvt<char, char, _RWSTD_MBSTATE_T>::id;
+
+
+codecvt<char, char, _RWSTD_MBSTATE_T>::
+codecvt (size_t refs /* = 0 */)
+ : _RW::__rw_facet (refs), _C_always_noconv (-1)
+{
+ // empty
+}
/* virtual */ codecvt<char, char, _RWSTD_MBSTATE_T>::~codecvt ()
Modified: incubator/stdcxx/trunk/src/wcodecvt.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/src/wcodecvt.cpp?rev=573366&r1=573365&r2=573366&view=diff
==============================================================================
--- incubator/stdcxx/trunk/src/wcodecvt.cpp (original)
+++ incubator/stdcxx/trunk/src/wcodecvt.cpp Thu Sep 6 13:40:52 2007
@@ -22,7 +22,7 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
- * Copyright 2001-2006 Rogue Wave Software.
+ * Copyright 2001-2007 Rogue Wave Software, Inc.
*
**************************************************************************/
@@ -1079,6 +1079,31 @@
: _RW::__rw_facet (__ref)
{
// no-op
+}
+
+
+/* virtual */ bool
+codecvt<wchar_t, char, _RWSTD_MBSTATE_T>::
+do_always_noconv () const _THROWS (())
+{
+ return false; // conversion always necessary
+}
+
+
+/* virtual */ int
+codecvt<wchar_t, char, _RWSTD_MBSTATE_T>::
+do_encoding () const _THROWS (())
+{
+ // 22.2.1.5.2 p6 1(ext.) <=> 1(int.)
+ return 1;
+}
+
+
+/* virtual */ int
+codecvt<wchar_t, char, _RWSTD_MBSTATE_T>::
+do_max_length () const _THROWS (())
+{
+ return 1;
}