Commit Graph

11 Commits

Author SHA1 Message Date
Benjamin Kosnik b2acb86f5b stl_alloc.h: Cleanups.
2003-06-06  Benjamin Kosnik  <bkoz@redhat.com>

	* include/bits/stl_alloc.h: Cleanups.
	* include/ext/functional: Same.
	* include/ext/hash_map: Same.
	* include/ext/hash_set: Same.
	* include/ext/iterator: Same.
	* include/ext/memory: Same.
	* include/ext/numeric: Same.
	* include/ext/rb_tree: Same.
	* include/ext/ropeimpl.h: Same.
	* include/ext/slist: Same.
	* include/ext/stdio_filebuf.h: Same.
	* include/ext/stdio_sync_filebuf.h: Same.
	* include/ext/stl_rope.h: Move to...
	* include/ext/rope: ...here.
	* include/ext/stl_hash_fun.h: Move to...
	* include/ext/hash_fun.h: ...here.
	* include/ext/stl_hashtable.h: Move to...
	* include/ext/hashtable.h: ...here.
	* include/backward/hashtable.h: Reflect new names.
	* include/Makefile.am: Same.
	* include/Makefile.in: Regenerated.

From-SVN: r67551
2003-06-06 15:50:28 +00:00
Paolo Carlini e3033a2240 fstream.tcc (_M_overflow): Rewrote to call _M_convert_to_external only once (_M_buf_size is now the size...
2003-05-15  Paolo Carlini  <pcarlini@unitus.it>
	    Nathan Myers  <ncm@cantrip.org>

	* include/bits/fstream.tcc (_M_overflow): Rewrote to call
	_M_convert_to_external only once (_M_buf_size is now the size of
	the put area + 1 for the overflow char of a full area); call
	_M_set_buffer instead of _M_set_indeterminate.
	(setbuf): Don't accept a buffer smaller than 2 chars.
	(_M_underflow): Refill _M_buf_size - 1 chars; call _M_set_buffer,
	instead of _M_set_determinate.
	(open): Call _M_set_buffer, instead of _M_set_indeterminate.
	(seekoff): Likewise.
	* include/ext/stdio_filebuf.h (stdio_filebuf(int,
	std::ios_base::openmode, bool, size_t),
	stdio_filebuf(std::__c_file*, std::ios_base::openmode, size_t):
	Likewise.
	* include/std/std_fstream.h (_M_set_indeterminate): Remove.
	(_M_set_determinate): Rename as _M_set_buffer, _M_buf_size ->
	_M_buf_size - 1.
	* include/std/std_streambuf.h: Tweak _M_out_lim comment.
	* testsuite/27_io/basic_filebuf/sgetn/char/1.cc: Tweak, taking
	into account that, for _M_buf_size == BUFSIZ == 8192, the size of
	the put area is now BUFSIZ - 1.
	* testsuite/ext/stdio_filebuf_2.cc: Tweak, taking into account
	that now the smallest _M_buf_size is 2 (still fails, for the same
	reason, with 3.2.3)

Co-Authored-By: Nathan Myers <ncm@cantrip.org>

From-SVN: r66848
2003-05-15 23:43:15 +00:00
Benjamin Kosnik 51ff814940 [multiple changes]
2003-05-10  Petur Runolfsson  <peturr02@ru.is>

	PR libstdc++/9027
	PR libstdc++/9520
	PR libstdc++/10096
	* include/bits/fstream.tcc (basic_file::_M_underflow):  Add generic
	implementation, based on old wchar_t specialization, add support
	for codecvt::in() return value of codecvt_base::noconv, remove
	_M_file.sys_ungetc() call.
	* include/std/std_fstream.h (basic_file::underflow,
	basic_file::uflow, basic_file::_M_underflow):  Remove
	specialization declarations, call _M_underflow from generic versions
	of underflow and uflow.
	* src/fstream.cc (basic_file::underflow, basic_file::uflow,
	basic_file::_M_underflow):  Remove specializations.
	* src/Makefile.am (sources):  Remove fstream.cc.
	* src/Makefile.in:  Regenerated.
	* testsuite/27_io/basic_filebuf/underflow/10096.cc:  New test.
	* testsuite/27_io/basic_filebuf/underflow/char/1.cc:  New test.
	* testsuite/27_io/basic_filebuf/underflow/char/9027.cc:  New test.
	* testsuite/27_io/basic_filebuf/underflow/wchar_t/9520.cc:  New test.

2003-05-10  Benjamin Kosnik  <bkoz@redhat.com>

	* include/ext/stdio_filebuf.h (__stdio_filebuf): Remove stack
	buffer.
	* config/io/basic_file_stdio.h (__basic_file::xsgetn): Remove
	unbuffered bits.
	(__basic_file::xsputn): Same.
	(__basic_file::seekoff): Same.
	(__basic_file::seekpos): Same.
	(__basic_file::showmanyc): Same.
	* config/io/basic_file_stdio.cc: Same.
	* include/std/std_fstream.h: Same.
	* include/bits/fstream.tcc: Same.
	* src/fstream.cc: Same.
	* testsuite/27_io/basic_filebuf/sgetn/char/1.cc (test05): Tidy.

2003-05-10  Petur Runolfsson  <peturr02@ru.is>

	PR libstdc++/9520
	PR libstdc++/9661
	PR libstdc++/9662
	* include/ext/stdio_sync_filebuf.h:  New file.
	(basic_stdiobuf):  New.
	* include/Makefile.am (ext_headers): Add ext/stdio_sync_filebuf.h
	* include/Makefile.in: Regenerate.
	* include/bits/ios_base.h (Init::_S_create_buffers,
	Init::_S_destroy_buffers):  Remove declarations.
	* src/globals.cc (buf_cout_sync, buf_cin_sync, buf_cerr_sync,
	buf_wcout_sync, buf_wcin_sync, buf_wcerr_sync):  Define.
	* src/ios.cc (Init::_S_create_buffers,
	Init::_S_destroy_buffers):  Remove.
	(Init::Init):  Create and use syncronized buffers.
	(ios_base::sync_with_stdio):  Destroy syncronized buffers,
	create and install unsyncronized buffers.
	* testsuite/27_io/objects/char/10.cc:  New test.
	* testsuite/27_io/objects/char/9.cc:  New test.
	* testsuite/27_io/objects/char/9661-1.cc:  New test.
	* testsuite/27_io/objects/char/9661-2_xin.cc:  New test.
	* testsuite/27_io/objects/char/9661-2_xin.in:  New.
	* testsuite/27_io/objects/wchar_t/1.cc:  New test.
	* testsuite/27_io/objects/wchar_t/10.cc:  New test.
	* testsuite/27_io/objects/wchar_t/2.cc:  New test.
	* testsuite/27_io/objects/wchar_t/2523-1_xin.cc:  New test.
	* testsuite/27_io/objects/wchar_t/2523-1_xin.in:  New.
	* testsuite/27_io/objects/wchar_t/2523-2_xin.cc:  New test.
	* testsuite/27_io/objects/wchar_t/2523-2_xin.in:  New.
	* testsuite/27_io/objects/wchar_t/3045.cc:  New test.
	* testsuite/27_io/objects/wchar_t/3647.cc:  New test.
	* testsuite/27_io/objects/wchar_t/3_xin.cc:  New test.
	* testsuite/27_io/objects/wchar_t/3_xin.in:  New.
	* testsuite/27_io/objects/wchar_t/4_xin.cc:  New test.
	* testsuite/27_io/objects/wchar_t/4_xin.in:  New.
	* testsuite/27_io/objects/wchar_t/5.cc:  New test.
	* testsuite/27_io/objects/wchar_t/5268.cc:  New test.
	* testsuite/27_io/objects/wchar_t/5280_xin.cc:  New test.
	* testsuite/27_io/objects/wchar_t/5280_xin.in:  New.
	* testsuite/27_io/objects/wchar_t/6.cc:  New test.
	* testsuite/27_io/objects/wchar_t/6548_xin.cc:  New test.
	* testsuite/27_io/objects/wchar_t/6548_xin.in:  New.
	* testsuite/27_io/objects/wchar_t/6648-1_xin.cc:  New test.
	* testsuite/27_io/objects/wchar_t/6648-1_xin.in:  New.
	* testsuite/27_io/objects/wchar_t/6648-2_xin.cc:  New test.
	* testsuite/27_io/objects/wchar_t/6648-2_xin.in:  New.
	* testsuite/27_io/objects/wchar_t/7.cc:  New test.
	* testsuite/27_io/objects/wchar_t/7744_xin.cc:  New test.
	* testsuite/27_io/objects/wchar_t/7744_xin.in:  New.
	* testsuite/27_io/objects/wchar_t/8.cc:  New test.
	* testsuite/27_io/objects/wchar_t/9_xin.cc:  New test.
	* testsuite/27_io/objects/wchar_t/9_xin.in:  New.
	* testsuite/27_io/objects/wchar_t/9520.cc:  New test.
	* testsuite/27_io/objects/wchar_t/9661-1.cc:  New test.
	* testsuite/27_io/objects/wchar_t/9661-2_xin.cc:  New test.
	* testsuite/27_io/objects/wchar_t/9661-2_xin.in:  New.
	* testsuite/27_io/objects/wchar_t/9662.cc:  New test.
	* testsuite/ext/stdiobuf_char.cc:  New test.
	* testsuite/ext/stdiobuf_wchar_t.cc:  New test.

From-SVN: r66678
2003-05-11 04:20:57 +00:00
Paolo Carlini 8544261c53 stdio_filebuf.h (stdio_filebuf(int, std::ios_base::openmode, bool, size_t), [...]): Shorten a bit (-10 lines) by factoring out some code.
2003-05-01  Paolo Carlini  <pcarlini@unitus.it>

	* include/ext/stdio_filebuf.h
	(stdio_filebuf(int, std::ios_base::openmode, bool, size_t),
	stdio_filebuf(std::__c_file*, std::ios_base::openmode, size_t)):
	Shorten a bit (-10 lines) by factoring out some code.

From-SVN: r66320
2003-05-01 08:41:59 +00:00
Paolo Carlini 7ef9fd85ef Remove _M_buf_size_opt, use directly _M_buf_size instead.
2003-04-12  Paolo Carlini  <pcarlini@unitus.it>

	Remove _M_buf_size_opt, use directly _M_buf_size instead.
	* include/bits/fstream.tcc
	(basic_filebuf::_M_allocate_internal_buffer, setbuf): Remove
	references to _M_buf_size_opt.
	* include/bits/sstream.tcc (basic_stringbuf::overflow): Likewise.
	* include/bits/streambuf.tcc (__copy_streambufs): Likewise, rename
	__bufsize to __in_avail and __size_opt to __buf_size.
	* include/ext/stdio_filebuf.h (stdio_filebuf::stdio_filebuf): Likewise.
	* include/std/std_sstream.h (_M_stringbuf_init, setbuf): Likewise.
	* include/std/std_streambuf.h (~basic_streambuf(),
	basic_streambuf()): Likewise, remove _M_buf_size_opt member.
	* testsuite/27_io/basic_filebuf/close/char/3.cc: Set _M_buf_size.
	* testsuite/27_io/basic_filebuf/in_avail/char/1.cc: Likewise.
	* testsuite/27_io/basic_filebuf/sbumpc/char/1.cc: Likewise.
	* testsuite/27_io/basic_filebuf/seekoff/char/1.cc: Likewise.
	* testsuite/27_io/basic_filebuf/seekpos/char/1.cc: Likewise.
	* testsuite/27_io/basic_filebuf/sgetc/char/1.cc: Likewise.
	* testsuite/27_io/basic_filebuf/sgetn/char/1.cc: Likewise.
	* testsuite/27_io/basic_filebuf/snextc/char/1.cc: Likewise.
	* testsuite/27_io/basic_filebuf/sputbackc/char/1.cc: Likewise.
	* testsuite/27_io/basic_filebuf/sputc/char/1.cc: Likewise.
	* testsuite/27_io/basic_filebuf/sputn/char/1.cc: Likewise.
	* testsuite/27_io/basic_filebuf/sungetc/char/1.cc: Likewise.

From-SVN: r65518
2003-04-12 19:21:35 +00:00
Paolo Carlini 2ad0022889 stdio_filebuf.h (stdio_filebuf::stdio_filebuf(...), ...): _M_buf_size_opt == 0 means only...
2003-04-12  Paolo Carlini  <pcarlini at unitus dot it>

	* include/ext/stdio_filebuf.h
	(stdio_filebuf::stdio_filebuf(int, openmode, bool, size_t),
	stdio_filebuf::stdio_filebuf(__c_file*, openmode, size_t):
	_M_buf_size_opt == 0 means only "not to use an allocated buffer"
	since a stack-based buffer is used for small values of the size_t
	parameter.
	* include/bits/fstream.tcc (basic_filebuf::_M_really_overflow).
	If _M_buf_size != 0 flush out the buffer (any kind, stack-based too).
	* testsuite/ext/stdio_filebuf_2.cc: New testfile.

From-SVN: r65513
2003-04-12 16:07:51 +00:00
Paolo Carlini dfc7d89965 re PR libstdc++/9320 (Incorrect usage of traits_type::int_type in stdio_filebuf)
2003-02-11  Paolo Carlini  <pcarlini@unitus.it>

	PR libstdc++/9320
	* include/ext/stdio_filebuf.h
	(stdio_filebuf(int, std::ios_base::openmode, bool, int_type),
	stdio_filebuf(std::__c_file*, std::ios_base::openmode, int_type)):
	Change to take a __size parameter of type size_t, not
	of type (template parameter dependent) int_type.
	* src/ios.cc (ios_base::Init::_S_ios_create): Change type of
	size vars to size_t.
	* testsuite/ext/stdio_filebuf.cc: Add.

From-SVN: r62691
2003-02-11 10:43:49 +00:00
Mark Mitchell 8fbc5ae723 cp-tree.h (lang_type_class): Remove is_partial_instantiation.
* cp-tree.h (lang_type_class): Remove is_partial_instantiation.
	(PARTIAL_INSTANTIATION_P): Remove.
	(IMPLICIT_TYPENAME_P): Likewise.
	(IMPLICIT_TYPENAME_TYPE_DECL_P): Likewise.
	(build_typename_type): Remove declaration.
	(parmlist_is_exprlist): Likewise.
	* decl.c (build_typename_type): Make it static, remove third
	parameter.
	(push_class_binding): Don't do implicit typename stuff.
	(make_typename_type): Likewise.
	(lookup_name_real): Likewise.
	(grokdeclarator): Don't try to convert declarations into
	initializations.  Don't do implicit typename stuff.
	(parmlist_is_exprlist): Remove.
	(xref_basetypes): Simplify.
	* decl2.c (grokfield): Don't try to convert declarations into
	initializations.
	(build_anon_union_vars): Do this while processing templates, too.
	(finish_anon_union): Likewise.
	* error.c (dump_type): Remove implicit typename handling.
	* parser.c (cp_parser_diagnose_invalid_type_name): New method.
	(cp_parser_primary_expression): Correct handling of names not
	found by unqualified name lookup in templates.
	(cp_parser_nested_name_specifier_opt): Avoid checking dependency
	of types when possible.
	(cp_parser_simple_declaration): Complain intelligently about some
	invalid declarations.
	(cp_parser_member_declaration): Likewise.
	(cp_parser_constructor_declarator_p): Don't check when we're in a
	function scope.
	* pt.c (instantiate_class_template): Remove
	PARTIAL_INSTANTIATION_P gunk.
	* search.c (lookup_field_r): Don't build implicit typenames.
	(marked_pushdecls_p): Don't enter dependent base types.
	(unmarked_pushdecls_p): Likewise.
	* semantics.c (begin_class_definition): Remove implicit typename
	stuff.

	* config/locale/gnu/messages_members.h: Use this-> to refer to
	unqualified members of base clasess.
	* config/locale/ieee_1003.1-2001/codecvt_specializations.h: Likewise.
	* include/bits/codecvt.h: Likewise.
	* include/bits/deque.tcc: Likewise.
	* include/bits/fstream.tcc: Likewise.
	* include/bits/istream.tcc: Likewise.
	* include/bits/list.tcc: Likewise.
	* include/bits/locale_facets.h: Likewise.
	* include/bits/ostream.tcc: Likewise.
	* include/bits/sstream.tcc: Likewise.
	* include/bits/stl_bvector.h: Likewise.
	* include/bits/stl_deque.h: Likewise.
	* include/bits/stl_list.h: Likewise.
	* include/bits/stl_tree.h: Likewise.
	* include/bits/stl_vector.h: Likewise.
	* include/bits/vector.tcc: Likewise.
	* include/ext/ropeimpl.h: Likewise.
	* include/ext/stdio_filebuf.h: Likewise.
	* include/ext/stl_rope.h: Likewise.
	* include/std/std_fstream.h: Likewise.
	* include/std/std_sstream.h: Likewise.

Co-Authored-By: Jeffrey Oldham <oldham@codesourcery.com>

From-SVN: r61403
2003-01-16 20:30:50 +00:00
Benjamin Kosnik 6e52332ec7 re PR libstdc++/7445 (poor performance of std::locale::classic() in multi-threaded applications)
2002-08-15  Benjamin Kosnik  <bkoz@redhat.com>

	* include/ext/stdio_filebuf.h (stdio_filebuf): Explicitly set
	_M_buf_size_opt to zero when unbuffering.
	* include/bits/fstream.tcc (filebuf::showmanyc): Simplify.
	Consistency checks for _M_buf_size_opt.

	Revert PR libstdc++/7445
	* src/locale.cc (locale::classic): Revert.

	* docs/html/17_intro/TODO: Add.

From-SVN: r56365
2002-08-15 22:25:39 +00:00
Phil Edwards 844f9ba6ad stdio_filebuf.h: Add header guards.
2002-05-21  Phil Edwards  <pme@gcc.gnu.org>

	* include/ext/stdio_filebuf.h:  Add header guards.  Doxygenate.

From-SVN: r53699
2002-05-21 20:53:36 +00:00
Benjamin Kosnik 5cdd50a591 stdio_filebuf.h: New file.
2002-04-30  Benjamin Kosnik  <bkoz@redhat.com>

	* include/ext/stdio_filebuf.h: New file.
	* include/ext/enc_filebuf.h: New file.
	* config/io/basic_file_stdio.h (__basic_file::sys_open): Add fd ctor.
	* config/io/basic_file_stdio.cc: Same.
	* include/bits/fstream.tcc (filebuf::_M_allocate_internal_buffer):
	Remove _M_unbuf hacks.
	(filebuf::_M_destroy_internal_buffer): Same.
	(filebuf::filebuf(cfile, openmode, int_type): Remove definition.
	(filebuf::fd): Remove.
	* include/std/std_fstream.h (filebuf::_M_unbuf): Remove.
	(filebuf::filebuf(__c_file*, openmode, int_type)): Remove.
	(filebuf::fd): Remove.
	* src/ios.cc (ios_base::_S_ios_create): Change to use specialized
	filebufs.
	(ios_base::_S_ios_destroy): Same.
	* src/misc-inst.cc (file_filebuf<char>): Add instantiation.
	* include/Makefile.am (ext_headers): Add ext_filebuf.h,
	stdio_filebuf.h.  * include/Makefile.in: Regenerate.

From-SVN: r52961
2002-04-30 19:04:43 +00:00