This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
2.95: Remove compiler warnings in libstdc++
- To: <gcc-patches at gcc dot gnu dot org>
- Subject: 2.95: Remove compiler warnings in libstdc++
- From: Bernd Schmidt <bernds at redhat dot com>
- Date: Fri, 6 Apr 2001 11:55:48 +0100 (BST)
This is from the debian patchset. I'm assuming that while this patch is
not exactly small, it's obvious and repetitive enough not to require a
copyright assignment. If someone feels otherwise, please speak up.
Bernd
Index: libstdc++/ChangeLog
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++/Attic/ChangeLog,v
retrieving revision 1.72.4.21
diff -u -p -r1.72.4.21 ChangeLog
--- ChangeLog 2001/03/16 12:52:21 1.72.4.21
+++ ChangeLog 2001/04/06 10:40:37
@@ -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.
Index: libstdc++/std/bastring.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++/std/Attic/bastring.h,v
retrieving revision 1.17.4.3
diff -u -p -r1.17.4.3 bastring.h
--- bastring.h 2000/03/12 16:36:14 1.17.4.3
+++ bastring.h 2001/04/06 10:40:38
@@ -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, Allo
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>
Index: libstdc++/std/bastring.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++/std/Attic/bastring.cc,v
retrieving revision 1.10.6.1
diff -u -p -r1.10.6.1 bastring.cc
--- bastring.cc 1999/12/15 07:42:12 1.10.6.1
+++ bastring.cc 2001/04/06 10:40:38
@@ -116,19 +116,19 @@ template <class charT, class traits, cla
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
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 <char
{
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 <char
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 <char
}
// We need to be friends with istream to do this.
- // is._gcount = count;
+ // is._gcount = _count;
is.isfx ();
return is;
Index: libstdc++/stl/stl_hashtable.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++/stl/Attic/stl_hashtable.h,v
retrieving revision 1.4
diff -u -p -r1.4 stl_hashtable.h
--- stl_hashtable.h 1998/09/02 17:24:53 1.4
+++ stl_hashtable.h 2001/04/06 10:40:38
@@ -1014,14 +1014,14 @@ void hashtable<_Val,_Key,_HF,_Ex,_Eq,_Al
__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;
}
}
}