Fixups for EDG front end.

2004-04-06  Benjamin Kosnik  <bkoz@redhat.com>

	Fixups for EDG front end.
	* include/ext/rope: Instead of non-existent function
	_Data_allocate, use allocator's allocate. Use this.
	(namespace _Rope_constants): Move _S_max_rope_depth, and _Tag
	enumerations from _Rope_RopeRep here.
	* include/ext/ropeimpl.h: Same.
	* src/ext-inst.cc (_S_min_len): Fix up definition.

	* config/locale/gnu/ctype_members.cc: Qualify base class members
	with this.
	* config/locale/generic/ctype_members.cc: Same.
	* config/locale/gnu/messages_members.h: Same.
	* config/locale/generic/messages_members.h: Same.
	* src/ctype.cc: Same.
	* include/bits/codecvt.h: Same.

	* include/bits/boost_concept_check.h: Declare.
	(__error_type_must_be_an_unsigned_integer_type): Remove this.
	(__error_type_must_be_an_integer_type): Remove this.
	(__error_type_must_be_a_signed_integer_type): Remove this.

	* config/io/basic_file_stdio.cc (__basic_file::sys_open): Remove cast.

	* libsupc++/eh_alloc.cc (__cxa_free_exception): Add exception
	specification to definition.
	(__cxa_allocate_exception): Same.
	* libsupc++/eh_catch.cc (__cxa_begin_catch): Same.
	* libsupc++/eh_globals.cc (__cxa_get_globals_fast): Same.
	(__cxa_get_globals): Same.

	* libsupc++/del_op.cc: Add comment about freestanding.

From-SVN: r80475
This commit is contained in:
Benjamin Kosnik 2004-04-07 03:33:36 +00:00 committed by Benjamin Kosnik
parent 9104315af8
commit 563ae04fec
18 changed files with 153 additions and 104 deletions

View file

@ -1,3 +1,37 @@
2004-04-06 Benjamin Kosnik <bkoz@redhat.com>
Fixups for EDG front end.
* include/ext/rope: Instead of non-existent function
_Data_allocate, use allocator's allocate. Use this.
(namespace _Rope_constants): Move _S_max_rope_depth, and _Tag
enumerations from _Rope_RopeRep here.
* include/ext/ropeimpl.h: Same.
* src/ext-inst.cc (_S_min_len): Fix up definition.
* config/locale/gnu/ctype_members.cc: Qualify base class members
with this.
* config/locale/generic/ctype_members.cc: Same.
* config/locale/gnu/messages_members.h: Same.
* config/locale/generic/messages_members.h: Same.
* src/ctype.cc: Same.
* include/bits/codecvt.h: Same.
* include/bits/boost_concept_check.h: Declare.
(__error_type_must_be_an_unsigned_integer_type): Remove this.
(__error_type_must_be_an_integer_type): Remove this.
(__error_type_must_be_a_signed_integer_type): Remove this.
* config/io/basic_file_stdio.cc (__basic_file::sys_open): Remove cast.
* libsupc++/eh_alloc.cc (__cxa_free_exception): Add exception
specification to definition.
(__cxa_allocate_exception): Same.
* libsupc++/eh_catch.cc (__cxa_begin_catch): Same.
* libsupc++/eh_globals.cc (__cxa_get_globals_fast): Same.
(__cxa_get_globals): Same.
* libsupc++/del_op.cc: Add comment about freestanding.
2004-04-05 Paolo Carlini <pcarlini@suse.de>
* include/ext/mt_allocator.h (__mt_alloc<>::deallocate):

View file

