parent
0c423fd56b
commit
42701f757f
|
@ -1,3 +1,10 @@
|
|||
2001-04-06 Matthias Klose <doko@debian.org>
|
||||
|
||||
From <sicard@bigruth.solsoft.fr>:
|
||||
* std/bastring.h: remove some compiler warnings.
|
||||
* std/bastring.cc: Likewise.
|
||||
* stl/stl_hashtable.h: Likewise.
|
||||
|
||||
Fri Mar 16 12:46:19 GMT 2001 Bernd Schmidt (bernds@redhat.com)
|
||||
|
||||
* gcc-2.95.3 Released.
|
||||
|
|
|
@ -116,19 +116,19 @@ template <class charT, class traits, class Allocator>
|
|||
basic_string <charT, traits, Allocator>&
|
||||
basic_string <charT, traits, Allocator>::
|
||||
replace (size_type pos1, size_type n1,
|
||||
const basic_string& str, size_type pos2, size_type n2)
|
||||
const basic_string& _str, size_type pos2, size_type n2)
|
||||
{
|
||||
const size_t len2 = str.length ();
|
||||
const size_t len2 = _str.length ();
|
||||
|
||||
if (pos1 == 0 && n1 >= length () && pos2 == 0 && n2 >= len2)
|
||||
return operator= (str);
|
||||
return operator= (_str);
|
||||
|
||||
OUTOFRANGE (pos2 > len2);
|
||||
|
||||
if (n2 > len2 - pos2)
|
||||
n2 = len2 - pos2;
|
||||
|
||||
return replace (pos1, n1, str.data () + pos2, n2);
|
||||
return replace (pos1, n1, _str.data () + pos2, n2);
|
||||
}
|
||||
|
||||
template <class charT, class traits, class Allocator>
|
||||
|
@ -394,21 +394,21 @@ find_last_not_of (charT c, size_type pos) const
|
|||
|
||||
template <class charT, class traits, class Allocator>
|
||||
int basic_string <charT, traits, Allocator>::
|
||||
compare (const basic_string& str, size_type pos, size_type n) const
|
||||
compare (const basic_string& _str, size_type pos, size_type n) const
|
||||
{
|
||||
OUTOFRANGE (pos > length ());
|
||||
|
||||
size_t rlen = length () - pos;
|
||||
if (rlen > n)
|
||||
rlen = n;
|
||||
if (rlen > str.length ())
|
||||
rlen = str.length ();
|
||||
int r = traits::compare (data () + pos, str.data (), rlen);
|
||||
if (rlen > _str.length ())
|
||||
rlen = _str.length ();
|
||||
int r = traits::compare (data () + pos, _str.data (), rlen);
|
||||
if (r != 0)
|
||||
return r;
|
||||
if (rlen == n)
|
||||
return 0;
|
||||
return (length () - pos) - str.length ();
|
||||
return (length () - pos) - _str.length ();
|
||||
}
|
||||
|
||||
template <class charT, class traits, class Allocator>
|
||||
|
@ -476,7 +476,7 @@ getline (istream &is, basic_string <charT, traits, Allocator>& s, charT delim)
|
|||
{
|
||||
if (is.ipfx1 ())
|
||||
{
|
||||
_IO_size_t count = 0;
|
||||
_IO_size_t _count = 0;
|
||||
streambuf *sb = is.rdbuf ();
|
||||
s.resize (0);
|
||||
|
||||
|
@ -485,13 +485,13 @@ getline (istream &is, basic_string <charT, traits, Allocator>& s, charT delim)
|
|||
int ch = sb->sbumpc ();
|
||||
if (ch == EOF)
|
||||
{
|
||||
is.setstate (count == 0
|
||||
is.setstate (_count == 0
|
||||
? (ios::failbit|ios::eofbit)
|
||||
: ios::eofbit);
|
||||
break;
|
||||
}
|
||||
|
||||
++count;
|
||||
++_count;
|
||||
|
||||
if (ch == delim)
|
||||
break;
|
||||
|
@ -507,7 +507,7 @@ getline (istream &is, basic_string <charT, traits, Allocator>& s, charT delim)
|
|||
}
|
||||
|
||||
// We need to be friends with istream to do this.
|
||||
// is._gcount = count;
|
||||
// is._gcount = _count;
|
||||
is.isfx ();
|
||||
|
||||
return is;
|
||||
|
|
|
@ -169,9 +169,9 @@ public:
|
|||
}
|
||||
|
||||
explicit basic_string (): dat (nilRep.grab ()) { }
|
||||
basic_string (const basic_string& str): dat (str.rep ()->grab ()) { }
|
||||
basic_string (const basic_string& str, size_type pos, size_type n = npos)
|
||||
: dat (nilRep.grab ()) { assign (str, pos, n); }
|
||||
basic_string (const basic_string& _str): dat (_str.rep ()->grab ()) { }
|
||||
basic_string (const basic_string& _str, size_type pos, size_type n = npos)
|
||||
: dat (nilRep.grab ()) { assign (_str, pos, n); }
|
||||
basic_string (const charT* s, size_type n)
|
||||
: dat (nilRep.grab ()) { assign (s, n); }
|
||||
basic_string (const charT* s)
|
||||
|
@ -191,9 +191,9 @@ public:
|
|||
|
||||
void swap (basic_string &s) { charT *d = dat; dat = s.dat; s.dat = d; }
|
||||
|
||||
basic_string& append (const basic_string& str, size_type pos = 0,
|
||||
basic_string& append (const basic_string& _str, size_type pos = 0,
|
||||
size_type n = npos)
|
||||
{ return replace (length (), 0, str, pos, n); }
|
||||
{ return replace (length (), 0, _str, pos, n); }
|
||||
basic_string& append (const charT* s, size_type n)
|
||||
{ return replace (length (), 0, s, n); }
|
||||
basic_string& append (const charT* s)
|
||||
|
@ -346,8 +346,8 @@ public:
|
|||
size_type find (const basic_string& str, size_type pos = 0) const
|
||||
{ return find (str.data(), pos, str.length()); }
|
||||
size_type find (const charT* s, size_type pos, size_type n) const;
|
||||
size_type find (const charT* s, size_type pos = 0) const
|
||||
{ return find (s, pos, traits::length (s)); }
|
||||
size_type find (const charT* _s, size_type pos = 0) const
|
||||
{ return find (_s, pos, traits::length (_s)); }
|
||||
size_type find (charT c, size_type pos = 0) const;
|
||||
|
||||
size_type rfind (const basic_string& str, size_type pos = npos) const
|
||||
|
@ -469,36 +469,36 @@ inline basic_string <charT, traits, Allocator>
|
|||
operator+ (const basic_string <charT, traits, Allocator>& lhs,
|
||||
const basic_string <charT, traits, Allocator>& rhs)
|
||||
{
|
||||
basic_string <charT, traits, Allocator> str (lhs);
|
||||
str.append (rhs);
|
||||
return str;
|
||||
basic_string <charT, traits, Allocator> _str (lhs);
|
||||
_str.append (rhs);
|
||||
return _str;
|
||||
}
|
||||
|
||||
template <class charT, class traits, class Allocator>
|
||||
inline basic_string <charT, traits, Allocator>
|
||||
operator+ (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
|
||||
{
|
||||
basic_string <charT, traits, Allocator> str (lhs);
|
||||
str.append (rhs);
|
||||
return str;
|
||||
basic_string <charT, traits, Allocator> _str (lhs);
|
||||
_str.append (rhs);
|
||||
return _str;
|
||||
}
|
||||
|
||||
template <class charT, class traits, class Allocator>
|
||||
inline basic_string <charT, traits, Allocator>
|
||||
operator+ (charT lhs, const basic_string <charT, traits, Allocator>& rhs)
|
||||
{
|
||||
basic_string <charT, traits, Allocator> str (1, lhs);
|
||||
str.append (rhs);
|
||||
return str;
|
||||
basic_string <charT, traits, Allocator> _str (1, lhs);
|
||||
_str.append (rhs);
|
||||
return _str;
|
||||
}
|
||||
|
||||
template <class charT, class traits, class Allocator>
|
||||
inline basic_string <charT, traits, Allocator>
|
||||
operator+ (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
|
||||
{
|
||||
basic_string <charT, traits, Allocator> str (lhs);
|
||||
str.append (rhs);
|
||||
return str;
|
||||
basic_string <charT, traits, Allocator> _str (lhs);
|
||||
_str.append (rhs);
|
||||
return _str;
|
||||
}
|
||||
|
||||
template <class charT, class traits, class Allocator>
|
||||
|
|
|
@ -1014,14 +1014,14 @@ void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
|
|||
__STL_TRY {
|
||||
for (size_type __i = 0; __i < __ht._M_buckets.size(); ++__i) {
|
||||
if (const _Node* __cur = __ht._M_buckets[__i]) {
|
||||
_Node* __copy = _M_new_node(__cur->_M_val);
|
||||
_M_buckets[__i] = __copy;
|
||||
_Node* ___copy = _M_new_node(__cur->_M_val);
|
||||
_M_buckets[__i] = ___copy;
|
||||
|
||||
for (_Node* __next = __cur->_M_next;
|
||||
__next;
|
||||
__cur = __next, __next = __cur->_M_next) {
|
||||
__copy->_M_next = _M_new_node(__next->_M_val);
|
||||
__copy = __copy->_M_next;
|
||||
___copy->_M_next = _M_new_node(__next->_M_val);
|
||||
___copy = ___copy->_M_next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue