diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1995-12-21 11:09:16 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1995-12-21 11:09:16 +0000 |
commit | 710213b9eed0fd4583283236ede1559f6f3218fe (patch) | |
tree | 4cbf3792de509c14d8f1463ebafb11645ce02316 /gnu | |
parent | e8bd759fc7d3eb1b74d224c65d96ee33061be6f2 (diff) |
Make libg++ compileable with recent GCC versions. This means:
recognize changed name mangling, correct ambiguous overload resolution
and adhere to new C++ scoping rules.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/lib/libg++/g++-include/ACG.cc | 3 | ||||
-rw-r--r-- | gnu/lib/libg++/g++-include/Fix.cc | 18 | ||||
-rw-r--r-- | gnu/lib/libg++/g++-include/Fix.h | 9 | ||||
-rw-r--r-- | gnu/lib/libg++/g++-include/Fix24.h | 4 | ||||
-rw-r--r-- | gnu/lib/libg++/g++-include/Integer.cc | 3 | ||||
-rw-r--r-- | gnu/lib/libg++/g++-include/Obstack.cc | 3 | ||||
-rw-r--r-- | gnu/lib/libg++/g++-include/String.cc | 9 | ||||
-rw-r--r-- | gnu/lib/libg++/g++-include/dtoa.cc | 6 | ||||
-rw-r--r-- | gnu/lib/libg++/g++-include/error.cc | 2 |
9 files changed, 36 insertions, 21 deletions
diff --git a/gnu/lib/libg++/g++-include/ACG.cc b/gnu/lib/libg++/g++-include/ACG.cc index 27e7aa22564..fa556b25ba1 100644 --- a/gnu/lib/libg++/g++-include/ACG.cc +++ b/gnu/lib/libg++/g++-include/ACG.cc @@ -188,7 +188,8 @@ ACG::ACG(unsigned long seed, int size) // Determine the size of the state table // - for (register int l = 0; + register int l; + for (l = 0; randomStateTable[l][0] != -1 && randomStateTable[l][1] < size; l++); diff --git a/gnu/lib/libg++/g++-include/Fix.cc b/gnu/lib/libg++/g++-include/Fix.cc index 0a5bc2d793b..e4b261c3056 100644 --- a/gnu/lib/libg++/g++-include/Fix.cc +++ b/gnu/lib/libg++/g++-include/Fix.cc @@ -225,7 +225,8 @@ _Fix add(_Fix x, _Fix y, _Fix r) longer = y, shorter = x; if ( r == NULL ) r = new_Fix(longer->len); - for ( int i=r->siz-1; i >= longer->siz; i-- ) + int i; + for ( i=r->siz-1; i >= longer->siz; i-- ) r->s[i] = 0; for ( ; i >= shorter->siz; i-- ) r->s[i] = longer->s[i]; @@ -251,7 +252,8 @@ _Fix subtract(_Fix x, _Fix y, _Fix r) longer = y, shorter = x; if ( r == NULL ) r = new_Fix(longer->len); - for ( int i=r->siz-1; i >= longer->siz; i-- ) + int i; + for ( i=r->siz-1; i >= longer->siz; i-- ) r->s[i] = 0; for ( ; i >= shorter->siz; i-- ) r->s[i] = (longer == x ? x->s[i] : -y->s[i]); @@ -279,7 +281,8 @@ _Fix multiply(_Fix x, _Fix y, _Fix r) x = negate(x,X.rep); if ( ysign ) y = negate(y,Y.rep); - for ( int i=0; i < r->siz; i++ ) + int i; + for ( i=0; i < r->siz; i++ ) r->s[i] = 0; for ( i=x->siz-1; i >= 0; i-- ) { @@ -310,7 +313,8 @@ _Fix multiply(_Fix x, int y, _Fix r) (*Fix_range_error_handler)("multiply by int -- int too large"); if ( r == NULL ) r = new_Fix(x->len); - for ( int i=r->siz-1; i >= x->siz; i-- ) + int i; + for ( i=r->siz-1; i >= x->siz; i-- ) r->s[i] = 0; int32 a, carry = 0; for ( ; i > 0; i-- ) @@ -418,7 +422,8 @@ _Fix shift(_Fix x, int y, _Fix r) int xr = 16 - xl; uint16 xrmask = 0xffffL >> xr; - for ( int i=0; i < ilow; i++, rs+=u, xsl+=u, xsr+=u ) + int i; + for ( i=0; i < ilow; i++, rs+=u, xsl+=u, xsr+=u ) *rs = 0; for ( ; i < ihigh; i++, rs+=u, xsl+=u, xsr+=u ) *rs = (*xsl << xl) + ((*xsr >> xr) & xrmask); @@ -434,7 +439,8 @@ _Fix negate(_Fix x, _Fix r) if ( r == NULL ) r = new_Fix(x->len); uint32 carry = 1; - for ( int i=r->siz-1; i >= x->siz; i-- ) + int i; + for ( i=r->siz-1; i >= x->siz; i-- ) r->s[i] = 0; for ( ; i >= 0; i-- ) { diff --git a/gnu/lib/libg++/g++-include/Fix.h b/gnu/lib/libg++/g++-include/Fix.h index db1b7896183..d23dbba4f9a 100644 --- a/gnu/lib/libg++/g++-include/Fix.h +++ b/gnu/lib/libg++/g++-include/Fix.h @@ -1,7 +1,7 @@ // // Fix.h : variable length fixed point data type // -// $Id: Fix.h,v 1.1 1995/10/18 08:38:15 deraadt Exp $ +// $Id: Fix.h,v 1.2 1995/12/21 11:09:10 niklas Exp $ // #ifndef _Fix_h @@ -54,7 +54,7 @@ class Fix public: Fix(); - Fix(Fix&); + Fix(const Fix&); Fix(double); Fix(int); Fix(int, const Fix&); @@ -199,7 +199,8 @@ inline _Fix copy(const _Fix from, _Fix to) { uint16 *ts = to->s, *fs = from->s; int ilim = to->siz < from->siz ? to->siz : from->siz; - for ( int i=0; i < ilim; i++ ) + int i; + for ( i=0; i < ilim; i++ ) *ts++ = *fs++; for ( ; i < to->siz; i++ ) *ts++ = 0; @@ -229,7 +230,7 @@ inline Fix::Fix(double d) rep = new_Fix(Fix_default_length,d); } -inline Fix::Fix(Fix& y) +inline Fix::Fix(const Fix& y) { rep = y.rep; rep->ref++; } diff --git a/gnu/lib/libg++/g++-include/Fix24.h b/gnu/lib/libg++/g++-include/Fix24.h index 6de676c08eb..accf8b1147e 100644 --- a/gnu/lib/libg++/g++-include/Fix24.h +++ b/gnu/lib/libg++/g++-include/Fix24.h @@ -16,7 +16,7 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: Fix24.h,v 1.1 1995/10/18 08:38:16 deraadt Exp $ + $Id: Fix24.h,v 1.2 1995/12/21 11:09:11 niklas Exp $ */ #ifndef _Fix24_h @@ -355,7 +355,7 @@ inline Fix24 operator<<(const Fix24& a, int b) inline Fix24 operator>>(const Fix24& a, int b) { - return (a.m >> b) & 0xffffff00L; + return (a.m >> b) & (long)0xffffff00L; } inline Fix24& Fix24:: operator+=(const Fix24& f) diff --git a/gnu/lib/libg++/g++-include/Integer.cc b/gnu/lib/libg++/g++-include/Integer.cc index f4ec47e6699..4d178d2fa68 100644 --- a/gnu/lib/libg++/g++-include/Integer.cc +++ b/gnu/lib/libg++/g++-include/Integer.cc @@ -1882,7 +1882,8 @@ IntRep* gcd(const IntRep* x, const IntRep* y) long k = 0; int l = (ul <= vl)? ul : vl; int cont = 1; - for (int i = 0; i < l && cont; ++i) + int i; + for (i = 0; i < l && cont; ++i) { unsigned long a = (i < ul)? u->s[i] : 0; unsigned long b = (i < vl)? v->s[i] : 0; diff --git a/gnu/lib/libg++/g++-include/Obstack.cc b/gnu/lib/libg++/g++-include/Obstack.cc index f748eb4df83..8ffae7763e3 100644 --- a/gnu/lib/libg++/g++-include/Obstack.cc +++ b/gnu/lib/libg++/g++-include/Obstack.cc @@ -85,7 +85,8 @@ void* Obstack::finish() int Obstack::contains(void* obj) // true if obj somewhere in Obstack { - for (_obstack_chunk* ch = chunk; + _obstack_chunk* ch; + for (ch = chunk; ch != 0 && (obj < (void*)ch || obj >= (void*)(ch->limit)); ch = ch->prev); diff --git a/gnu/lib/libg++/g++-include/String.cc b/gnu/lib/libg++/g++-include/String.cc index 6e7a9f87e6c..84b36a9c9c0 100644 --- a/gnu/lib/libg++/g++-include/String.cc +++ b/gnu/lib/libg++/g++-include/String.cc @@ -965,7 +965,8 @@ String join(String src[], int n, const String& separator) return x; { String sep = separator; int xlen = 0; - for (int i = 0; i < n; ++i) + int i; + for (i = 0; i < n; ++i) xlen += src[i].length(); xlen += (n - 1) * sep.length(); @@ -1117,7 +1118,8 @@ String common_prefix(const String& x, const String& y, int startpos) return r; const char* topx = &(xchars[x.length()]); const char* ys = &(ychars[startpos]); const char* topy = &(ychars[y.length()]); - for (int l = 0; xs < topx && ys < topy && *xs++ == *ys++; ++l); + int l; + for (l = 0; xs < topx && ys < topy && *xs++ == *ys++; ++l); r.rep = Salloc(r.rep, ss, l, l); } @@ -1129,7 +1131,8 @@ String common_suffix(const String& x, const String& y, int startpos) return r; const char* botx = xchars; const char* ys = &(ychars[y.length() + startpos]); const char* boty = ychars; - for (int l = 0; xs >= botx && ys >= boty && *xs == *ys ; --xs, --ys, ++l); + int l; + for (l = 0; xs >= botx && ys >= boty && *xs == *ys ; --xs, --ys, ++l); r.rep = Salloc(r.rep, ++xs, l, l); } diff --git a/gnu/lib/libg++/g++-include/dtoa.cc b/gnu/lib/libg++/g++-include/dtoa.cc index 81d7551daae..9f28e29ffc5 100644 --- a/gnu/lib/libg++/g++-include/dtoa.cc +++ b/gnu/lib/libg++/g++-include/dtoa.cc @@ -179,7 +179,8 @@ char* dtoa(double fpnum, char cvt, int width, int prec) if (ch > '5') // properly round: unavoidable propagation { int carry = 1; - for (char* p = f - 1; p >= fwork && carry; --p) + char *p; + for (p = f - 1; p >= fwork && carry; --p) { ++*p; if (*p > '9') @@ -313,7 +314,8 @@ char* dtoa(double fpnum, char cvt, int width, int prec) char* fmtbase = (char *) _libgxx_fmtq.alloc(fmtwidth + pad + 1); char* fmt = fmtbase; - for (int i = 0; i < pad; ++i) *fmt++ = ' '; + int i; + for (i = 0; i < pad; ++i) *fmt++ = ' '; if (is_neg) *fmt++ = '-'; diff --git a/gnu/lib/libg++/g++-include/error.cc b/gnu/lib/libg++/g++-include/error.cc index fc14959c4da..d049ac7e5bb 100644 --- a/gnu/lib/libg++/g++-include/error.cc +++ b/gnu/lib/libg++/g++-include/error.cc @@ -20,7 +20,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. #endif #include <builtin.h> -extern "C" _VOLATILE_VOID abort(); +extern "C" void abort(); _VOLATILE_VOID default_one_arg_error_handler(const char* msg) { |