From f22ad9d09ec3bdcdde3c48f0628274abf3ebfe6d Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Tue, 4 Jul 2000 02:24:54 +0000 Subject: [PATCH] [multiple changes] 2000-07-03 scott snyder * bits/locale_facets.tcc (_M_extract): Only figure out the base from the input if base == 0. * testsuite/27_io/istream_extractor_arith.cc: Test reading a number with a leading `0' in hex mode. * shadow/bits/std_cmath.h: Fix typo in _GLIBCPP_HAVE_CEILL test. * mkinclosure: Change `==' to `=' in test. 2000-07-03 Chip Salzenberg * src/Makefile.am (libio_headers): _G_config.h is found in srcdir, not builddir. * src/Makefile.in: Regenerate. From-SVN: r34860 --- libstdc++-v3/ChangeLog | 17 +++++++++++++++++ libstdc++-v3/bits/locale_facets.tcc | 2 +- libstdc++-v3/mkinclosure | 2 +- libstdc++-v3/shadow/bits/std_cmath.h | 2 +- libstdc++-v3/src/Makefile.am | 2 +- libstdc++-v3/src/Makefile.in | 2 +- libstdc++-v3/testsuite/27_io/istream_extractor_arith.cc | 11 ++++++++++- 7 files changed, 32 insertions(+), 6 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index f7f65d0..40658e8 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -6,6 +6,23 @@ * bits/std_complex.h: Fix parens. Format. +2000-07-03 scott snyder + + * bits/locale_facets.tcc (_M_extract): Only figure out the base + from the input if base == 0. + * testsuite/27_io/istream_extractor_arith.cc: Test reading a + number with a leading `0' in hex mode. + + * shadow/bits/std_cmath.h: Fix typo in _GLIBCPP_HAVE_CEILL test. + + * mkinclosure: Change `==' to `=' in test. + +2000-07-03 Chip Salzenberg + + * src/Makefile.am (libio_headers): _G_config.h is found in srcdir, + not builddir. + * src/Makefile.in: Regenerate. + 2000-07-01 Benjamin Kosnik Ulrich Drepper diff --git a/libstdc++-v3/bits/locale_facets.tcc b/libstdc++-v3/bits/locale_facets.tcc index a91d57f..539b051 100644 --- a/libstdc++-v3/bits/locale_facets.tcc +++ b/libstdc++-v3/bits/locale_facets.tcc @@ -386,7 +386,7 @@ namespace std __base = 16; __testzero = false; // "0x" is not a leading zero } - else + else if (__base == 0) __base = 8; } diff --git a/libstdc++-v3/mkinclosure b/libstdc++-v3/mkinclosure index a493eb9..7996b4b5 100755 --- a/libstdc++-v3/mkinclosure +++ b/libstdc++-v3/mkinclosure @@ -87,7 +87,7 @@ until cmp -s $OLDH $HDRS; do # (until no new headers found) | while read file; do drop=no for ignore in `cat $IGNORES`; do - if [ "$ignore" == "$file" ]; then drop=yes; fi + if [ "$ignore" = "$file" ]; then drop=yes; fi done case "$file" in /*) drop=yes;; esac # no absolute paths case $drop in no) echo "$file";; esac diff --git a/libstdc++-v3/shadow/bits/std_cmath.h b/libstdc++-v3/shadow/bits/std_cmath.h index 34967d4..5bed2599 100644 --- a/libstdc++-v3/shadow/bits/std_cmath.h +++ b/libstdc++-v3/shadow/bits/std_cmath.h @@ -365,7 +365,7 @@ { return atan2(static_cast(__y), static_cast(__x)); } #endif -#elif _GLIBCPP_HAVE_CEILL +#if _GLIBCPP_HAVE_CEILL inline long double _CPP_ceil_capture(long double __x) { return ceill(__x); } #else diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am index 07036c4..8327438 100644 --- a/libstdc++-v3/src/Makefile.am +++ b/libstdc++-v3/src/Makefile.am @@ -175,7 +175,7 @@ std_headers = \ if GLIBCPP_NEED_LIBIO libio_headers = \ - $(top_builddir)/libio/_G_config.h $(top_srcdir)/libio/libio.h + $(top_srcdir)/libio/_G_config.h $(top_srcdir)/libio/libio.h else libio_headers = endif diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in index e3e9954..c7ccd2ad 100644 --- a/libstdc++-v3/src/Makefile.in +++ b/libstdc++-v3/src/Makefile.in @@ -255,7 +255,7 @@ std_headers = \ streambuf string strstream typeinfo utility valarray vector @GLIBCPP_NEED_LIBIO_TRUE@libio_headers = @GLIBCPP_NEED_LIBIO_TRUE@\ -@GLIBCPP_NEED_LIBIO_TRUE@ $(top_builddir)/libio/_G_config.h $(top_srcdir)/libio/libio.h +@GLIBCPP_NEED_LIBIO_TRUE@ $(top_srcdir)/libio/_G_config.h $(top_srcdir)/libio/libio.h @GLIBCPP_NEED_LIBIO_FALSE@libio_headers = generated_headers = \ diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_arith.cc b/libstdc++-v3/testsuite/27_io/istream_extractor_arith.cc index fc754dc..199d585 100644 --- a/libstdc++-v3/testsuite/27_io/istream_extractor_arith.cc +++ b/libstdc++-v3/testsuite/27_io/istream_extractor_arith.cc @@ -31,14 +31,17 @@ std::string str_01; std::string str_02("true false 0 1 110001"); std::string str_03("-19999999 777777 -234234 233 -234 33 1 66300.25 .315 1.5"); +std::string str_04("0123"); std::stringbuf isbuf_01(std::ios_base::in); std::stringbuf isbuf_02(str_02, std::ios_base::in); std::stringbuf isbuf_03(str_03, std::ios_base::in); - +std::stringbuf isbuf_04(str_04, std::ios_base::in); + std::istream is_01(NULL); std::istream is_02(&isbuf_02); std::istream is_03(&isbuf_03); +std::istream is_04(&isbuf_04); std::stringstream ss_01(str_01); // minimal sanity check @@ -103,6 +106,11 @@ bool test01() { is_03 >> f1; test &= f1 == 1.5; + is_04 >> std::hex >> i1; + printf ("%d %d %d\n", i1, i1 == 0x123, test); + test &= i1 == 0x123; + printf ("%d %d %d\n", i1, i1 == 0x123, test); + // test void pointers int i = 55; void* po = &i; @@ -110,6 +118,7 @@ bool test01() { ss_01 << po; ss_01 >> pi; + printf ("%x %x\n", pi, po); test &= po == pi; #ifdef DEBUG_ASSERT -- 2.7.4