@ -202,12 +202,12 @@ namespace std
{
__basic_file* __ret = NULL;
const char* __c_mode = __gnu_internal::fopen_mode(__mode);
if (__c_mode && !this->is_open()
&& (_M_cfile = fdopen(__fd, __c_mode)))
if (__c_mode && !this->is_open() && (_M_cfile = fdopen(__fd, __c_mode)))
{
char* __buf = NULL;
_M_cfile_created = true;
if (__fd == 0)
setvbuf(_M_cfile, reinterpret_cast<char*>(NULL), _IONBF, 0);
setvbuf(_M_cfile, __buf, _IONBF, 0);
__ret = this;
}
return __ret;

View file

@ -1,6 +1,6 @@
// std::ctype implementation details, generic version -*- C++ -*-
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -45,8 +45,8 @@ namespace std
{
if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
{
_S_destroy_c_locale(_M_c_locale_ctype);
_S_create_c_locale(_M_c_locale_ctype, __s);
this->_S_destroy_c_locale(this->_M_c_locale_ctype);
this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
}
}

View file

@ -1,6 +1,6 @@
// std::messages implementation details, generic version -*- C++ -*-
// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
// Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -78,7 +78,7 @@
{
if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
{
_S_destroy_c_locale(this->_M_c_locale_messages);
_S_create_c_locale(this->_M_c_locale_messages, __s);
this->_S_destroy_c_locale(this->_M_c_locale_messages);
this->_S_create_c_locale(this->_M_c_locale_messages, __s);
}
}

View file

@ -1,6 +1,6 @@
// std::ctype implementation details, GNU version -*- C++ -*-
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -46,11 +46,11 @@ namespace std
{
if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
{
_S_destroy_c_locale(_M_c_locale_ctype);
_S_create_c_locale(_M_c_locale_ctype, __s);
_M_toupper = _M_c_locale_ctype->__ctype_toupper;
_M_tolower = _M_c_locale_ctype->__ctype_tolower;
_M_table = _M_c_locale_ctype->__ctype_b;
this->_S_destroy_c_locale(this->_M_c_locale_ctype);
this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
this->_M_table = this->_M_c_locale_ctype->__ctype_b;
}
}

View file

@ -1,6 +1,6 @@
// std::messages implementation details, GNU version -*- C++ -*-
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -108,7 +108,7 @@
#endif
if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
{
_S_destroy_c_locale(this->_M_c_locale_messages);
_S_create_c_locale(this->_M_c_locale_messages, __s);
this->_S_destroy_c_locale(this->_M_c_locale_messages);
this->_S_create_c_locale(this->_M_c_locale_messages, __s);
}
}

View file

@ -36,6 +36,12 @@ inline void __function_requires()
void (_Concept::*__x)() _IsUnused = &_Concept::__constraints;
}
// No definition: if this is referenced, there's a problem with
// the instantiating type not being one of the required integer types.
// Unfortunately, this results in a link-time error, not a compile-time error.
void __error_type_must_be_an_integer_type();
void __error_type_must_be_an_unsigned_integer_type();
void __error_type_must_be_a_signed_integer_type();
// ??? Should the "concept_checking*" structs begin with more than _ ?
#define _GLIBCXX_CLASS_REQUIRES(_type_var, _ns, _concept) \
@ -88,7 +94,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
template <class _Tp>
struct _IntegerConcept {
void __constraints() {
this->__error_type_must_be_an_integer_type();
__error_type_must_be_an_integer_type();
}
};
template <> struct _IntegerConcept<short> { void __constraints() {} };
@ -104,7 +110,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
template <class _Tp>
struct _SignedIntegerConcept {
void __constraints() {
this->__error_type_must_be_a_signed_integer_type();
__error_type_must_be_a_signed_integer_type();
}
};
template <> struct _SignedIntegerConcept<short> { void __constraints() {} };
@ -115,7 +121,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
template <class _Tp>
struct _UnsignedIntegerConcept {
void __constraints() {
this->__error_type_must_be_an_unsigned_integer_type();
__error_type_must_be_an_unsigned_integer_type();
}
};
template <> struct _UnsignedIntegerConcept<unsigned short>

View file

@ -459,8 +459,8 @@
{
if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
{
_S_destroy_c_locale(this->_M_c_locale_codecvt);
_S_create_c_locale(this->_M_c_locale_codecvt, __s);
this->_S_destroy_c_locale(this->_M_c_locale_codecvt);
this->_S_create_c_locale(this->_M_c_locale_codecvt, __s);
}
}

View file

