This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
3 patches for libstdc++
- To: egcs-bugs at cygnus dot com
- Subject: 3 patches for libstdc++
- From: Fred Richardson <frichard at bbn dot com>
- Date: Thu, 13 Nov 1997 00:07:57 -0500
- Reply-to: frichard at bbn dot com
Here are 3 patches which fix small bugs in libstdc++:
libstdc++/stl/stl_hashtable.h Bug in SGI dist!
libstdc++/stl/stl_hash_set.h Ditto!
libstdc++/std/bastring.h Terminate now resizes if
neccesary.
diff -C 2 libstdc++/stl/stl_hashtable.h.OLD libstdc++/stl/stl_hashtable.h
*** libstdc++/stl/stl_hashtable.h.OLD Tue Nov 4 15:14:19 1997
--- libstdc++/stl/stl_hashtable.h Wed Nov 12 23:59:25 1997
***************
*** 143,152 ****
static const unsigned long __stl_prime_list[__stl_num_primes] =
{
! 53, 97, 193, 389, 769,
! 1543, 3079, 6151, 12289, 24593,
! 49157, 98317, 196613, 393241, 786433,
! 1572869, 3145739, 6291469, 12582917, 25165843,
! 50331653, 100663319, 201326611, 402653189, 805306457,
! 1610612741, 3221225473, 4294967291
};
--- 143,152 ----
static const unsigned long __stl_prime_list[__stl_num_primes] =
{
! 53UL, 97UL, 193UL, 389UL, 769UL,
! 1543UL, 3079UL, 6151UL, 12289UL, 24593UL,
! 49157UL, 98317UL, 196613UL, 393241UL, 786433UL,
! 1572869UL, 3145739UL, 6291469UL, 12582917UL, 25165843UL,
! 50331653UL, 100663319UL, 201326611UL, 402653189UL, 805306457UL,
! 1610612741UL, 3221225473UL, 4294967291UL
};
***************
*** 613,617 ****
template <class Val, class Key, class HF, class Extract, class EqKey, class A>
inline void swap(hashtable<Val, Key, HF, Extract, EqKey, A>& ht1,
! hashtable<Val, Key, HF, Extract, EqKay, A>& ht2) {
ht1.swap(ht2);
}
--- 613,617 ----
template <class Val, class Key, class HF, class Extract, class EqKey, class A>
inline void swap(hashtable<Val, Key, HF, Extract, EqKey, A>& ht1,
! hashtable<Val, Key, HF, Extract, EqKey, A>& ht2) {
ht1.swap(ht2);
}
diff -C 2 libstdc++/stl/stl_hash_set.h.OLD libstdc++/stl/stl_hash_set.h
*** libstdc++/stl/stl_hash_set.h.OLD Tue Nov 4 15:14:17 1997
--- libstdc++/stl/stl_hash_set.h Wed Nov 12 23:58:26 1997
***************
*** 325,328 ****
--- 325,329 ----
inline void swap(hash_multiset<Val, HashFcn, EqualKey, Alloc>& hs1,
hash_multiset<Val, HashFcn, EqualKey, Alloc>& hs2)
+ {
hs1.swap(hs2);
}
diff -C 2 libstdc++/std/bastring.h.OLD libstdc++/std/bastring.h
*** libstdc++/std/bastring.h.OLD Wed Nov 12 23:56:53 1997
--- libstdc++/std/bastring.h Wed Nov 12 23:57:17 1997
***************
*** 294,298 ****
private:
void terminate () const
! { traits::assign ((*rep ())[length ()], eos ()); }
public:
--- 294,306 ----
private:
void terminate () const
! {
! if (length() >= capacity())
! {
! Rep *p = Rep::create (length() + 1);
! p->copy (0, data (), length());
! ((basic_string*)this)->repup (p);
! }
! traits::assign ((*rep ())[length ()], eos ());
! }
public: