From: Matthias Klose Date: Fri, 6 Apr 2001 10:50:50 +0000 (+0000) Subject: Remove compiler warnings. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42701f757f0e1e2673162fa97a7e5b5a0d0cfffd;p=thirdparty%2Fgcc.git Remove compiler warnings. From-SVN: r41150 --- diff --git a/libstdc++/ChangeLog b/libstdc++/ChangeLog index 02b950c48ff2..f8a71b39f709 100644 --- a/libstdc++/ChangeLog +++ b/libstdc++/ChangeLog @@ -1,3 +1,10 @@ +2001-04-06 Matthias Klose + + From : + * 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. diff --git a/libstdc++/std/bastring.cc b/libstdc++/std/bastring.cc index f86f6d30157c..c37941a0b1ad 100644 --- a/libstdc++/std/bastring.cc +++ b/libstdc++/std/bastring.cc @@ -116,19 +116,19 @@ template basic_string & basic_string :: 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 @@ -394,21 +394,21 @@ find_last_not_of (charT c, size_type pos) const template int basic_string :: -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 @@ -476,7 +476,7 @@ getline (istream &is, basic_string & 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 & 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 & s, charT delim) } // We need to be friends with istream to do this. - // is._gcount = count; + // is._gcount = _count; is.isfx (); return is; diff --git a/libstdc++/std/bastring.h b/libstdc++/std/bastring.h index bbe873085eaa..2e99d41a2f9c 100644 --- a/libstdc++/std/bastring.h +++ b/libstdc++/std/bastring.h @@ -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 operator+ (const basic_string & lhs, const basic_string & rhs) { - basic_string str (lhs); - str.append (rhs); - return str; + basic_string _str (lhs); + _str.append (rhs); + return _str; } template inline basic_string operator+ (const charT* lhs, const basic_string & rhs) { - basic_string str (lhs); - str.append (rhs); - return str; + basic_string _str (lhs); + _str.append (rhs); + return _str; } template inline basic_string operator+ (charT lhs, const basic_string & rhs) { - basic_string str (1, lhs); - str.append (rhs); - return str; + basic_string _str (1, lhs); + _str.append (rhs); + return _str; } template inline basic_string operator+ (const basic_string & lhs, const charT* rhs) { - basic_string str (lhs); - str.append (rhs); - return str; + basic_string _str (lhs); + _str.append (rhs); + return _str; } template diff --git a/libstdc++/stl/stl_hashtable.h b/libstdc++/stl/stl_hashtable.h index 78b36c1d5a04..c0354fa38e7d 100644 --- a/libstdc++/stl/stl_hashtable.h +++ b/libstdc++/stl/stl_hashtable.h @@ -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; } } }