You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2007/06/08 00:50:59 UTC
svn commit: r545339 - in /incubator/stdcxx/trunk: include/loc/_ctype.h
src/wctype.cpp
Author: sebor
Date: Thu Jun 7 15:50:58 2007
New Revision: 545339
URL: http://svn.apache.org/viewvc?view=rev&rev=545339
Log:
2007-06-07 Martin Sebor <se...@roguewave.com>
* _ctype.h (do_toupper, do_tolower, do_widen, do_narrow): Outlined
virtual member functions of ctype<wchar_t> since they can almost
never be inlined anyway.
* wctype.cpp: Same.
Modified:
incubator/stdcxx/trunk/include/loc/_ctype.h
incubator/stdcxx/trunk/src/wctype.cpp
Modified: incubator/stdcxx/trunk/include/loc/_ctype.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/loc/_ctype.h?view=diff&rev=545339&r1=545338&r2=545339
==============================================================================
--- incubator/stdcxx/trunk/include/loc/_ctype.h (original)
+++ incubator/stdcxx/trunk/include/loc/_ctype.h Thu Jun 7 15:50:58 2007
@@ -1,24 +1,31 @@
/***************************************************************************
*
- * _ctype.h -
+ * _ctype.h
*
* This is an internal header file used to implement the C++ Standard
* Library. It should never be #included directly by a program.
*
- * $Id: //stdlib/dev/include/loc/_ctype.h#57 $
+ * $Id$
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0. Unless required by
- * applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied. See the License
- * for the specific language governing permissions and limitations under
- * the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 2001-2005 Rogue Wave Software.
*
**************************************************************************/
@@ -426,34 +433,21 @@
virtual const char_type*
do_is (const char_type*, const char_type*, mask*) const;
-// for convenience
-#define _RWSTD_CONVERT(tab, c) \
- _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, c) < _C_tab_size ? tab [_UChar (c)] : c
-
// 22.2.1.1.2, p7
- virtual char_type do_toupper (char_type __c) const {
- return _RWSTD_CONVERT (_C_upper_tab, __c);
- }
+ virtual char_type do_toupper (char_type) const;
// 22.2.1.1.2, p9
- virtual char_type do_tolower (char_type __c) const {
- return _RWSTD_CONVERT (_C_lower_tab, __c);
- }
+ virtual char_type do_tolower (char_type) const;
// 22.2.1.1.2, p11
- virtual char_type do_widen (char __c) const {
- return _RWSTD_CONST_CAST (ctype*, this)->
- _C_wide_tab [_UChar (__c)] = char_type (_UChar (__c));
- }
+ virtual char_type do_widen (char) const;
virtual const char*
do_widen (const char*, const char*, char_type*) const;
// 22.2.1.1.2, p13
- virtual char do_narrow (char_type __c, char __dfault) const {
- return _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, __c) <= _RWSTD_SCHAR_MAX ?
- _RWSTD_STATIC_CAST (char, __c) : __dfault;
- }
+ virtual char
+ do_narrow (char_type, char) const;
virtual const char_type*
do_toupper (char_type*, const char_type*) const;
@@ -474,7 +468,7 @@
public:
- _EXPLICIT ctype (_RWSTD_SIZE_T __ref = 0);
+ _EXPLICIT ctype (_RWSTD_SIZE_T = 0);
// 22.2.1.1.1, p1
Modified: incubator/stdcxx/trunk/src/wctype.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/src/wctype.cpp?view=diff&rev=545339&r1=545338&r2=545339
==============================================================================
--- incubator/stdcxx/trunk/src/wctype.cpp (original)
+++ incubator/stdcxx/trunk/src/wctype.cpp Thu Jun 7 15:50:58 2007
@@ -6,16 +6,23 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0. Unless required by
- * applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied. See the License
- * for the specific language governing permissions and limitations under
- * the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 2001-2005 Rogue Wave Software.
*
**************************************************************************/
@@ -421,6 +428,15 @@
}
+ctype<wchar_t>::char_type
+ctype<wchar_t>::
+do_widen (char c) const
+{
+ return _RWSTD_CONST_CAST (ctype*, this)->
+ _C_wide_tab [_UChar (c)] = char_type (_UChar (c));
+}
+
+
const char*
ctype<wchar_t>::
do_widen (const char *lo, const char *hi, char_type *dest) const
@@ -435,6 +451,24 @@
}
+ctype<wchar_t>::char_type
+ctype<wchar_t>::
+do_toupper (char_type c) const
+{
+ return _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, c) < _C_tab_size ?
+ _C_upper_tab [_UChar (c)] : c;
+}
+
+
+ctype<wchar_t>::char_type
+ctype<wchar_t>::
+do_tolower (char_type c) const
+{
+ return _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, c) < _C_tab_size ?
+ _C_lower_tab [_UChar (c)] : c;
+}
+
+
const ctype<wchar_t>::char_type*
ctype<wchar_t>::
do_toupper (char_type *lo, const char_type *hi) const
@@ -491,6 +525,15 @@
}
return lo;
+}
+
+
+char
+ctype<wchar_t>::
+do_narrow (char_type c, char dfault) const
+{
+ return _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, c) <= _RWSTD_SCHAR_MAX ?
+ _RWSTD_STATIC_CAST (char, c) : dfault;
}