@ -234,7 +234,7 @@ class _Rope_char_consumer {
// First a lot of forward declarations. The standard seems to require
// much stricter "declaration before use" than many of the implementations
// that preceded it.
template<class _CharT, class _Alloc=allocator<_CharT> > class rope;
template<class _CharT, class _Alloc = allocator<_CharT> > class rope;
template<class _CharT, class _Alloc> struct _Rope_RopeConcatenation;
template<class _CharT, class _Alloc> struct _Rope_RopeLeaf;
template<class _CharT, class _Alloc> struct _Rope_RopeFunction;
@ -459,6 +459,11 @@ struct _Rope_rep_base
# undef __ROPE_DEFINE_ALLOC
};
namespace _Rope_constants
{
enum { _S_max_rope_depth = 45 };
enum _Tag {_S_leaf, _S_concat, _S_substringfn, _S_function};
}
template<class _CharT, class _Alloc>
struct _Rope_RopeRep : public _Rope_rep_base<_CharT,_Alloc>
@ -467,9 +472,7 @@ struct _Rope_RopeRep : public _Rope_rep_base<_CharT,_Alloc>
# endif
{
public:
enum { _S_max_rope_depth = 45 };
enum _Tag {_S_leaf, _S_concat, _S_substringfn, _S_function};
_Tag _M_tag:8;
_Rope_constants::_Tag _M_tag:8;
bool _M_is_balanced:8;
unsigned char _M_depth;
__GC_CONST _CharT* _M_c_string;
@ -483,7 +486,7 @@ struct _Rope_RopeRep : public _Rope_rep_base<_CharT,_Alloc>
typedef typename _Rope_rep_base<_CharT,_Alloc>::allocator_type
allocator_type;
using _Rope_rep_base<_CharT,_Alloc>::get_allocator;
_Rope_RopeRep(_Tag __t, int __d, bool __b, size_t __size,
_Rope_RopeRep(_Rope_constants::_Tag __t, int __d, bool __b, size_t __size,
allocator_type __a)
: _Rope_rep_base<_CharT,_Alloc>(__size, __a),
# ifndef __GC
@ -579,9 +582,7 @@ struct _Rope_RopeLeaf : public _Rope_RopeRep<_CharT,_Alloc> {
typedef typename _Rope_rep_base<_CharT,_Alloc>::allocator_type
allocator_type;
_Rope_RopeLeaf(__GC_CONST _CharT* __d, size_t __size, allocator_type __a)
: _Rope_RopeRep<_CharT,_Alloc>(_Rope_RopeRep<_CharT,_Alloc>::_S_leaf,
0, true, __size, __a),
_M_data(__d)
: _Rope_RopeRep<_CharT,_Alloc>(_Rope_constants::_S_leaf, 0, true, __size, __a), _M_data(__d)
{
if (_S_is_basic_char_type((_CharT *)0)) {
// already eos terminated.
@ -612,7 +613,7 @@ struct _Rope_RopeConcatenation : public _Rope_RopeRep<_CharT,_Alloc> {
_Rope_RopeRep<_CharT,_Alloc>* __r,
allocator_type __a)
: _Rope_RopeRep<_CharT,_Alloc>(_Rope_RopeRep<_CharT,_Alloc>::_S_concat,
: _Rope_RopeRep<_CharT,_Alloc>(_Rope_constants::_S_concat,
std::max(__l->_M_depth, __r->_M_depth) + 1,
false,
__l->_M_size + __r->_M_size, __a),
@ -650,7 +651,7 @@ struct _Rope_RopeFunction : public _Rope_RopeRep<_CharT,_Alloc> {
allocator_type;
_Rope_RopeFunction(char_producer<_CharT>* __f, size_t __size,
bool __d, allocator_type __a)
: _Rope_RopeRep<_CharT,_Alloc>(_Rope_RopeRep<_CharT,_Alloc>::_S_function,
: _Rope_RopeRep<_CharT,_Alloc>(_Rope_constants::_S_function,
0, true, __size, __a)
, _M_fn(__f)
# ifndef __GC
@ -690,15 +691,15 @@ struct _Rope_RopeSubstring : public _Rope_RopeFunction<_CharT,_Alloc>,
virtual void operator()(size_t __start_pos, size_t __req_len,
_CharT* __buffer) {
switch(_M_base->_M_tag) {
case _Rope_RopeFunction<_CharT,_Alloc>::_S_function:
case _Rope_RopeFunction<_CharT,_Alloc>::_S_substringfn:
case _Rope_constants::_S_function:
case _Rope_constants::_S_substringfn:
{
char_producer<_CharT>* __fn =
((_Rope_RopeFunction<_CharT,_Alloc>*)_M_base)->_M_fn;
(*__fn)(__start_pos + _M_start, __req_len, __buffer);
}
break;
case _Rope_RopeFunction<_CharT,_Alloc>::_S_leaf:
case _Rope_constants::_S_leaf:
{
__GC_CONST _CharT* __s =
((_Rope_RopeLeaf<_CharT,_Alloc>*)_M_base)->_M_data;
@ -722,7 +723,7 @@ struct _Rope_RopeSubstring : public _Rope_RopeFunction<_CharT,_Alloc>,
# ifndef __GC
_M_base->_M_ref_nonnil();
# endif
this->_M_tag = _Rope_RopeFunction<_CharT,_Alloc>::_S_substringfn;
this->_M_tag = _Rope_constants::_S_substringfn;
}
virtual ~_Rope_RopeSubstring()
{
@ -1426,7 +1427,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
_CharT* __buffer);
static const unsigned long
_S_min_len[_RopeRep::_S_max_rope_depth + 1];
_S_min_len[_Rope_constants::_S_max_rope_depth + 1];
static bool _S_is_balanced(_RopeRep* __r)
{ return (__r->_M_size >= _S_min_len[__r->_M_depth]); }
@ -1511,7 +1512,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
rope(_CharT __c, const allocator_type& __a = allocator_type())
: _Base(__a)
{
_CharT* __buf = _Data_allocate(_S_rounded_up_size(1));
_CharT* __buf = __a.allocate(_S_rounded_up_size(1));
std::_Construct(__buf, __c);
try {
@ -1664,7 +1665,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
// is safe for multiple threads.
void delete_c_str () {
if (0 == this->_M_tree_ptr) return;
if (_RopeRep::_S_leaf == this->_M_tree_ptr->_M_tag &&
if (_Rope_constants::_S_leaf == this->_M_tree_ptr->_M_tag &&
((_RopeLeaf*)this->_M_tree_ptr)->_M_data ==
this->_M_tree_ptr->_M_c_string) {
// Representation shared
@ -1711,7 +1712,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
}
size_type max_size() const {
return _S_min_len[_RopeRep::_S_max_rope_depth-1] - 1;
return _S_min_len[_Rope_constants::_S_max_rope_depth - 1] - 1;
// Guarantees that the result can be sufficirntly
// balanced. Longer ropes will probably still work,
// but it's harder to make guarantees.

View file

@ -116,7 +116,7 @@ template <class _CharT, class _Alloc>
void _Rope_iterator_base<_CharT,_Alloc>::_S_setcache
(_Rope_iterator_base<_CharT,_Alloc>& __x)
{
const _RopeRep* __path[_RopeRep::_S_max_rope_depth+1];
const _RopeRep* __path[_Rope_constants::_S_max_rope_depth + 1];
const _RopeRep* __curr_rope;
int __curr_depth = -1; /* index into path */
size_t __curr_start_pos = 0;
@ -351,7 +351,7 @@ template <class _CharT, class _Alloc>
void _Rope_RopeRep<_CharT,_Alloc>::_M_free_tree()
{
switch(_M_tag) {
case _S_leaf:
case _Rope_constants::_S_leaf:
{
_Rope_RopeLeaf<_CharT,_Alloc>* __l
= (_Rope_RopeLeaf<_CharT,_Alloc>*)this;
@ -359,7 +359,7 @@ void _Rope_RopeRep<_CharT,_Alloc>::_M_free_tree()
_L_deallocate(__l, 1);
break;
}
case _S_concat:
case _Rope_constants::_S_concat:
{
_Rope_RopeConcatenation<_CharT,_Alloc>* __c
= (_Rope_RopeConcatenation<_CharT,_Alloc>*)this;
@ -368,7 +368,7 @@ void _Rope_RopeRep<_CharT,_Alloc>::_M_free_tree()
_C_deallocate(__c, 1);
break;
}
case _S_function:
case _Rope_constants::_S_function:
{
_Rope_RopeFunction<_CharT,_Alloc>* __f
= (_Rope_RopeFunction<_CharT,_Alloc>*)this;
@ -376,7 +376,7 @@ void _Rope_RopeRep<_CharT,_Alloc>::_M_free_tree()
_F_deallocate(__f, 1);
break;
}
case _S_substringfn:
case _Rope_constants::_S_substringfn:
{
_Rope_RopeSubstring<_CharT,_Alloc>* __ss =
(_Rope_RopeSubstring<_CharT,_Alloc>*)this;
@ -406,7 +406,7 @@ rope<_CharT,_Alloc>::_S_leaf_concat_char_iter
{
size_t __old_len = __r->_M_size;
_CharT* __new_data = (_CharT*)
_Data_allocate(_S_rounded_up_size(__old_len + __len));
__r->get_allocator().allocate(_S_rounded_up_size(__old_len + __len));
_RopeLeaf* __result;
uninitialized_copy_n(__r->_M_data, __old_len, __new_data);
@ -467,7 +467,7 @@ rope<_CharT,_Alloc>::_S_tree_concat (_RopeRep* __left, _RopeRep* __right)
size_t __depth = __result->_M_depth;
if (__depth > 20 && (__result->_M_size < 1000 ||
__depth > _RopeRep::_S_max_rope_depth))
__depth > _Rope_constants::_S_max_rope_depth))
{
_RopeRep* __balanced;
@ -504,13 +504,13 @@ rope<_CharT,_Alloc>::_RopeRep* rope<_CharT,_Alloc>::_S_concat_char_iter
if (0 == __r)
return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen,
__r->get_allocator());
if (_RopeRep::_S_leaf == __r->_M_tag &&
if (_Rope_constants::_S_leaf == __r->_M_tag &&
__r->_M_size + __slen <= _S_copy_max) {
__result = _S_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen);
return __result;
}
if (_RopeRep::_S_concat == __r->_M_tag
&& _RopeRep::_S_leaf == ((_RopeConcatenation*)__r)->_M_right->_M_tag) {
if (_Rope_constants::_S_concat == __r->_M_tag
&& _Rope_constants::_S_leaf == ((_RopeConcatenation*)__r)->_M_right->_M_tag) {
_RopeLeaf* __right =
(_RopeLeaf* )(((_RopeConcatenation* )__r)->_M_right);
if (__right->_M_size + __slen <= _S_copy_max) {
@ -563,13 +563,13 @@ rope<_CharT,_Alloc>::_S_destr_concat_char_iter(
return __r;
}
if (__orig_size + __slen <= _S_copy_max &&
_RopeRep::_S_leaf == __r->_M_tag) {
_Rope_constants::_S_leaf == __r->_M_tag) {
__result = _S_destr_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen);
return __result;
}
if (_RopeRep::_S_concat == __r->_M_tag) {
if (_Rope_constants::_S_concat == __r->_M_tag) {
_RopeLeaf* __right = (_RopeLeaf*)(((_RopeConcatenation*)__r)->_M_right);
if (_RopeRep::_S_leaf == __right->_M_tag
if (_Rope_constants::_S_leaf == __right->_M_tag
&& __right->_M_size + __slen <= _S_copy_max) {
_RopeRep* __new_right =
_S_destr_leaf_concat_char_iter(__right, __s, __slen);
@ -615,15 +615,15 @@ rope<_CharT,_Alloc>::_S_concat(_RopeRep* __left, _RopeRep* __right)
__left->_M_ref_nonnil();
return __left;
}
if (_RopeRep::_S_leaf == __right->_M_tag) {
if (_RopeRep::_S_leaf == __left->_M_tag) {
if (_Rope_constants::_S_leaf == __right->_M_tag) {
if (_Rope_constants::_S_leaf == __left->_M_tag) {
if (__right->_M_size + __left->_M_size <= _S_copy_max) {
return _S_leaf_concat_char_iter((_RopeLeaf*)__left,
((_RopeLeaf*)__right)->_M_data,
__right->_M_size);
}
} else if (_RopeRep::_S_concat == __left->_M_tag
&& _RopeRep::_S_leaf ==
} else if (_Rope_constants::_S_concat == __left->_M_tag
&& _Rope_constants::_S_leaf ==
((_RopeConcatenation*)__left)->_M_right->_M_tag) {
_RopeLeaf* __leftright =
(_RopeLeaf*)(((_RopeConcatenation*)__left)->_M_right);
@ -748,7 +748,7 @@ rope<_CharT,_Alloc>::_S_substring(_RopeRep* __base,
if (__result_len > __lazy_threshold) goto lazy;
__section = (_CharT*)
_Data_allocate(_S_rounded_up_size(__result_len));
__base->get_allocator().allocate(_S_rounded_up_size(__result_len));
try {
(*(__f->_M_fn))(__start, __result_len, __section);
}
@ -841,7 +841,7 @@ bool rope<_CharT, _Alloc>::_S_apply_to_pieces(
{
if (0 == __r) return true;
switch(__r->_M_tag) {
case _RopeRep::_S_concat:
case _Rope_constants::_S_concat:
{
_RopeConcatenation* __conc = (_RopeConcatenation*)__r;
_RopeRep* __left = __conc->_M_left;
@ -862,13 +862,13 @@ bool rope<_CharT, _Alloc>::_S_apply_to_pieces(
}
}
return true;
case _RopeRep::_S_leaf:
case _Rope_constants::_S_leaf:
{
_RopeLeaf* __l = (_RopeLeaf*)__r;
return __c(__l->_M_data + __begin, __end - __begin);
}
case _RopeRep::_S_function:
case _RopeRep::_S_substringfn:
case _Rope_constants::_S_function:
case _Rope_constants::_S_substringfn:
{
_RopeFunction* __f = (_RopeFunction*)__r;
size_t __len = __end - __begin;
@ -973,7 +973,7 @@ rope<_CharT,_Alloc>::_S_flatten(_RopeRep* __r, _CharT* __buffer)
{
if (0 == __r) return __buffer;
switch(__r->_M_tag) {
case _RopeRep::_S_concat:
case _Rope_constants::_S_concat:
{
_RopeConcatenation* __c = (_RopeConcatenation*)__r;
_RopeRep* __left = __c->_M_left;
@ -981,13 +981,13 @@ rope<_CharT,_Alloc>::_S_flatten(_RopeRep* __r, _CharT* __buffer)
_CharT* __rest = _S_flatten(__left, __buffer);
return _S_flatten(__right, __rest);
}
case _RopeRep::_S_leaf:
case _Rope_constants::_S_leaf:
{
_RopeLeaf* __l = (_RopeLeaf*)__r;
return copy_n(__l->_M_data, __l->_M_size, __buffer).second;
}
case _RopeRep::_S_function:
case _RopeRep::_S_substringfn:
case _Rope_constants::_S_function:
case _Rope_constants::_S_substringfn:
// We don't yet do anything with substring nodes.
// This needs to be fixed before ropefiles will work well.
{
@ -1068,8 +1068,7 @@ rope<_CharT,_Alloc>::_S_dump(_RopeRep* __r, int __indent)
template <class _CharT, class _Alloc>
const unsigned long
rope<_CharT,_Alloc>::_S_min_len[
_Rope_RopeRep<_CharT,_Alloc>::_S_max_rope_depth + 1] = {
rope<_CharT,_Alloc>::_S_min_len[_Rope_constants::_S_max_rope_depth + 1] = {
/* 0 */1, /* 1 */2, /* 2 */3, /* 3 */5, /* 4 */8, /* 5 */13, /* 6 */21,
/* 7 */34, /* 8 */55, /* 9 */89, /* 10 */144, /* 11 */233, /* 12 */377,
/* 13 */610, /* 14 */987, /* 15 */1597, /* 16 */2584, /* 17 */4181,
@ -1087,7 +1086,7 @@ template <class _CharT, class _Alloc>
typename rope<_CharT,_Alloc>::_RopeRep*
rope<_CharT,_Alloc>::_S_balance(_RopeRep* __r)
{
_RopeRep* __forest[_RopeRep::_S_max_rope_depth + 1];
_RopeRep* __forest[_Rope_constants::_S_max_rope_depth + 1];
_RopeRep* __result = 0;
int __i;
// Invariant:
@ -1096,11 +1095,11 @@ rope<_CharT,_Alloc>::_S_balance(_RopeRep* __r)
// __forest[__i]._M_depth = __i
// References from forest are included in refcount.
for (__i = 0; __i <= _RopeRep::_S_max_rope_depth; ++__i)
for (__i = 0; __i <= _Rope_constants::_S_max_rope_depth; ++__i)
__forest[__i] = 0;
try {
_S_add_to_forest(__r, __forest);
for (__i = 0; __i <= _RopeRep::_S_max_rope_depth; ++__i)
for (__i = 0; __i <= _Rope_constants::_S_max_rope_depth; ++__i)
if (0 != __forest[__i]) {
# ifndef __GC
_Self_destruct_ptr __old(__result);
@ -1114,12 +1113,12 @@ rope<_CharT,_Alloc>::_S_balance(_RopeRep* __r)
}
catch(...)
{
for(__i = 0; __i <= _RopeRep::_S_max_rope_depth; __i++)
for(__i = 0; __i <= _Rope_constants::_S_max_rope_depth; __i++)
_S_unref(__forest[__i]);
__throw_exception_again;
}
if (__result->_M_depth > _RopeRep::_S_max_rope_depth)
if (__result->_M_depth > _Rope_constants::_S_max_rope_depth)
__throw_length_error(__N("rope::_S_balance"));
return(__result);
}
@ -1179,7 +1178,7 @@ rope<_CharT,_Alloc>::_S_add_leaf_to_forest(_RopeRep* __r, _RopeRep** __forest)
__forest[__i]->_M_unref_nonnil();
__forest[__i] = 0;
}
if (__i == _RopeRep::_S_max_rope_depth ||
if (__i == _Rope_constants::_S_max_rope_depth ||
__insertee->_M_size < _S_min_len[__i+1]) {
__forest[__i] = __insertee;
// refcount is OK since __insertee is now dead.
@ -1197,7 +1196,7 @@ rope<_CharT,_Alloc>::_S_fetch(_RopeRep* __r, size_type __i)
if (0 != __cstr) return __cstr[__i];
for(;;) {
switch(__r->_M_tag) {
case _RopeRep::_S_concat:
case _Rope_constants::_S_concat:
{
_RopeConcatenation* __c = (_RopeConcatenation*)__r;
_RopeRep* __left = __c->_M_left;
@ -1211,13 +1210,13 @@ rope<_CharT,_Alloc>::_S_fetch(_RopeRep* __r, size_type __i)
}
}
break;
case _RopeRep::_S_leaf:
case _Rope_constants::_S_leaf:
{
_RopeLeaf* __l = (_RopeLeaf*)__r;
return __l->_M_data[__i];
}
case _RopeRep::_S_function:
case _RopeRep::_S_substringfn:
case _Rope_constants::_S_function:
case _Rope_constants::_S_substringfn:
{
_RopeFunction* __f = (_RopeFunction*)__r;
_CharT __result;
@ -1236,7 +1235,7 @@ template <class _CharT, class _Alloc>
_CharT*
rope<_CharT,_Alloc>::_S_fetch_ptr(_RopeRep* __r, size_type __i)
{
_RopeRep* __clrstack[_RopeRep::_S_max_rope_depth];
_RopeRep* __clrstack[_Rope_constants::_S_max_rope_depth];
size_t __csptr = 0;
for(;;) {
@ -1392,7 +1391,7 @@ rope<_CharT, _Alloc>::rope(size_t __n, _CharT __c,
if (0 == __rest) {
__remainder = 0;
} else {
__rest_buffer = _Data_allocate(_S_rounded_up_size(__rest));
__rest_buffer = __a.allocate(_S_rounded_up_size(__rest));
uninitialized_fill_n(__rest_buffer, __rest, __c);
_S_cond_store_eos(__rest_buffer[__rest]);
try {
@ -1407,7 +1406,7 @@ rope<_CharT, _Alloc>::rope(size_t __n, _CharT __c,
__remainder_rope._M_tree_ptr = __remainder;
if (__exponent != 0) {
_CharT* __base_buffer =
_Data_allocate(_S_rounded_up_size(__exponentiate_threshold));
__a.allocate(_S_rounded_up_size(__exponentiate_threshold));
_RopeLeaf* __base_leaf;
rope __base_rope;
uninitialized_fill_n(__base_buffer, __exponentiate_threshold, __c);
@ -1454,7 +1453,7 @@ const _CharT* rope<_CharT,_Alloc>::c_str() const {
if (0 == __result)
{
size_t __s = size();
__result = this->_Data_allocate(__s + 1);
__result = this->get_allocator().allocate(__s + 1);
_S_flatten(this->_M_tree_ptr, __result);
__result[__s] = _S_eos((_CharT*)0);
this->_M_tree_ptr->_M_c_string = __result;
@ -1475,7 +1474,7 @@ const _CharT* rope<_CharT,_Alloc>::replace_with_c_str() {
return(__old_c_string);
}
size_t __s = size();
_CharT* __result = _Data_allocate(_S_rounded_up_size(__s));
_CharT* __result = get_allocator().allocate(_S_rounded_up_size(__s));
_S_flatten(this->_M_tree_ptr, __result);
__result[__s] = _S_eos((_CharT*)0);
this->_M_tree_ptr->_M_unref_nonnil();

View file

@ -30,6 +30,7 @@
#include "new"
// We can't rely on having stdlib.h if we're freestanding.
extern "C" void free (void *);
void

View file

@ -1,5 +1,5 @@
// -*- C++ -*- Allocate exception objects.
// Copyright (C) 2001 Free Software Foundation, Inc.
// Copyright (C) 2001, 2004 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@ -94,7 +94,7 @@ emergency_mutex_init ()
extern "C" void *
__cxa_allocate_exception(std::size_t thrown_size)
__cxa_allocate_exception(std::size_t thrown_size) throw()
{
void *ret;
@ -141,7 +141,7 @@ __cxa_allocate_exception(std::size_t thrown_size)
extern "C" void
__cxa_free_exception(void *vptr)
__cxa_free_exception(void *vptr) throw()
{
char *ptr = (char *) vptr;
if (ptr >= &emergency_buffer[0][0]

View file

@ -34,7 +34,6 @@
#include "unwind-cxx.h"
#include "exception_defines.h"
extern "C" void
__cxa_bad_cast ()
{

View file

@ -35,7 +35,7 @@ using namespace __cxxabiv1;
extern "C" void *
__cxa_begin_catch (void *exc_obj_in)
__cxa_begin_catch (void *exc_obj_in) throw()
{
_Unwind_Exception *exceptionObject
= reinterpret_cast <_Unwind_Exception *>(exc_obj_in);

View file

@ -1,5 +1,5 @@
// -*- C++ -*- Manage the thread-local exception globals.
// Copyright (C) 2001 Free Software Foundation, Inc.
// Copyright (C) 2001, 2004 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@ -69,7 +69,7 @@ get_globals_init_once ()
#endif
extern "C" __cxa_eh_globals *
__cxa_get_globals_fast ()
__cxa_get_globals_fast () throw()
{
#if __GTHREADS
if (use_thread_key)
@ -82,7 +82,7 @@ __cxa_get_globals_fast ()
}
extern "C" __cxa_eh_globals *
__cxa_get_globals ()
__cxa_get_globals () throw()
{
#if __GTHREADS
__cxa_eh_globals *g;

View file

@ -1,4 +1,4 @@
// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
// Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -85,8 +85,7 @@ namespace std
codecvt<char, char, mbstate_t>::
do_in(state_type&, const extern_type* __from,
const extern_type*, const extern_type*& __from_next,
intern_type* __to, intern_type*,
intern_type*& __to_next) const
intern_type* __to, intern_type*, intern_type*& __to_next) const
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// According to the resolution of DR19, "If returns noconv [...]
@ -110,7 +109,10 @@ namespace std
codecvt<char, char, mbstate_t>::
do_length (state_type&, const extern_type* __from,
const extern_type* __end, size_t __max) const
{ return std::min(__max, static_cast<size_t>(__end - __from)); }
{
size_t __d = static_cast<size_t>(__end - __from);
return std::min(__max, __d);
}
int
codecvt<char, char, mbstate_t>::

View file

@ -1,4 +1,4 @@
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -108,9 +108,9 @@ namespace std
{
if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
{
_S_destroy_c_locale(_M_c_locale_ctype);
_S_create_c_locale(_M_c_locale_ctype, __s);
_M_initialize_ctype();
this->_S_destroy_c_locale(this->_M_c_locale_ctype);
this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
this->_M_initialize_ctype();
}
}
#endif

View file

@ -1,6 +1,6 @@
// Explicit instantiation file.
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -34,11 +34,18 @@
#include <ext/rope>
#include <ext/stdio_filebuf.h>
namespace __gnu_internal
{
const int min_len = __gnu_cxx::_Rope_constants::_S_max_rope_depth + 1;
}
namespace __gnu_cxx
{
using namespace __gnu_internal;
template
const unsigned long
rope<char, std::allocator<char> >::_S_min_len;
rope<char, std::allocator<char> >::_S_min_len[min_len];
template
char
@ -50,7 +57,7 @@ namespace __gnu_cxx
#ifdef _GLIBCXX_USE_WCHAR_T
template
const unsigned long
rope<wchar_t, std::allocator<wchar_t> >::_S_min_len;
rope<wchar_t, std::allocator<wchar_t> >::_S_min_len[min_len];
template
wchar_t