2004-04-16 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/14975
* include/bits/fstream.tcc (basic_filebuf::imbue): Zero _M_codecvt
in case of error.
* testsuite/27_io/basic_filebuf/imbue/char/14975-1.cc: New.
* testsuite/27_io/basic_filebuf/imbue/wchar_t/14975-2.cc: New.
From-SVN: r80753
2004-04-16 Paolo Carlini <pcarlini@suse.de>
* acconfig.h: Remove _GLIBCXX_USE_LONG_DOUBLE entry, not
used anymore.
* config.h.in: Regenerate.
2004-04-16 Paolo Carlini <pcarlini@suse.de>
* config/locale/generic/monetary_members.cc
(moneypunct<wchar_t>::_M_initialize_moneypunct): Avoid calling
btowc unnecessarily, just cast to wchar_t (the concerned chars
all belong to the basic character set).
* config/locale/generic/numeric_members.cc
(numpunct<wchar_t>::_M_initialize_numpunct): Likewise.
* config/locale/gnu/monetary_members.cc
(moneypunct<wchar_t>::_M_initialize_moneypunct): Likewise.
* config/locale/gnu/numeric_members.cc
(numpunct<wchar_t>::_M_initialize_numpunct): Likewise.
From-SVN: r80746
* testsuite/Makefile.am: Add definition of AM_CXXFLAGS.
Change definition of CXX to use $(shell) instead of backticks.
* testsuite/Makefile.in: Regenerate.
From-SVN: r80693
* config/locale/gnu/numeric_members.cc
(numpunct<wchar_t>::_M_initialize_numpunct): No need to wrap
in __uselocale, since btowc is called for chars belonging to
the basic character set.
From-SVN: r80618
* config/locale/gnu/monetary_members.cc
(moneypunct<wchar_t>::_M_initialize_moneypunct): Prefer
_NL_MONETARY_DECIMAL_POINT_WC, _NL_MONETARY_THOUSANDS_SEP_WC,
and __MON_GROUPING to _NL_NUMERIC_DECIMAL_POINT_WC,
_NL_NUMERIC_THOUSANDS_SEP_WC, and GROUPING.
* config/locale/gnu/numeric_members.cc
(numpunct<char>::_M_initialize_numpunct): Prefer DECIMAL_POINT
and THOUSANDS_SEP to the deprecated RADIXCHAR and THOUSEP.
From-SVN: r80477
2004-04-05 Paolo Carlini <pcarlini@suse.de>
* include/ext/mt_allocator.h (__mt_alloc<>::deallocate):
The critical section is actually very small, only two assignments.
From-SVN: r80439
2004-04-03 Paolo Carlini <pcarlini@suse.de>
* include/ext/mt_allocator.h (__mt_alloc<>::allocate): Factor out
some duplicated code.
(__mt_alloc<>::_Bin_record): Spare the space of _M_free and _M_used
in the single threaded case.
* testsuite/performance/20_util/allocator/list_sort_search.cc:
Reorder and renumber the tests consistently with the other testfiles.
* testsuite/performance/20_util/allocator/map_mt_find.cc: Ditto.
* testsuite/performance/20_util/allocator/map_thread.cc: Ditto.
* testsuite/performance/20_util/allocator/producer_consumer.cc: Ditto.
From-SVN: r80375
2004-04-02 Paolo Carlini <pcarlini@suse.de>
* include/ext/mt_allocator.h (__mt_alloc<>::deallocate):
Rearrange arithmetic to avoid computing two divisions at
each deallocation.
From-SVN: r80356
2004-04-01 Paolo Carlini <pcarlini@suse.de>
* include/ext/mt_allocator.h (__mt_alloc<>::_S_initialize):
Streamline the second half, wrapping it in a single
'#ifdef __GTHREADS if (__gthread_active_p())' and avoiding
conditionals inside loops.
From-SVN: r80323
2004-03-31 Paolo Carlini <pcarlini@suse.de>
* config/locale/generic/c_locale.cc (__convert_to_v(long double&)):
In v3 uses of sscanf, the special floating-point numbers INF,
INFINITY, etc., cannot occur in input, therefore, if the latter
is too large, ERANGE is always stored in errno, no need of finitel.
From-SVN: r80247
2004-03-29 Paolo Carlini <pcarlini@suse.de>
* testsuite/thread/pthread7-rope.cc: Fix, unpredictably, depending
on allocator behavior, the memory pointed by data2 may well be not
trashed.
From-SVN: r80051
2004-03-28 Chavdar Botev <cbotev@yahoo.com>
PR libstdc++/14245
* include/bits/basic_string.tcc
(basic_string::basic_string(const basic_string&)): Pass to
_Rep::_M_grab the actual allocator of the string being constructed
not the default constructed one.
From-SVN: r80041
2004-03-26 Paolo Carlini <pcarlini@suse.de>
* include/ext/mt_allocator.h (__mt_alloc<>::allocate,
__mt_alloc<>::deallocate): Protect two instances of
block->thread_id with __GTHREADS.
From-SVN: r79986
2004-03-25 Gawain Bolton <gp.bolton@computer.org>
* include/bits/stl_tree.h (_Rb_tree_impl): Add _Node_allocator
default argument in constructors.
(_Rb_tree::_M_empty_initialize): Remove.
2004-03-25 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/23_containers/map/operators/1_neg.cc: Adjust line numbers.
* testsuite/23_containers/set/operators/1_neg.cc: Same.
2004-03-25 Dhruv Matani <dhruvbird@gmx.net>
* include/bits/cpp_type_traits.h: Changed __is_pod
completely. Now, it does not use any of the previous type_traits
to detect the pod types, and it also detects function pointers as
POD types.
* include/bits/stl_tree.h: Introduced a new class _Rb_tree_impl,
which encapsulates the internal implementation of an rb_tree. Made
the allocator a base class of this class instead of the rb_tree,
which was not conforming. This _Rb_tree_impl class is also
specialized on whether the _Compare parameter is a POD type or
not. If so, then it maintains the comparison function as a data
member, otherwise it makes the _Compare parameter a base class of
itself. Also, _M_key_compare is now a function instead of a data
member, so that the above trick can work properly. Delegated the
initialization of the other data members to this newly created
class. Also, now other member functions of rb_tree must refer to
_M_key_compare as _M_impl._M_key_compare(). The other data members
(*) can be referenced to as _M_impl.(*), where
(*) includes _M_header, and _M_node_count.
From-SVN: r79977
2004-03-25 Paolo Carlini <pcarlini@suse.de>
* include/ext/mt_allocator.h (__mt_alloc<>::tune):
Add _M_min_bin, the size in bytes of the smallest bin.
(__mt_alloc<>::tune()): Tweak accordingly.
(__mt_alloc<>::tune(size_t, ...)): Likewise.
(__mt_alloc<>::block_record): Change to a union: members next
and thread_id are never used at the same time.
(__mt_alloc<>::allocate): Update consistently.
(__mt_alloc<>::deallocate): Likewise.
(__mt_alloc<>::_S_initialize): Update setups of _S_binmap and
_S_bin_size for the configurable _M_min_size.
From-SVN: r79962
2004-03-25 Dhruv Matani <dhruvbird@gmx.net>
* include/bits/stl_list.h: Created a _List_impl class and made it
derive from the allocator, instead of the list deriving from the
allocator class, which was not conformant. Changed all references
from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same
as above (changed all references to the concerned variables).
2004-03-25 Dhruv Matani <dhruvbird@gmx.net>
* include/bits/stl_deque.h: Created a _Deque_impl class and made
it derive from the allocator, instead of the deque deriving from
the allocator class, which was not conformant. Changed all
references to the _M_start, _M_finish, _M_map, and _M_map_size to
_M_impl.*.
(_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this->
qualification in 2 places where it was missing.
(_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as
above.
* include/bits/deque.tcc: Same as above (changed all references to
the concerned variables).
2004-03-25 Dhruv Matani <dhruvbird@gmx.net>
* include/bits/stl_vector.h: Created a _Vector_impl class and made
it derive from the allocator, instead of the _Vector_base class,
deriving from the allocator which was not conformant. Changed all
references to the _M_start, _M_finish, and _M_end_of_storage to
_M_impl.*.
* include/bits/vector.tcc: Same as above (changed all references
to the concerned variables).
2004-03-25 Dhruv Matani <dhruvbird@gmx.net>
* testsuite/23_containers/deque/cons/clear_allocator.cc: New.
* testsuite/23_containers/list/cons/clear_allocator.cc: New.
* testsuite/23_containers/vector/cons/clear_allocator.cc: New.
From-SVN: r79957
2004-03-24 Dhruv Matani <dhruvbird@gmx.net>
* ext/malloc_allocator.h: Fixed the construct function to call
global placement new instead of assignment. Added a check after
the return from malloc to check whether returned pointer is NULL,
and if so, throw std::bad_alloc().
* ext/debug_allocator.h: Added a check in the deallocate function
to check whether the user has passed a NULL pointer or not.
From-SVN: r79934
2004-03-24 Dhruv Matani <dhruvbird@gmx.net>
* include/ext/bitmap_allocator.h: (_Bit_scan_forward) -> Made this
function call __builtin_ctz instead of the while loop.
(allocate) -> If condition has __builtin_expect.
(deallocate) -> Ditto.
Renamed a few left-over variables and typedefs according to the
C++STYLE mentioned in the documentation.
Protected calls to __gthread* by __gthread_active_p(), whose value
is cached in the local variable __threads_active.
From-SVN: r79924
2004-03-24 Felix Yen <fwy@alumni.brown.edu>
* testsuite/performance/20_util/allocator/producer_consumer.cc:
Use linear algorithm for producer.
From-SVN: r79920
2004-03-19 Paolo Carlini <pcarlini@suse.de>
Petur Runolfsson <peturr02@ru.is>
PR libstdc++/12077
* include/ext/stdio_sync_filebuf.h (showmanyc): Remove, there's
no way to find out the conversion used by the underlying FILE*.
* testsuite/ext/stdio_sync_filebuf/wchar_t/12077.cc: New.
* testsuite/27_io/objects/char/9.cc: Tweak.
Co-Authored-By: Petur Runolfsson <peturr02@ru.is>
From-SVN: r79695
2004-03-19 Phil Edwards <phil@codesourcery.com>
* acinclude.m4 (GLIBCXX_CHECK_WCHAR_T_SUPPORT): Set LIBICONV,
not libiconv. SUBST this variable as well.
* testsuite/Makefile.am (site.exp): New target, based on that
created by automake. Also set libiconv.
* configure, Makefile.in, include/Makefile.in, libmath/Makefile.in,
libsupc++/Makefile.in, po/Makefile.in, src/Makefile.in,
testsuite/Makefile.in: Regenerate.
From-SVN: r79678
2004-03-16 Benjamin Kosnik <bkoz@redhat.com>
* acinclude.m4 (GLIBCXX_ENABLE_ALLOCATOR): Default setting is
new_allocator for all hosts.
* configure: Regenerate.
From-SVN: r79582
2004-03-15 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (money_get<>::_M_extract):
Adjust the logic underlying the parsing of symbol to deal
correctly with an optional sign component (i.e., when either
negative_sign or positive_sign is empty)
* testsuite/22_locale/money_get/get/char/19.cc: New.
* testsuite/22_locale/money_get/get/wchar_t/19.cc: New.
2004-03-15 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (money_get<>::_M_extract):
Do not accept an incomplete currency symbol.
* testsuite/22_locale/money_get/get/char/18.cc: New.
* testsuite/22_locale/money_get/get/wchar_t/18.cc: New.
From-SVN: r79491
2004-03-10 Jerry Quinn <jlquinn@optonline.net>
PR 3247
* include/bits/gslice_array.h (gslice_array()): Make public.
(operator=(gslice_array)): Make public. Implement.
* include/bits/indirect_array.h (indirect_array()): Make public.
* include/bits/mask_array.h (mask_array()): Make public.
(operator=(mask_array)): Make public. Implement.
* include/bits/valarray_array.tcc (__valarray_copy):
Comment. Add versions for gslice_array and mask_array.
* testsuite/26_numerics/valarray_subset_assignment.cc: New test.
From-SVN: r79226
2004-03-08 Paolo Carlini <pcarlini@suse.de>
* docs/html/ext/howto.html: Add entry for DR 103 [WP].
* include/bits/stl_multiset.h: Add comment about DR 103.
* include/bits/stl_set.h: Likewise.
From-SVN: r79114
2004-03-08 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (money_get<>::_M_extract):
The value _space_ indicates that at least one space is required
at that position.
* testsuite/22_locale/money_get/get/char/17.cc: New.
* testsuite/22_locale/money_get/get/wchar_t/17.cc: New.
* testsuite/22_locale/money_get/get/char/7.cc: Minor tweaks.
* testsuite/22_locale/money_get/get/wchar_t/7.cc: Likewise.
* include/bits/locale_facets.tcc (money_get<>::do_get(long_double&)):
Remove redundant conditional on __str.size().
From-SVN: r79111
2004-03-06 Benjamin Kosnik <bkoz@redhat.com>
* include/ext/mt_allocator.h (_S_initialize): If
!__GTHREAD_MUTEX_INIT, then initialize _S_thread_freelist_mutex.
From-SVN: r79044
2004-03-06 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/12658
* src/locale_init.cc (locale::locale): Lock critical regions with
external mutexes.
(locale::global): Same.
* include/bits/concurrence.h (__glibcxx_mutex_define_initialized):
Add in once bits for cases without __GTHREAD_MUTEX_INIT.
(__glibcxx_mutex_lock): Same.
* config/cpu/generic/atomicity.h: Remove
_GLIBCXX_NEED_GENERIC_MUTEX, use concurrence.h.
* src/misc-inst.cc: Move all locking bits out of this file.
* config/os/hpux/os_defines.h: Remove _GLIBCXX_INST_ATOMICITY_LOCK.
* src/misc-inst.cc: Same.
* config/cpu/hppa/atomicity.h: Same.
* config/linker-map.gnu: Remove types in the signature of atomic
exports, as they may vary.
From-SVN: r79043
2004-03-03 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (money_put<>::_M_insert):
Deal properly with empty __digits and negative frac_digits,
clean-up a bit.
From-SVN: r78844
2004-03-02 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (money_get<>::_M_extract):
Reorganize a bit the main parsing loop, thus early detecting
an empty value component.
* testsuite/22_locale/money_get/get/char/16.cc: New.
* testsuite/22_locale/money_get/get/wchar_t/16.cc: New.
From-SVN: r78788
2004-03-01 Benjamin Kosnik <bkoz@redhat.com>
* docs/html/test.html: Add multilib RUNTESTFLAGS example.
* docs/html/18_support/howto.html: Add bit about writing to
stderr, mostly by Zack.
From-SVN: r78709
2004-03-01 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (money_get<>::_M_extract,
money_get<>::do_get(string_type&)): ... and two more.
From-SVN: r78708
2004-03-01 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (money_get<>::_M_extract):
Fix thinkos in the switch from string_type& to string& as last
argument.
From-SVN: r78707
2004-03-01 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (num_get<>::_M_extract_float):
Also when parsing exponent sign, first look for thousands_sep
and decimal_point; tweak a bit.
* testsuite/22_locale/num_get/get/char/15.cc: New.
* testsuite/22_locale/num_get/get/wchar_t/15.cc: New.
* include/bits/locale_facets.tcc (num_get<>::_M_extract_float,
num_get<>::_M_extract_int): Reorder some conditionals.
2004-03-01 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (money_get<>::_M_extract):
Consistently with numpunct, enforce the requirements in
22.2.6.3, p3 for the thousands separators; tweak a bit.
* testsuite/22_locale/money_get/get/char/15.cc: New.
* testsuite/22_locale/money_get/get/wchar_t/15.cc: New.
From-SVN: r78699
2004-03-01 David Billinghurst <David.Billinghurst@riotinto.com>
* testsuite/lib/libstdc++.exp (v3-list-tests): Use
testsuite_files from correct multilib blddir when running
testsuite.
From-SVN: r78692
2004-02-29 Phil Edwards <phil@codesourcery.com>
* testsuite/Makefile.am (check-abi, check-abi-verbose): Copy
the summary file to the logfile.
* testsuite/Makefile.in: Regenerate.
From-SVN: r78647
* config/cpu/hppa/atomicity.h (__atomic_add): Make first argument
volatile.
* config/os/hpux/os_defines.h (_GLIBCXX_INST_ATOMICITY_LOCK): Use
__GXX_WEAK__ instead of _GLIBCXX_SUPPORTS_WEAK.
From-SVN: r78633
2004-02-28 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (num_get<>::_M_extract_float):
According to 22.2.3.1, p2, 'units' may be followed by 'e' with
no 'decimal-point' in the middle: in this case too we must fix
up __found_grouping; slightly tweak.
* testsuite/22_locale/num_get/get/char/14.cc: New.
* testsuite/22_locale/num_get/get/wchar_t/14.cc: New.
From-SVN: r78625
2004-02-27 Phil Edwards <phil@codesourcery.com>
* testsuite/config/default.exp: Update with comments.
(${tool}_target_compile): New wrapper routine.
* testsuite/lib/dg-options.exp: New file, with dg-require-iconv.
* testsuite/lib/libstdc++.exp: Update with comments and cosmetic
fixes.
(load_gcc_lib, v3track): New routines.
(v3-init): Rename to libstdc++_init.
* testsuite/libstdc++-dg/normal.exp: No longer call v3-init.
Move DEFAULT_CXXFLAGS handling into libstdc++_init.
From-SVN: r78580
2004-02-27 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (num_get<>::_M_extract_float,
num_get<>::_M_extract_int, money_get<>::_M_extract): If appropriate,
call reserve on the __tmp_gruping string.
(num_get<>::_M_extract_float): Don't append unnecessarily a
char() to the returned string.
* include/bits/locale_facets.tcc: Trivial reformattings.
From-SVN: r78565
2004-02-27 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.h (money_get<>::_M_extract):
Change signature: now takes a plain string&.
* include/bits/locale_facets.tcc (money_get<>::_M_extract):
Update consistently the definition; use the moneypunct cache
to parse the value; use swap to change __units.
(money_get<>::do_get(long double&)): Update call of _M_extract,
avoid ctype::narrow, not correct wrt the standard.
(money_get<>::do_get(string_type&)): Likewise, update call
of _M_extract, use ctype::widen.
* src/locale-inst.cc: Tweak instantiations of _M_extract.
From-SVN: r78562