]> gcc.gnu.org Git - gcc.git/commitdiff
London changes to string:
authorJason Merrill <jason@yorick.cygnus.com>
Wed, 26 Nov 1997 07:19:11 +0000 (07:19 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 26 Nov 1997 07:19:11 +0000 (02:19 -0500)
* std/bastring.cc (check_realloc): Don't be selfish anymore.
* std/bastring.h (non-const operator[]): Be selfish.
(iterator forms of insert and erase): Stay selfish.

From-SVN: r16722

libstdc++/ChangeLog
libstdc++/Makefile.in
libstdc++/std/bastring.cc
libstdc++/std/bastring.h

index 7d2ce3a180f15bc0fdab183abf7ec6f12067de23..7830adc0bf2d1ea2995521b56190526988e689b0 100644 (file)
@@ -1,3 +1,10 @@
+Tue Nov 25 23:16:44 1997  Jason Merrill  <jason@yorick.cygnus.com>
+
+       London changes to string:
+       * std/bastring.cc (check_realloc): Don't be selfish anymore.
+       * std/bastring.h (non-const operator[]): Be selfish.
+       (iterator forms of insert and erase): Stay selfish.
+
 Tue Nov 25 14:03:43 1997  H.J. Lu  (hjl@gnu.org)
 
        * Makefile.in (stmp-complex, bigstmp-complex): Changed to
index 11208742d0a3052c184e92633d92b669331ff115..48a470c22b42dee69a1a4ec44915a8e978c86d91 100644 (file)
@@ -301,9 +301,10 @@ stuff:
        $(MAKE) clean
        $(MAKE) -C ../libio c++clean
        $(MAKE) -C ../libg++ clean
-       $(MAKE) $(MAKEFLAGS) check
-       $(MAKE) -C ../libio check
-       $(MAKE) -C ../libg++ check
+       -$(MAKE) $(MAKEFLAGS) check
+       -$(MAKE) -C ../libio check
+       -$(MAKE) -C ../libg++ check
+       -$(MAKE) -C ../gcc check-g++
 
 stuff1:
        $(MAKE) clean
@@ -311,6 +312,7 @@ stuff1:
        $(MAKE) -C ../libg++ clean
 
 stuff2:
-       $(MAKE) check
-       $(MAKE) -C ../libio check
-       $(MAKE) -C ../libg++ check
+       -$(MAKE) check
+       -$(MAKE) -C ../libio check
+       -$(MAKE) -C ../libg++ check
+       -$(MAKE) -C ../gcc check-g++
index aa151da69d1b6099214fb6d38bd5aff71463f5dd..444797096dc90121929d0ecace97f3251c9421a5 100644 (file)
@@ -87,6 +87,7 @@ inline bool basic_string <charT, traits>::
 check_realloc (size_t s) const
 {
   s += sizeof (charT);
+  rep ()->selfish = false;
   return (rep ()->ref > 1
          || s > capacity ()
          || Rep::excess_slop (s, capacity ()));
index 59a599583028cfbcb70dd90911a524a689ae72a5..f8fe279b158da56376ff9b4d5805d489cef6dde6 100644 (file)
@@ -220,9 +220,9 @@ public:
   basic_string& insert (size_type pos, size_type n, charT c)
     { return replace (pos, 0, n, c); }
   iterator insert(iterator p, charT c)
-    { insert (p - ibegin (), 1, c); return p; }
+    { insert (p - ibegin (), 1, c); selfish (); return p; }
   iterator insert(iterator p, size_type n, charT c)
-    { insert (p - ibegin (), n, c); return p; }
+    { insert (p - ibegin (), n, c); selfish (); return p; }
 #ifdef __STL_MEMBER_TEMPLATES
   template<class InputIterator>
     void insert(iterator p, InputIterator first, InputIterator last)
@@ -234,9 +234,9 @@ public:
   basic_string& erase (size_type pos = 0, size_type n = npos)
     { return replace (pos, n, (size_type)0, (charT)0); }
   iterator erase(iterator p)
-    { replace (p - ibegin (), 1, (size_type)0, (charT)0); return p; }
+    { replace (p-ibegin (), 1, (size_type)0, (charT)0); selfish (); return p; }
   iterator erase(iterator f, iterator l)
-    { replace (f - ibegin (), l - f, (size_type)0, (charT)0); return f; }
+    { replace (f-ibegin (), l-f, (size_type)0, (charT)0);selfish ();return f; }
 
   basic_string& replace (size_type pos1, size_type n1, const basic_string& str,
                         size_type pos2 = 0, size_type n2 = npos);
@@ -278,7 +278,7 @@ public:
     }
 
   reference operator[] (size_type pos)
-    { unique (); return (*rep ())[pos]; }
+    { selfish (); return (*rep ())[pos]; }
 
   reference at (size_type pos)
     {
This page took 0.066544 seconds and 5 git commands to generate.