diff options
Diffstat (limited to 'gnu/lib/libg++/include')
54 files changed, 1009 insertions, 1009 deletions
diff --git a/gnu/lib/libg++/include/ACG.h b/gnu/lib/libg++/include/ACG.h index 8093800..fc16e2a 100644 --- a/gnu/lib/libg++/include/ACG.h +++ b/gnu/lib/libg++/include/ACG.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Dirk Grunwald (grunwald@cs.uiuc.edu) @@ -16,7 +16,7 @@ License along with this library; if not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _ACG_h -#define _ACG_h 1 +#define _ACG_h 1 #include <RNG.h> #include <math.h> diff --git a/gnu/lib/libg++/include/AllocRing.h b/gnu/lib/libg++/include/AllocRing.h index 15dd161..f2f5db5 100644 --- a/gnu/lib/libg++/include/AllocRing.h +++ b/gnu/lib/libg++/include/AllocRing.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1989 Free Software Foundation written by Doug Lea (dl@rocky.oswego.edu) @@ -25,7 +25,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. /* - An AllocRing holds the last n malloc'ed strings, reallocating/reusing + An AllocRing holds the last n malloc'ed strings, reallocating/reusing one only when the queue wraps around. It thus guarantees that the last n allocations are intact. It is useful for things like I/O formatting where reasonable restrictions may be made about the diff --git a/gnu/lib/libg++/include/Binomial.h b/gnu/lib/libg++/include/Binomial.h index f88dfc3..f02730b 100644 --- a/gnu/lib/libg++/include/Binomial.h +++ b/gnu/lib/libg++/include/Binomial.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Dirk Grunwald (grunwald@cs.uiuc.edu) diff --git a/gnu/lib/libg++/include/BitSet.h b/gnu/lib/libg++/include/BitSet.h index ca1d96f..c80e327 100644 --- a/gnu/lib/libg++/include/BitSet.h +++ b/gnu/lib/libg++/include/BitSet.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Doug Lea (dl@rocky.oswego.edu) @@ -36,11 +36,11 @@ struct BitSetRep unsigned short s[1]; // bits start here }; -extern BitSetRep* BitSetalloc(BitSetRep*, const unsigned short*, +extern BitSetRep* BitSetalloc(BitSetRep*, const unsigned short*, int, int, int); extern BitSetRep* BitSetcopy(BitSetRep*, const BitSetRep*); extern BitSetRep* BitSetresize(BitSetRep*, int); -extern BitSetRep* BitSetop(const BitSetRep*, const BitSetRep*, +extern BitSetRep* BitSetop(const BitSetRep*, const BitSetRep*, BitSetRep*, char); extern BitSetRep* BitSetcmpl(const BitSetRep*, BitSetRep*); @@ -69,7 +69,7 @@ class BitSet protected: BitSetRep* rep; - + public: // constructors @@ -116,7 +116,7 @@ public: int test(int from, int to) const; BitSetBit operator [] (int i); - + // iterators int first(int b = 1) const; @@ -132,13 +132,13 @@ public: int empty() const; int virtual_bit() const; int count(int b = 1) const; - + // convertors & IO - friend BitSet atoBitSet(const char* s, + friend BitSet atoBitSet(const char* s, char f='0', char t='1', char star='*'); // BitSettoa is deprecated; do not use in new programs. - friend const char* BitSettoa(const BitSet& x, + friend const char* BitSettoa(const BitSet& x, char f='0', char t='1', char star='*'); friend BitSet shorttoBitSet(unsigned short w); @@ -193,7 +193,7 @@ inline BitSet::BitSet(const BitSet& x) :rep(BitSetcopy(0, x.rep)) {} inline BitSet::~BitSet() { if (rep != &_nilBitSetRep) delete rep; } inline BitSet& BitSet::operator = (const BitSet& y) -{ +{ rep = BitSetcopy(rep, y.rep); return *this; } @@ -258,27 +258,27 @@ inline BitSet operator ~ (const BitSet& x) return r #else /* NO_NRV */ -inline BitSet operator & (const BitSet& x, const BitSet& y) +inline BitSet operator & (const BitSet& x, const BitSet& y) { BitSet r; and(x, y, r); return r; } -inline BitSet operator | (const BitSet& x, const BitSet& y) +inline BitSet operator | (const BitSet& x, const BitSet& y) { BitSet r; or(x, y, r); return r; } -inline BitSet operator ^ (const BitSet& x, const BitSet& y) +inline BitSet operator ^ (const BitSet& x, const BitSet& y) { BitSet r; xor(x, y, r); return r; } -inline BitSet operator - (const BitSet& x, const BitSet& y) +inline BitSet operator - (const BitSet& x, const BitSet& y) { BitSet r; diff(x, y, r); return r; } -inline BitSet operator ~ (const BitSet& x) +inline BitSet operator ~ (const BitSet& x) { BitSet r; ::complement(x, r); return r; } @@ -329,7 +329,7 @@ inline int BitSet::test(int p) const { if (p < 0) error("Illegal bit index"); int index = BitSet_index(p); - return (index >= rep->len)? rep->virt : + return (index >= rep->len)? rep->virt : ((rep->s[index] & (1 << BitSet_pos(p))) != 0); } diff --git a/gnu/lib/libg++/include/BitString.h b/gnu/lib/libg++/include/BitString.h index b2b92b1..f30b440 100644 --- a/gnu/lib/libg++/include/BitString.h +++ b/gnu/lib/libg++/include/BitString.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Doug Lea (dl@rocky.oswego.edu) @@ -138,7 +138,7 @@ public: friend void complement(const BitString&, BitString&); - friend int lcompare(const BitString&, const BitString&); + friend int lcompare(const BitString&, const BitString&); // assignment-based operators // (constuctive versions decalred inline below @@ -162,7 +162,7 @@ public: void clear(int pos); void clear(int from, int to); - void clear(); + void clear(); void invert(int pos); void invert(int from, int to); @@ -188,7 +188,7 @@ public: // searching & matching - int index(unsigned int bit, int startpos = 0) const ; + int index(unsigned int bit, int startpos = 0) const ; int index(const BitString&, int startpos = 0) const; int index(const BitSubString&, int startpos = 0) const; int index(const BitPattern&, int startpos = 0) const; @@ -208,9 +208,9 @@ public: // BitSubString extraction BitSubString at(int pos, int len); - BitSubString at(const BitString&, int startpos = 0); - BitSubString at(const BitSubString&, int startpos = 0); - BitSubString at(const BitPattern&, int startpos = 0); + BitSubString at(const BitString&, int startpos = 0); + BitSubString at(const BitSubString&, int startpos = 0); + BitSubString at(const BitPattern&, int startpos = 0); BitSubString before(int pos); BitSubString before(const BitString&, int startpos = 0); @@ -224,9 +224,9 @@ public: // other friends & utilities - friend BitString common_prefix(const BitString&, const BitString&, + friend BitString common_prefix(const BitString&, const BitString&, int pos = 0); - friend BitString common_suffix(const BitString&, const BitString&, + friend BitString common_suffix(const BitString&, const BitString&, int pos = -1); friend BitString reverse(const BitString&); @@ -259,7 +259,7 @@ public: friend BitPattern atoBitPattern(const char* s, char f='0',char t='1',char x='X'); - friend const char* BitPatterntoa(const BitPattern& p, + friend const char* BitPatterntoa(const BitPattern& p, char f='0',char t='1',char x='X'); int OK() const; }; @@ -277,7 +277,7 @@ public: ~BitPattern(); - friend const char* BitPatterntoa(const BitPattern& p, + friend const char* BitPatterntoa(const BitPattern& p, char f/*='0'*/,char t/*='1'*/,char x/*='X'*/); void printon(ostream&, char f='0',char t='1',char x='X') const; friend BitPattern atoBitPattern(const char* s, char f,char t, char x); @@ -320,16 +320,16 @@ inline BitString::BitString() :rep(&_nilBitStrRep) {} inline BitString::BitString(const BitString& x) :rep(BStr_copy(0, x.rep)) {} -inline BitString::BitString(const BitSubString& y) +inline BitString::BitString(const BitSubString& y) :rep (BStr_alloc(0, y.S.rep->s, y.pos, y.pos+y.len, y.len)) {} inline BitString::~BitString() -{ +{ if (rep != &_nilBitStrRep) delete rep; } -inline BitString shorttoBitString(unsigned short w) -{ +inline BitString shorttoBitString(unsigned short w) +{ BitString r; _BS_word ww = w; #if _BS_BIGENDIAN @@ -339,8 +339,8 @@ inline BitString shorttoBitString(unsigned short w) return r; } -inline BitString longtoBitString(unsigned long w) -{ +inline BitString longtoBitString(unsigned long w) +{ BitString r; #if 1 _BS_word u = w; @@ -355,13 +355,13 @@ inline BitString longtoBitString(unsigned long w) } inline BitString& BitString::operator = (const BitString& y) -{ +{ rep = BStr_copy(rep, y.rep); return *this; } inline BitString& BitString::operator = (unsigned int b) -{ +{ _BS_word bit = b; rep = BStr_alloc(rep, &bit, 0, 1, 1); return *this; @@ -373,7 +373,7 @@ inline BitString& BitString::operator=(const BitSubString& y) return *this; } -inline BitSubString::BitSubString(const BitSubString& x) +inline BitSubString::BitSubString(const BitSubString& x) :S(x.S), pos(x.pos), len(x.len) {} inline BitSubString::BitSubString(BitString& x, int p, int l) @@ -544,47 +544,47 @@ inline BitString operator ~ (const BitString& x) return r #else /* NO_NRV */ -inline BitString operator & (const BitString& x, const BitString& y) +inline BitString operator & (const BitString& x, const BitString& y) { BitString r; and(x, y, r); return r; } -inline BitString operator | (const BitString& x, const BitString& y) +inline BitString operator | (const BitString& x, const BitString& y) { BitString r; or(x, y, r); return r; } -inline BitString operator ^ (const BitString& x, const BitString& y) +inline BitString operator ^ (const BitString& x, const BitString& y) { BitString r; xor(x, y, r); return r; } -inline BitString operator << (const BitString& x, int y) +inline BitString operator << (const BitString& x, int y) { BitString r; lshift(x, y, r); return r; } -inline BitString operator >> (const BitString& x, int y) +inline BitString operator >> (const BitString& x, int y) { BitString r; rshift(x, y, r); return r; } -inline BitString operator - (const BitString& x, const BitString& y) +inline BitString operator - (const BitString& x, const BitString& y) { BitString r; diff(x, y, r); return r; } -inline BitString operator + (const BitString& x, const BitString& y) +inline BitString operator + (const BitString& x, const BitString& y) { BitString r; cat(x, y, r); return r; } -inline BitString operator + (const BitString& x, unsigned int y) +inline BitString operator + (const BitString& x, unsigned int y) { BitString r; cat(x, y, r); return r; } -inline BitString operator ~ (const BitString& x) +inline BitString operator ~ (const BitString& x) { BitString r; complement(x, r); return r; } @@ -594,32 +594,32 @@ inline BitString operator ~ (const BitString& x) // status, matching inline int BitString::length() const -{ +{ return rep->len; } inline int BitString::empty() const -{ +{ return rep->len == 0; } inline int BitString::index(const BitString& y, int startpos) const -{ +{ return search(startpos, rep->len, y.rep->s, 0, y.rep->len); } inline int BitString::index(const BitSubString& y, int startpos) const -{ +{ return search(startpos, rep->len, y.S.rep->s, y.pos, y.pos+y.len); } inline int BitString::contains(const BitString& y) const -{ +{ return search(0, rep->len, y.rep->s, 0, y.rep->len) >= 0; } inline int BitString::contains(const BitSubString& y) const -{ +{ return search(0, rep->len, y.S.rep->s, y.pos, y.pos+y.len) >= 0; } @@ -664,12 +664,12 @@ inline int BitString::index(const BitPattern& r, int startpos) const } inline int BitSubString::length() const -{ +{ return len; } inline int BitSubString::empty() const -{ +{ return len == 0; } @@ -706,7 +706,7 @@ inline int BitString::index(unsigned int bit, int startpos) const return prev(rep->len + startpos + 1, bit); } -inline void BitString::right_trim(unsigned int b) +inline void BitString::right_trim(unsigned int b) { int nb = (b == 0)? 1 : 0; rep = BStr_resize(rep, prev(rep->len, nb) + 1); @@ -721,7 +721,7 @@ inline void BitString::left_trim(unsigned int b) inline int BitString::test(int i) const { - return ((unsigned)(i) >= rep->len)? 0 : + return ((unsigned)(i) >= rep->len)? 0 : ((rep->s[BitStr_index(i)] & (1 << (BitStr_pos(i)))) != 0); } @@ -754,7 +754,7 @@ inline BitSubString BitString::_substr(int first, int l) { if (first < 0 || l <= 0 || (unsigned)(first + l) > rep->len) return BitSubString(_nil_BitString, 0, 0) ; - else + else return BitSubString(*this, first, l); } diff --git a/gnu/lib/libg++/include/Complex.h b/gnu/lib/libg++/include/Complex.h index 9b7e378..128227bc 100644 --- a/gnu/lib/libg++/include/Complex.h +++ b/gnu/lib/libg++/include/Complex.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Doug Lea (dl@rocky.oswego.edu) @@ -57,8 +57,8 @@ public: Complex& operator *= (const Complex& y); Complex& operator *= (double y); - Complex& operator /= (const Complex& y); - Complex& operator /= (double y); + Complex& operator /= (const Complex& y); + Complex& operator /= (double y); void error(const char* msg) const; }; @@ -83,7 +83,7 @@ Complex pow(const Complex& x, int p); Complex pow(const Complex& x, const Complex& p); Complex pow(const Complex& x, double y); Complex sqrt(const Complex& x); - + istream& operator >> (istream& s, Complex& x); ostream& operator << (ostream& s, const Complex& x); @@ -99,42 +99,42 @@ inline Complex::Complex(double r, double i) :re(r), im(i) {} inline Complex::~Complex() {} -inline Complex& Complex::operator = (const Complex& y) -{ - re = y.real(); im = y.imag(); return *this; -} +inline Complex& Complex::operator = (const Complex& y) +{ + re = y.real(); im = y.imag(); return *this; +} inline Complex& Complex::operator += (const Complex& y) -{ - re += y.real(); im += y.imag(); return *this; +{ + re += y.real(); im += y.imag(); return *this; } inline Complex& Complex::operator += (double y) -{ - re += y; return *this; +{ + re += y; return *this; } inline Complex& Complex::operator -= (const Complex& y) -{ - re -= y.real(); im -= y.imag(); return *this; +{ + re -= y.real(); im -= y.imag(); return *this; } inline Complex& Complex::operator -= (double y) -{ - re -= y; return *this; +{ + re -= y; return *this; } inline Complex& Complex::operator *= (const Complex& y) -{ +{ double r = re * y.real() - im * y.imag(); - im = re * y.imag() + im * y.real(); - re = r; - return *this; + im = re * y.imag() + im * y.real(); + re = r; + return *this; } inline Complex& Complex::operator *= (double y) -{ - re *= y; im *= y; return *this; +{ + re *= y; im *= y; return *this; } @@ -202,7 +202,7 @@ inline Complex operator - (double x, const Complex& y) inline Complex operator * (const Complex& x, const Complex& y) { - return Complex(x.real() * y.real() - x.imag() * y.imag(), + return Complex(x.real() * y.real() - x.imag() * y.imag(), x.real() * y.imag() + x.imag() * y.real()); } diff --git a/gnu/lib/libg++/include/CursesW.h b/gnu/lib/libg++/include/CursesW.h index 1df2e8a..8ac6f3c 100644 --- a/gnu/lib/libg++/include/CursesW.h +++ b/gnu/lib/libg++/include/CursesW.h @@ -1,6 +1,6 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1989 Free Software Foundation written by Eric Newton (newton@rocky.oswego.edu) @@ -237,7 +237,7 @@ inline int (mvinsch)(int y, int x, char c) * */ -class CursesWindow +class CursesWindow { protected: static int count; // count of all active windows: @@ -385,102 +385,102 @@ inline int CursesWindow::width() return maxx() - begx() + 1; } -inline int CursesWindow::box(char vert, char hor) +inline int CursesWindow::box(char vert, char hor) { - return ::box(w, vert, hor); + return ::box(w, vert, hor); } -inline int CursesWindow::overlay(CursesWindow &win) +inline int CursesWindow::overlay(CursesWindow &win) { - return ::overlay(w, win.w); + return ::overlay(w, win.w); } -inline int CursesWindow::overwrite(CursesWindow &win) +inline int CursesWindow::overwrite(CursesWindow &win) { - return ::overwrite(w, win.w); + return ::overwrite(w, win.w); } -inline int CursesWindow::scroll() +inline int CursesWindow::scroll() { - return ::scroll(w); + return ::scroll(w); } -inline int CursesWindow::touchwin() +inline int CursesWindow::touchwin() { - return ::touchwin(w); + return ::touchwin(w); } -inline int CursesWindow::addch(const char ch) +inline int CursesWindow::addch(const char ch) { - return ::waddch(w, ch); + return ::waddch(w, ch); } -inline int CursesWindow::addstr(const char * str) +inline int CursesWindow::addstr(const char * str) { // The (char*) cast is to hack around prototypes in curses.h that // have const missing in the parameter lists. [E.g. SVR4] - return ::waddstr(w, (char*)str); + return ::waddstr(w, (char*)str); } -inline int CursesWindow::clear() +inline int CursesWindow::clear() { - return ::wclear(w); + return ::wclear(w); } -inline int CursesWindow::clrtobot() +inline int CursesWindow::clrtobot() { - return ::wclrtobot(w); + return ::wclrtobot(w); } -inline int CursesWindow::clrtoeol() +inline int CursesWindow::clrtoeol() { - return ::wclrtoeol(w); + return ::wclrtoeol(w); } -inline int CursesWindow::delch() +inline int CursesWindow::delch() { - return ::wdelch(w); + return ::wdelch(w); } -inline int CursesWindow::deleteln() +inline int CursesWindow::deleteln() { - return ::wdeleteln(w); + return ::wdeleteln(w); } -inline int CursesWindow::erase() +inline int CursesWindow::erase() { - return ::werase(w); + return ::werase(w); } -inline int CursesWindow::getch() +inline int CursesWindow::getch() { - return ::wgetch(w); + return ::wgetch(w); } -inline int CursesWindow::getstr(char * str) +inline int CursesWindow::getstr(char * str) { - return ::wgetstr(w, str); + return ::wgetstr(w, str); } -inline int CursesWindow::inch() +inline int CursesWindow::inch() { - return winch(w); + return winch(w); } -inline int CursesWindow::insch(char c) +inline int CursesWindow::insch(char c) { - return ::winsch(w, c); + return ::winsch(w, c); } -inline int CursesWindow::insertln() +inline int CursesWindow::insertln() { - return ::winsertln(w); + return ::winsertln(w); } -inline int CursesWindow::move(int y, int x) +inline int CursesWindow::move(int y, int x) { - return ::wmove(w, y, x); + return ::wmove(w, y, x); } @@ -524,56 +524,56 @@ inline int CursesWindow::mvinsch(int y, int x, char ch) return (::wmove(w, y, x)==ERR) ? ERR : ::winsch(w, ch); } -inline int CursesWindow::refresh() +inline int CursesWindow::refresh() { - return ::wrefresh(w); + return ::wrefresh(w); } -inline int CursesWindow::clearok(int bf) +inline int CursesWindow::clearok(int bf) { - return ::clearok(w,bf); + return ::clearok(w,bf); } -inline int CursesWindow::leaveok(int bf) +inline int CursesWindow::leaveok(int bf) { - return ::leaveok(w,bf); + return ::leaveok(w,bf); } -inline int CursesWindow::scrollok(int bf) +inline int CursesWindow::scrollok(int bf) { - return ::scrollok(w,bf); + return ::scrollok(w,bf); } #ifndef _no_flushok -inline int CursesWindow::flushok(int bf) +inline int CursesWindow::flushok(int bf) { - return ::flushok(w, bf); + return ::flushok(w, bf); } #endif -inline void CursesWindow::getyx(int& y, int& x) +inline void CursesWindow::getyx(int& y, int& x) { - ::getyx(w, y, x); + ::getyx(w, y, x); } -inline int CursesWindow::standout() +inline int CursesWindow::standout() { - return ::wstandout(w); + return ::wstandout(w); } -inline int CursesWindow::standend() +inline int CursesWindow::standend() { - return ::wstandend(w); + return ::wstandend(w); } -inline int CursesWindow::lines() +inline int CursesWindow::lines() { - return LINES; + return LINES; } -inline int CursesWindow::cols() +inline int CursesWindow::cols() { - return COLS; + return COLS; } inline CursesWindow* CursesWindow::child() diff --git a/gnu/lib/libg++/include/DLList.h b/gnu/lib/libg++/include/DLList.h index 36f73bc..ba7ee86 100644 --- a/gnu/lib/libg++/include/DLList.h +++ b/gnu/lib/libg++/include/DLList.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Doug Lea (dl@rocky.oswego.edu) diff --git a/gnu/lib/libg++/include/DiscUnif.h b/gnu/lib/libg++/include/DiscUnif.h index 5f26f90..0cd6a0f 100644 --- a/gnu/lib/libg++/include/DiscUnif.h +++ b/gnu/lib/libg++/include/DiscUnif.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Dirk Grunwald (grunwald@cs.uiuc.edu) @@ -25,7 +25,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. // // The interval [lo..hi) -// +// class DiscreteUniform: public Random { long pLow; diff --git a/gnu/lib/libg++/include/Erlang.h b/gnu/lib/libg++/include/Erlang.h index 9809388..18838fc 100644 --- a/gnu/lib/libg++/include/Erlang.h +++ b/gnu/lib/libg++/include/Erlang.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Dirk Grunwald (grunwald@cs.uiuc.edu) @@ -19,7 +19,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. #ifdef __GNUG__ #pragma interface #endif -#define _Erlang_h 1 +#define _Erlang_h 1 #include <Random.h> diff --git a/gnu/lib/libg++/include/Fix.h b/gnu/lib/libg++/include/Fix.h index df76c94..fab91b8 100644 --- a/gnu/lib/libg++/include/Fix.h +++ b/gnu/lib/libg++/include/Fix.h @@ -1,5 +1,5 @@ // -*- C++ -*- -// Fix.h : variable length fixed point data type +// Fix.h : variable length fixed point data type // #ifndef _Fix_h @@ -124,7 +124,7 @@ public: friend char* Ftoa(const Fix&, int width = default_print_width); void printon(ostream&, int width = default_print_width) const; friend Fix atoF(const char*, int len = default_length); - + friend istream& operator >> (istream&, Fix&); friend ostream& operator << (ostream&, const Fix&); @@ -184,7 +184,7 @@ Fix::mask (Fix::Rep* x) { int n = x->len & 0x0f; if ( n ) - x->s[x->siz - 1] &= 0xffff0000 >> n; + x->s[x->siz - 1] &= 0xffff0000 >> n; } inline Fix::Rep* @@ -269,7 +269,7 @@ Fix::operator = (const Fix& y) if ( rep->len == y.rep->len ) { ++y.rep->ref; if ( --rep->ref <= 0 ) delete rep; - rep = y.rep; + rep = y.rep; } else { unique(); @@ -290,37 +290,37 @@ Fix::operator = (double d) inline int operator == (const Fix& x, const Fix& y) { - return Fix::compare(x.rep, y.rep) == 0; + return Fix::compare(x.rep, y.rep) == 0; } inline int operator != (const Fix& x, const Fix& y) { - return Fix::compare(x.rep, y.rep) != 0; + return Fix::compare(x.rep, y.rep) != 0; } inline int operator < (const Fix& x, const Fix& y) { - return Fix::compare(x.rep, y.rep) < 0; + return Fix::compare(x.rep, y.rep) < 0; } inline int operator <= (const Fix& x, const Fix& y) { - return Fix::compare(x.rep, y.rep) <= 0; + return Fix::compare(x.rep, y.rep) <= 0; } inline int operator > (const Fix& x, const Fix& y) { - return Fix::compare(x.rep, y.rep) > 0; + return Fix::compare(x.rep, y.rep) > 0; } inline int operator >= (const Fix& x, const Fix& y) { - return Fix::compare(x.rep, y.rep) >= 0; + return Fix::compare(x.rep, y.rep) >= 0; } inline Fix& @@ -415,7 +415,7 @@ operator << (const Fix& x, int y) inline Fix operator >> (const Fix& x, int y) -{ +{ Fix::Rep* rep = Fix::shift(x.rep, -y); return rep; } diff --git a/gnu/lib/libg++/include/Fix16.h b/gnu/lib/libg++/include/Fix16.h index e598113..2ab2209 100644 --- a/gnu/lib/libg++/include/Fix16.h +++ b/gnu/lib/libg++/include/Fix16.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Kurt Baudendistel (gt-eedsp!baud@gatech.edu) adapted for libg++ by Doug Lea (dl@rocky.oswego.edu) @@ -58,8 +58,8 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. // consists of a 16-bit mantissa (sign bit & 15 data bits). // -class Fix16 -{ +class Fix16 +{ friend class Fix32; short m; @@ -102,7 +102,7 @@ public: Fix16& operator -= (const Fix16& f); Fix16& operator *= (const Fix16& ); Fix16& operator /= (const Fix16& f); - + Fix16& operator <<=(int b); Fix16& operator >>=(int b); @@ -124,15 +124,15 @@ public: Fix16& operator *= (int g); }; - + // // Fix32 class: 32-bit Fixed point data type // // consists of a 32-bit mantissa (sign bit & 31 data bits). // -class Fix32 -{ +class Fix32 +{ friend class Fix16; _G_int32_t m; @@ -241,141 +241,141 @@ extern void inline Fix16::~Fix16() {} inline short Fix16::round(double d) -{ - return short( (d >= 0)? d + 0.5 : d - 0.5); +{ + return short( (d >= 0)? d + 0.5 : d - 0.5); } -inline Fix16::Fix16(short i) -{ - m = i; +inline Fix16::Fix16(short i) +{ + m = i; } -inline Fix16::Fix16(int i) -{ - m = i; +inline Fix16::Fix16(int i) +{ + m = i; } -inline Fix16::operator double() const -{ - return Fix16_div * m; +inline Fix16::operator double() const +{ + return Fix16_div * m; } -inline Fix16::Fix16() -{ - m = 0; +inline Fix16::Fix16() +{ + m = 0; } -inline Fix16::Fix16(const Fix16& f) -{ - m = f.m; +inline Fix16::Fix16(const Fix16& f) +{ + m = f.m; } -inline Fix16::Fix16(double d) +inline Fix16::Fix16(double d) { m = assign(d); } -inline Fix16& Fix16::operator=(const Fix16& f) -{ - m = f.m; - return *this; +inline Fix16& Fix16::operator=(const Fix16& f) +{ + m = f.m; + return *this; } -inline Fix16& Fix16::operator=(double d) -{ - m = assign(d); - return *this; +inline Fix16& Fix16::operator=(double d) +{ + m = assign(d); + return *this; } -inline Fix32::Fix32() -{ +inline Fix32::Fix32() +{ m = 0; } -inline Fix32::Fix32(_G_int32_t i) -{ +inline Fix32::Fix32(_G_int32_t i) +{ m = i; } -inline Fix32:: operator double() const -{ +inline Fix32:: operator double() const +{ return Fix32_div * m; } -inline Fix32::Fix32(const Fix32& f) -{ +inline Fix32::Fix32(const Fix32& f) +{ m = f.m; } -inline Fix32::Fix32(const Fix16& f) -{ +inline Fix32::Fix32(const Fix16& f) +{ m = _G_int32_t(f.m) << 16; } -inline Fix32::Fix32(double d) -{ +inline Fix32::Fix32(double d) +{ m = assign(d); } -inline Fix16::Fix16(const Fix32& f) -{ - m = f.m >> 16; +inline Fix16::Fix16(const Fix32& f) +{ + m = f.m >> 16; } inline Fix16& Fix16::operator=(const Fix32& f) -{ - m = f.m >> 16; - return *this; +{ + m = f.m >> 16; + return *this; } -inline Fix32& Fix32::operator=(const Fix32& f) -{ +inline Fix32& Fix32::operator=(const Fix32& f) +{ m = f.m; - return *this; + return *this; } -inline Fix32& Fix32::operator=(const Fix16& f) -{ +inline Fix32& Fix32::operator=(const Fix16& f) +{ m = _G_int32_t(f.m) << 16; return *this; } -inline Fix32& Fix32::operator=(double d) -{ +inline Fix32& Fix32::operator=(double d) +{ m = assign(d); - return *this; + return *this; } -inline short& mantissa(Fix16& f) -{ - return f.m; +inline short& mantissa(Fix16& f) +{ + return f.m; } -inline const short& mantissa(const Fix16& f) -{ - return f.m; +inline const short& mantissa(const Fix16& f) +{ + return f.m; } -inline double value(const Fix16& f) -{ - return double(f); +inline double value(const Fix16& f) +{ + return double(f); } -inline Fix16 Fix16::operator+() const -{ - return m; +inline Fix16 Fix16::operator+() const +{ + return m; } -inline Fix16 Fix16::operator-() const -{ - return -m; +inline Fix16 Fix16::operator-() const +{ + return -m; } -inline Fix16 operator+(const Fix16& f, const Fix16& g) +inline Fix16 operator+(const Fix16& f, const Fix16& g) { short sum = f.m + g.m; if ( (f.m ^ sum) & (g.m ^ sum) & Fix16_msb ) @@ -383,7 +383,7 @@ inline Fix16 operator+(const Fix16& f, const Fix16& g) return sum; } -inline Fix16 operator-(const Fix16& f, const Fix16& g) +inline Fix16 operator-(const Fix16& f, const Fix16& g) { short sum = f.m - g.m; if ( (f.m ^ sum) & (-g.m ^ sum) & Fix16_msb ) @@ -392,90 +392,90 @@ inline Fix16 operator-(const Fix16& f, const Fix16& g) } inline Fix32 operator*(const Fix16& f, const Fix16& g) -{ - return Fix32( _G_int32_t( _G_int32_t(f.m) * _G_int32_t(g.m) << 1)); +{ + return Fix32( _G_int32_t( _G_int32_t(f.m) * _G_int32_t(g.m) << 1)); } -inline Fix16 operator<<(const Fix16& a, int b) -{ - return a.m << b; +inline Fix16 operator<<(const Fix16& a, int b) +{ + return a.m << b; } -inline Fix16 operator>>(const Fix16& a, int b) -{ - return a.m >> b; +inline Fix16 operator>>(const Fix16& a, int b) +{ + return a.m >> b; } inline Fix16& Fix16:: operator+=(const Fix16& f) -{ - return *this = *this + f; +{ + return *this = *this + f; } -inline Fix16& Fix16:: operator-=(const Fix16& f) -{ - return *this = *this - f; +inline Fix16& Fix16:: operator-=(const Fix16& f) +{ + return *this = *this - f; } -inline Fix16& Fix16::operator*=(const Fix16& f) -{ - return *this = *this * f; +inline Fix16& Fix16::operator*=(const Fix16& f) +{ + return *this = *this * f; } -inline Fix16& Fix16:: operator/=(const Fix16& f) -{ - return *this = *this / f; +inline Fix16& Fix16:: operator/=(const Fix16& f) +{ + return *this = *this / f; } -inline Fix16& Fix16:: operator<<=(int b) -{ +inline Fix16& Fix16:: operator<<=(int b) +{ return *this = *this << b; } -inline Fix16& Fix16:: operator>>=(int b) -{ +inline Fix16& Fix16:: operator>>=(int b) +{ return *this = *this >> b; } -inline int operator==(const Fix16& f, const Fix16& g) -{ +inline int operator==(const Fix16& f, const Fix16& g) +{ return f.m == g.m; } -inline int operator!=(const Fix16& f, const Fix16& g) -{ +inline int operator!=(const Fix16& f, const Fix16& g) +{ return f.m != g.m; } -inline int operator>=(const Fix16& f, const Fix16& g) -{ +inline int operator>=(const Fix16& f, const Fix16& g) +{ return f.m >= g.m; } -inline int operator<=(const Fix16& f, const Fix16& g) -{ +inline int operator<=(const Fix16& f, const Fix16& g) +{ return f.m <= g.m; } -inline int operator>(const Fix16& f, const Fix16& g) -{ +inline int operator>(const Fix16& f, const Fix16& g) +{ return f.m > g.m; } -inline int operator<(const Fix16& f, const Fix16& g) -{ +inline int operator<(const Fix16& f, const Fix16& g) +{ return f.m < g.m; } inline istream& operator>>(istream& s, Fix16& f) -{ +{ double d; - s >> d; - f = d; - return s; + s >> d; + f = d; + return s; } inline ostream& operator<<(ostream& s, const Fix16& f) -{ +{ return s << double(f); } @@ -499,36 +499,36 @@ inline Fix16& Fix16::operator*=(int g) inline Fix32::~Fix32() {} inline _G_int32_t Fix32::round(double d) -{ +{ return _G_int32_t( (d >= 0)? d + 0.5 : d - 0.5); } -inline _G_int32_t& mantissa(Fix32& f) -{ +inline _G_int32_t& mantissa(Fix32& f) +{ return f.m; } -inline const _G_int32_t& mantissa(const Fix32& f) -{ +inline const _G_int32_t& mantissa(const Fix32& f) +{ return f.m; } -inline double value(const Fix32& f) -{ +inline double value(const Fix32& f) +{ return double(f); } inline Fix32 Fix32::operator+() const -{ +{ return m; } -inline Fix32 Fix32::operator-() const -{ +inline Fix32 Fix32::operator-() const +{ return -m; } -inline Fix32 operator+(const Fix32& f, const Fix32& g) +inline Fix32 operator+(const Fix32& f, const Fix32& g) { _G_int32_t sum = f.m + g.m; if ( (f.m ^ sum) & (g.m ^ sum) & Fix32_msb ) @@ -536,7 +536,7 @@ inline Fix32 operator+(const Fix32& f, const Fix32& g) return sum; } -inline Fix32 operator-(const Fix32& f, const Fix32& g) +inline Fix32 operator-(const Fix32& f, const Fix32& g) { _G_int32_t sum = f.m - g.m; if ( (f.m ^ sum) & (-g.m ^ sum) & Fix32_msb ) @@ -544,87 +544,87 @@ inline Fix32 operator-(const Fix32& f, const Fix32& g) return sum; } -inline Fix32 operator<<(const Fix32& a, int b) -{ +inline Fix32 operator<<(const Fix32& a, int b) +{ return a.m << b; } -inline Fix32 operator>>(const Fix32& a, int b) -{ +inline Fix32 operator>>(const Fix32& a, int b) +{ return a.m >> b; } -inline Fix32& Fix32::operator+=(const Fix32& f) -{ +inline Fix32& Fix32::operator+=(const Fix32& f) +{ return *this = *this + f; } -inline Fix32& Fix32::operator-=(const Fix32& f) -{ +inline Fix32& Fix32::operator-=(const Fix32& f) +{ return *this = *this - f; } -inline Fix32& Fix32::operator*=(const Fix32& f) -{ +inline Fix32& Fix32::operator*=(const Fix32& f) +{ return *this = *this * f; } -inline Fix32& Fix32::operator/=(const Fix32& f) -{ +inline Fix32& Fix32::operator/=(const Fix32& f) +{ return *this = *this / f; } -inline Fix32& Fix32::operator<<=(int b) -{ +inline Fix32& Fix32::operator<<=(int b) +{ return *this = *this << b; } -inline Fix32& Fix32::operator>>=(int b) -{ +inline Fix32& Fix32::operator>>=(int b) +{ return *this = *this >> b; } -inline int operator==(const Fix32& f, const Fix32& g) -{ +inline int operator==(const Fix32& f, const Fix32& g) +{ return f.m == g.m; } -inline int operator!=(const Fix32& f, const Fix32& g) -{ +inline int operator!=(const Fix32& f, const Fix32& g) +{ return f.m != g.m; } -inline int operator>=(const Fix32& f, const Fix32& g) -{ +inline int operator>=(const Fix32& f, const Fix32& g) +{ return f.m >= g.m; } -inline int operator<=(const Fix32& f, const Fix32& g) -{ +inline int operator<=(const Fix32& f, const Fix32& g) +{ return f.m <= g.m; } -inline int operator>(const Fix32& f, const Fix32& g) -{ +inline int operator>(const Fix32& f, const Fix32& g) +{ return f.m > g.m; } -inline int operator<(const Fix32& f, const Fix32& g) -{ +inline int operator<(const Fix32& f, const Fix32& g) +{ return f.m < g.m; } inline istream& operator>>(istream& s, Fix32& f) -{ +{ double d; - s >> d; - f = d; - return s; + s >> d; + f = d; + return s; } inline ostream& operator<<(ostream& s, const Fix32& f) -{ +{ return s << double(f); } diff --git a/gnu/lib/libg++/include/Fix24.h b/gnu/lib/libg++/include/Fix24.h index 5db346e..0f4daea 100644 --- a/gnu/lib/libg++/include/Fix24.h +++ b/gnu/lib/libg++/include/Fix24.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Kurt Baudendistel (gt-eedsp!baud@gatech.edu) adapted for libg++ by Doug Lea (dl@rocky.oswego.edu) @@ -26,7 +26,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. #include <stream.h> #include <std.h> -// extra type definitions +// extra type definitions typedef struct { _G_int32_t u; @@ -37,14 +37,14 @@ typedef struct { static const int Fix24_shift = 31; - + static const double Fix24_fs = 2147483648., // 2^Fix24_shift Fix24_mult = Fix24_fs, Fix24_div = 1./Fix24_fs, Fix24_max = 1. - .5/Fix24_fs, Fix24_min = -1.; - + static const _G_uint32_t Fix24_msb = 0x80000000L, Fix24_lsb = 0x00000100L, @@ -57,21 +57,21 @@ static const double Fix48_min = -1., Fix48_div_u = 1./Fix24_fs, Fix48_div_l = 1./Fix48_fs; - + static const twolongs Fix48_msb = { 0x80000000L, 0L }, Fix48_lsb = { 0L, 0x00000100L }, Fix48_m_max = { 0x7fffff00L, 0xffffff00L }, Fix48_m_min = { 0x80000000L, 0L }; - + // // Fix24 class: 24-bit Fixed point data type // // consists of a 24-bit mantissa (sign bit & 23 data bits). // -class Fix24 -{ +class Fix24 +{ friend class Fix48; _G_int32_t m; @@ -133,15 +133,15 @@ public: void range_error(_G_int32_t&) const; }; - + // // Fix48 class: 48-bit Fixed point data type // // consists of a 48-bit mantissa (sign bit & 47 data bits). // -class Fix48 -{ +class Fix48 +{ friend class Fix24; twolongs m; @@ -242,85 +242,85 @@ extern void inline Fix24::~Fix24() {} -inline Fix24::Fix24(long i) -{ - m = i; +inline Fix24::Fix24(long i) +{ + m = i; } -inline Fix24::Fix24(int i) -{ - m = i; +inline Fix24::Fix24(int i) +{ + m = i; } inline Fix24::operator double() const -{ - return Fix24_div * m; +{ + return Fix24_div * m; } -inline Fix24::Fix24() -{ - m = 0; +inline Fix24::Fix24() +{ + m = 0; } -inline Fix24::Fix24(const Fix24& f) -{ - m = f.m; +inline Fix24::Fix24(const Fix24& f) +{ + m = f.m; } -inline Fix24::Fix24(double d) +inline Fix24::Fix24(double d) { m = assign(d); } -inline Fix24::Fix24(const Fix48& f) -{ +inline Fix24::Fix24(const Fix48& f) +{ m = f.m.u; } -inline Fix24& Fix24::operator=(const Fix24& f) -{ - m = f.m; - return *this; +inline Fix24& Fix24::operator=(const Fix24& f) +{ + m = f.m; + return *this; } -inline Fix24& Fix24::operator=(double d) -{ - m = assign(d); - return *this; +inline Fix24& Fix24::operator=(double d) +{ + m = assign(d); + return *this; } inline Fix24& Fix24::operator=(const Fix48& f) -{ +{ m = f.m.u; - return *this; + return *this; } inline _G_int32_t& mantissa(Fix24& f) -{ - return f.m; +{ + return f.m; } inline const _G_int32_t& mantissa(const Fix24& f) -{ - return f.m; +{ + return f.m; } inline double value(const Fix24& f) -{ - return double(f); +{ + return double(f); } -inline Fix24 Fix24::operator+() const -{ - return m; +inline Fix24 Fix24::operator+() const +{ + return m; } inline Fix24 Fix24::operator-() const -{ - return -m; +{ + return -m; } -inline Fix24 operator+(const Fix24& f, const Fix24& g) +inline Fix24 operator+(const Fix24& f, const Fix24& g) { _G_int32_t sum = f.m + g.m; if ( (f.m ^ sum) & (g.m ^ sum) & Fix24_msb ) @@ -328,7 +328,7 @@ inline Fix24 operator+(const Fix24& f, const Fix24& g) return sum; } -inline Fix24 operator-(const Fix24& f, const Fix24& g) +inline Fix24 operator-(const Fix24& f, const Fix24& g) { _G_int32_t sum = f.m - g.m; if ( (f.m ^ sum) & (-g.m ^ sum) & Fix24_msb ) @@ -336,23 +336,23 @@ inline Fix24 operator-(const Fix24& f, const Fix24& g) return sum; } -inline Fix24 operator*(const Fix24& a, int b) -{ - return a.m * b; +inline Fix24 operator*(const Fix24& a, int b) +{ + return a.m * b; } -inline Fix24 operator*(int b, const Fix24& a) -{ - return a * b; +inline Fix24 operator*(int b, const Fix24& a) +{ + return a * b; } -inline Fix24 operator<<(const Fix24& a, int b) -{ - return a.m << b; +inline Fix24 operator<<(const Fix24& a, int b) +{ + return a.m << b; } -inline Fix24 operator>>(const Fix24& a, int b) -{ +inline Fix24 operator>>(const Fix24& a, int b) +{ return (a.m >> b) & ~0xff; } @@ -361,236 +361,236 @@ inline Fix24& Fix24:: operator+=(const Fix24& f) return *this = *this + f; } -inline Fix24& Fix24:: operator-=(const Fix24& f) -{ - return *this = *this - f; +inline Fix24& Fix24:: operator-=(const Fix24& f) +{ + return *this = *this - f; } -inline Fix24& Fix24::operator*=(const Fix24& f) -{ - return *this = *this * f; +inline Fix24& Fix24::operator*=(const Fix24& f) +{ + return *this = *this * f; } -inline Fix24& Fix24:: operator/=(const Fix24& f) -{ - return *this = *this / f; +inline Fix24& Fix24:: operator/=(const Fix24& f) +{ + return *this = *this / f; } -inline Fix24& Fix24:: operator<<=(int b) -{ +inline Fix24& Fix24:: operator<<=(int b) +{ return *this = *this << b; } -inline Fix24& Fix24:: operator>>=(int b) -{ +inline Fix24& Fix24:: operator>>=(int b) +{ return *this = *this >> b; } inline Fix24& Fix24::operator*=(int b) -{ - return *this = *this * b; +{ + return *this = *this * b; } -inline int operator==(const Fix24& f, const Fix24& g) -{ +inline int operator==(const Fix24& f, const Fix24& g) +{ return f.m == g.m; } -inline int operator!=(const Fix24& f, const Fix24& g) -{ +inline int operator!=(const Fix24& f, const Fix24& g) +{ return f.m != g.m; } -inline int operator>=(const Fix24& f, const Fix24& g) -{ +inline int operator>=(const Fix24& f, const Fix24& g) +{ return f.m >= g.m; } -inline int operator<=(const Fix24& f, const Fix24& g) -{ +inline int operator<=(const Fix24& f, const Fix24& g) +{ return f.m <= g.m; } -inline int operator>(const Fix24& f, const Fix24& g) -{ +inline int operator>(const Fix24& f, const Fix24& g) +{ return f.m > g.m; } -inline int operator<(const Fix24& f, const Fix24& g) -{ +inline int operator<(const Fix24& f, const Fix24& g) +{ return f.m < g.m; } inline istream& operator>>(istream& s, Fix24& f) -{ +{ double d; - s >> d; - f = d; - return s; + s >> d; + f = d; + return s; } inline ostream& operator<<(ostream& s, const Fix24& f) -{ +{ return s << double(f); } inline Fix48::~Fix48() {} -inline Fix48::Fix48(twolongs i) -{ +inline Fix48::Fix48(twolongs i) +{ m = i; } inline Fix48:: operator double() const -{ +{ /* * Note: can't simply do Fix48_div_u * m.u + Fix48_div_l * m.l, because * m.u is signed and m.l is unsigned. */ return (m.u >= 0)? Fix48_div_u * m.u + Fix48_div_l * m.l : - (Fix48_div_u * ((_G_uint32_t)(m.u & 0xffffff00)) + (Fix48_div_u * ((_G_uint32_t)(m.u & 0xffffff00)) + Fix48_div_l * m.l) - 2; } -inline Fix48::Fix48() -{ +inline Fix48::Fix48() +{ m.u = 0; m.l = 0; } -inline Fix48::Fix48(const Fix48& f) -{ +inline Fix48::Fix48(const Fix48& f) +{ m = f.m; } -inline Fix48::Fix48(const Fix24& f) -{ +inline Fix48::Fix48(const Fix24& f) +{ m.u = f.m; m.l = 0; } -inline Fix48::Fix48(double d) -{ +inline Fix48::Fix48(double d) +{ m = assign(d); } -inline Fix48& Fix48::operator=(const Fix48& f) -{ +inline Fix48& Fix48::operator=(const Fix48& f) +{ m = f.m; - return *this; + return *this; } -inline Fix48& Fix48::operator=(const Fix24& f) -{ +inline Fix48& Fix48::operator=(const Fix24& f) +{ m.u = f.m; m.l = 0; return *this; } -inline Fix48& Fix48::operator=(double d) -{ +inline Fix48& Fix48::operator=(double d) +{ m = assign(d); - return *this; + return *this; } -inline twolongs& mantissa(Fix48& f) -{ +inline twolongs& mantissa(Fix48& f) +{ return f.m; } -inline const twolongs& mantissa(const Fix48& f) -{ +inline const twolongs& mantissa(const Fix48& f) +{ return f.m; } inline double value(const Fix48& f) -{ +{ return double(f); } -inline Fix48 Fix48::operator+() const -{ +inline Fix48 Fix48::operator+() const +{ return m; } inline Fix48 Fix48::operator-() const -{ +{ twolongs n; n.l = -m.l; n.u = ~m.u + ((n.l ^ m.l) & Fix24_msb ? 0 : Fix24_lsb); return Fix48(n); } -inline Fix48 operator*(int b, const Fix48& a) -{ - return a * b; +inline Fix48 operator*(int b, const Fix48& a) +{ + return a * b; } -inline Fix48& Fix48::operator+=(const Fix48& f) -{ +inline Fix48& Fix48::operator+=(const Fix48& f) +{ return *this = *this + f; } -inline Fix48& Fix48::operator-=(const Fix48& f) -{ +inline Fix48& Fix48::operator-=(const Fix48& f) +{ return *this = *this - f; } -inline Fix48& Fix48::operator*=(int b) -{ +inline Fix48& Fix48::operator*=(int b) +{ return *this = *this * b; } -inline Fix48& Fix48::operator<<=(int b) -{ +inline Fix48& Fix48::operator<<=(int b) +{ return *this = *this << b; } -inline Fix48& Fix48::operator>>=(int b) -{ +inline Fix48& Fix48::operator>>=(int b) +{ return *this = *this >> b; } -inline int operator==(const Fix48& f, const Fix48& g) -{ +inline int operator==(const Fix48& f, const Fix48& g) +{ return f.m.u == g.m.u && f.m.l == g.m.l; } -inline int operator!=(const Fix48& f, const Fix48& g) -{ +inline int operator!=(const Fix48& f, const Fix48& g) +{ return f.m.u != g.m.u || f.m.l != g.m.l; } -inline int operator>=(const Fix48& f, const Fix48& g) -{ +inline int operator>=(const Fix48& f, const Fix48& g) +{ return f.m.u >= g.m.u || (f.m.u == g.m.u && f.m.l >= g.m.l); } -inline int operator<=(const Fix48& f, const Fix48& g) -{ +inline int operator<=(const Fix48& f, const Fix48& g) +{ return f.m.u <= g.m.u || (f.m.u == g.m.u && f.m.l <= g.m.l); } -inline int operator>(const Fix48& f, const Fix48& g) -{ +inline int operator>(const Fix48& f, const Fix48& g) +{ return f.m.u > g.m.u || (f.m.u == g.m.u && f.m.l > g.m.l); } -inline int operator<(const Fix48& f, const Fix48& g) -{ +inline int operator<(const Fix48& f, const Fix48& g) +{ return f.m.u < g.m.u || (f.m.u == g.m.u && f.m.l < g.m.l); } inline istream& operator>>(istream& s, Fix48& f) -{ +{ double d; - s >> d; - f = d; - return s; + s >> d; + f = d; + return s; } inline ostream& operator<<(ostream& s, const Fix48& f) -{ +{ return s << double(f); } diff --git a/gnu/lib/libg++/include/Geom.h b/gnu/lib/libg++/include/Geom.h index 5cfa39a..7d05b83 100644 --- a/gnu/lib/libg++/include/Geom.h +++ b/gnu/lib/libg++/include/Geom.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Dirk Grunwald (grunwald@cs.uiuc.edu) @@ -19,7 +19,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. #ifdef __GNUG__ #pragma interface #endif -#define _Geometric_h +#define _Geometric_h #include <Random.h> diff --git a/gnu/lib/libg++/include/GetOpt.h b/gnu/lib/libg++/include/GetOpt.h index 66ecf5c..9dfc3c6 100644 --- a/gnu/lib/libg++/include/GetOpt.h +++ b/gnu/lib/libg++/include/GetOpt.h @@ -1,4 +1,4 @@ -/* Getopt for GNU. +/* Getopt for GNU. Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc. (Modified by Douglas C. Schmidt for use with GNU G++.) @@ -45,51 +45,51 @@ private: /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. - + If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ - + static char *nextchar; - - + + /* Describe how to deal with options that follow non-option ARGV-elements. - + UNSPECIFIED means the caller did not specify anything; the default is then REQUIRE_ORDER if the environment variable _OPTIONS_FIRST is defined, PERMUTE otherwise. - + REQUIRE_ORDER means don't recognize them as options. Stop option processing when the first non-option is seen. This is what Unix does. - + PERMUTE is the default. We permute the contents of `argv' as we scan, so that eventually all the options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. - + RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code zero. Using `-' as the first character of the list of option characters requests this mode of operation. - + The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return EOF with `optind' != ARGC. */ - + enum OrderingEnum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER }; OrderingEnum ordering; /* Handle permutation of arguments. */ - + /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ - + static int first_nonopt; static int last_nonopt; - + void exchange (char **argv); public: /* For communication from `getopt' to the caller. @@ -97,31 +97,31 @@ public: the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ - + char *optarg; - + /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. - + When `getopt' returns EOF, this is the index of the first of the non-option elements that the caller should itself scan. - + Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ - + int optind; /* Callers store zero here to inhibit the error message for unrecognized options. */ - + int opterr; - + int nargc; char **nargv; const char *noptstring; - + GetOpt (int argc, char **argv, const char *optstring); int operator () (void); }; diff --git a/gnu/lib/libg++/include/HypGeom.h b/gnu/lib/libg++/include/HypGeom.h index e16e655..1864e91 100644 --- a/gnu/lib/libg++/include/HypGeom.h +++ b/gnu/lib/libg++/include/HypGeom.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Dirk Grunwald (grunwald@cs.uiuc.edu) @@ -19,7 +19,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. #ifdef __GNUG__ #pragma interface #endif -#define _HyperGeometric_h +#define _HyperGeometric_h #include <Random.h> diff --git a/gnu/lib/libg++/include/Integer.h b/gnu/lib/libg++/include/Integer.h index 7e67ae5..b5c1768 100644 --- a/gnu/lib/libg++/include/Integer.h +++ b/gnu/lib/libg++/include/Integer.h @@ -1,6 +1,6 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Doug Lea (dl@rocky.oswego.edu) @@ -29,7 +29,7 @@ struct IntRep // internal Integer representations { unsigned short len; // current length unsigned short sz; // allocated space (0 means static). - short sgn; // 1 means >= 0; 0 means < 0 + short sgn; // 1 means >= 0; 0 means < 0 unsigned short s[1]; // represented as ushort array starting here }; @@ -67,7 +67,7 @@ extern int ucompare(const IntRep*, const IntRep*); extern int ucompare(const IntRep*, long); extern char* Itoa(const IntRep* x, int base = 10, int width = 0); extern char* cvtItoa(const IntRep* x, char* fmt, int& fmtlen, int base, - int showbase, int width, int align_right, + int showbase, int width, int align_right, char fillchar, char Xcase, int showpos); extern IntRep* atoIntRep(const char* s, int base = 10); extern long Itolong(const IntRep*); @@ -152,14 +152,14 @@ public: friend void negate(const Integer& x, Integer& dest); friend void complement(const Integer& x, Integer& dest); - friend int compare(const Integer&, const Integer&); - friend int ucompare(const Integer&, const Integer&); + friend int compare(const Integer&, const Integer&); + friend int ucompare(const Integer&, const Integer&); friend void add(const Integer& x, const Integer& y, Integer& dest); friend void sub(const Integer& x, const Integer& y, Integer& dest); friend void mul(const Integer& x, const Integer& y, Integer& dest); friend void div(const Integer& x, const Integer& y, Integer& dest); friend void mod(const Integer& x, const Integer& y, Integer& dest); - friend void divide(const Integer& x, const Integer& y, + friend void divide(const Integer& x, const Integer& y, Integer& q, Integer& r); friend void and(const Integer& x, const Integer& y, Integer& dest); friend void or(const Integer& x, const Integer& y, Integer& dest); @@ -168,8 +168,8 @@ public: friend void rshift(const Integer& x, const Integer& y, Integer& dest); friend void pow(const Integer& x, const Integer& y, Integer& dest); - friend int compare(const Integer&, long); - friend int ucompare(const Integer&, long); + friend int compare(const Integer&, long); + friend int ucompare(const Integer&, long); friend void add(const Integer& x, long y, Integer& dest); friend void sub(const Integer& x, long y, Integer& dest); friend void mul(const Integer& x, long y, Integer& dest); @@ -183,8 +183,8 @@ public: friend void rshift(const Integer& x, long y, Integer& dest); friend void pow(const Integer& x, long y, Integer& dest); - friend int compare(long, const Integer&); - friend int ucompare(long, const Integer&); + friend int compare(long, const Integer&); + friend int ucompare(long, const Integer&); friend void add(long x, const Integer& y, Integer& dest); friend void sub(long x, const Integer& y, Integer& dest); friend void mul(long x, const Integer& y, Integer& dest); @@ -203,7 +203,7 @@ public: friend char* Itoa(const Integer& x, int base = 10, int width = 0); friend Integer atoI(const char* s, int base = 10); void printon(ostream& s, int base = 10, int width = 0) const; - + friend istream& operator >> (istream& s, Integer& y); friend ostream& operator << (ostream& s, const Integer& y); @@ -211,7 +211,7 @@ public: int initialized() const; void error(const char* msg) const; - int OK() const; + int OK() const; }; @@ -263,7 +263,7 @@ public: Integer pow(const Integer& x, const Integer& y); Integer pow(const Integer& x, long y); - Integer Ipow(long x, long y); // x to the y as Integer + Integer Ipow(long x, long y); // x to the y as Integer extern char* dec(const Integer& x, int width = 0); @@ -498,62 +498,62 @@ inline void xor(long x, const Integer& y, Integer& dest) inline int operator == (const Integer& x, const Integer& y) { - return compare(x, y) == 0; + return compare(x, y) == 0; } inline int operator == (const Integer& x, long y) { - return compare(x, y) == 0; + return compare(x, y) == 0; } inline int operator != (const Integer& x, const Integer& y) { - return compare(x, y) != 0; + return compare(x, y) != 0; } inline int operator != (const Integer& x, long y) { - return compare(x, y) != 0; + return compare(x, y) != 0; } inline int operator < (const Integer& x, const Integer& y) { - return compare(x, y) < 0; + return compare(x, y) < 0; } inline int operator < (const Integer& x, long y) { - return compare(x, y) < 0; + return compare(x, y) < 0; } inline int operator <= (const Integer& x, const Integer& y) { - return compare(x, y) <= 0; + return compare(x, y) <= 0; } inline int operator <= (const Integer& x, long y) { - return compare(x, y) <= 0; + return compare(x, y) <= 0; } inline int operator > (const Integer& x, const Integer& y) { - return compare(x, y) > 0; + return compare(x, y) > 0; } inline int operator > (const Integer& x, long y) { - return compare(x, y) > 0; + return compare(x, y) > 0; } inline int operator >= (const Integer& x, const Integer& y) { - return compare(x, y) >= 0; + return compare(x, y) >= 0; } inline int operator >= (const Integer& x, long y) { - return compare(x, y) >= 0; + return compare(x, y) >= 0; } @@ -738,12 +738,12 @@ inline char* Itoa(const Integer& y, int base, int width) -inline long lg(const Integer& x) +inline long lg(const Integer& x) { return lg(x.rep); } -// constructive operations +// constructive operations #if defined(__GNUG__) && !defined(_G_NO_NRV) @@ -926,179 +926,179 @@ inline Integer gcd(const Integer& x, const Integer& y) return r #else /* NO_NRV */ -inline Integer operator + (const Integer& x, const Integer& y) +inline Integer operator + (const Integer& x, const Integer& y) { Integer r; add(x, y, r); return r; } -inline Integer operator + (const Integer& x, long y) +inline Integer operator + (const Integer& x, long y) { Integer r; add(x, y, r); return r; } -inline Integer operator + (long x, const Integer& y) +inline Integer operator + (long x, const Integer& y) { Integer r; add(x, y, r); return r; } -inline Integer operator - (const Integer& x, const Integer& y) +inline Integer operator - (const Integer& x, const Integer& y) { Integer r; sub(x, y, r); return r; } -inline Integer operator - (const Integer& x, long y) +inline Integer operator - (const Integer& x, long y) { Integer r; sub(x, y, r); return r; } -inline Integer operator - (long x, const Integer& y) +inline Integer operator - (long x, const Integer& y) { Integer r; sub(x, y, r); return r; } -inline Integer operator * (const Integer& x, const Integer& y) +inline Integer operator * (const Integer& x, const Integer& y) { Integer r; mul(x, y, r); return r; } -inline Integer operator * (const Integer& x, long y) +inline Integer operator * (const Integer& x, long y) { Integer r; mul(x, y, r); return r; } -inline Integer operator * (long x, const Integer& y) +inline Integer operator * (long x, const Integer& y) { Integer r; mul(x, y, r); return r; } -inline Integer sqr(const Integer& x) +inline Integer sqr(const Integer& x) { Integer r; mul(x, x, r); return r; } -inline Integer operator & (const Integer& x, const Integer& y) +inline Integer operator & (const Integer& x, const Integer& y) { Integer r; and(x, y, r); return r; } -inline Integer operator & (const Integer& x, long y) +inline Integer operator & (const Integer& x, long y) { Integer r; and(x, y, r); return r; } -inline Integer operator & (long x, const Integer& y) +inline Integer operator & (long x, const Integer& y) { Integer r; and(x, y, r); return r; } -inline Integer operator | (const Integer& x, const Integer& y) +inline Integer operator | (const Integer& x, const Integer& y) { Integer r; or(x, y, r); return r; } -inline Integer operator | (const Integer& x, long y) +inline Integer operator | (const Integer& x, long y) { Integer r; or(x, y, r); return r; } -inline Integer operator | (long x, const Integer& y) +inline Integer operator | (long x, const Integer& y) { Integer r; or(x, y, r); return r; } -inline Integer operator ^ (const Integer& x, const Integer& y) +inline Integer operator ^ (const Integer& x, const Integer& y) { Integer r; xor(x, y, r); return r; } -inline Integer operator ^ (const Integer& x, long y) +inline Integer operator ^ (const Integer& x, long y) { Integer r; xor(x, y, r); return r; } -inline Integer operator ^ (long x, const Integer& y) +inline Integer operator ^ (long x, const Integer& y) { Integer r; xor(x, y, r); return r; } -inline Integer operator / (const Integer& x, const Integer& y) +inline Integer operator / (const Integer& x, const Integer& y) { Integer r; div(x, y, r); return r; } -inline Integer operator / (const Integer& x, long y) +inline Integer operator / (const Integer& x, long y) { Integer r; div(x, y, r); return r; } -inline Integer operator % (const Integer& x, const Integer& y) +inline Integer operator % (const Integer& x, const Integer& y) { Integer r; mod(x, y, r); return r; } -inline Integer operator % (const Integer& x, long y) +inline Integer operator % (const Integer& x, long y) { Integer r; mod(x, y, r); return r; } -inline Integer operator << (const Integer& x, const Integer& y) +inline Integer operator << (const Integer& x, const Integer& y) { Integer r; lshift(x, y, r); return r; } -inline Integer operator << (const Integer& x, long y) +inline Integer operator << (const Integer& x, long y) { Integer r; lshift(x, y, r); return r; } -inline Integer operator >> (const Integer& x, const Integer& y) +inline Integer operator >> (const Integer& x, const Integer& y) { Integer r; rshift(x, y, r); return r; } -inline Integer operator >> (const Integer& x, long y) +inline Integer operator >> (const Integer& x, long y) { Integer r; rshift(x, y, r); return r; } -inline Integer pow(const Integer& x, long y) +inline Integer pow(const Integer& x, long y) { Integer r; pow(x, y, r); return r; } -inline Integer Ipow(long x, long y) +inline Integer Ipow(long x, long y) { Integer r(x); pow(r, y, r); return r; } -inline Integer pow(const Integer& x, const Integer& y) +inline Integer pow(const Integer& x, const Integer& y) { Integer r; pow(x, y, r); return r; } -inline Integer abs(const Integer& x) +inline Integer abs(const Integer& x) { Integer r; abs(x, r); return r; } -inline Integer operator - (const Integer& x) +inline Integer operator - (const Integer& x) { Integer r; negate(x, r); return r; } -inline Integer operator ~ (const Integer& x) +inline Integer operator ~ (const Integer& x) { Integer r; complement(x, r); return r; } -inline Integer atoI(const char* s, int base) +inline Integer atoI(const char* s, int base) { Integer r; r.rep = atoIntRep(s, base); return r; } -inline Integer gcd(const Integer& x, const Integer& y) +inline Integer gcd(const Integer& x, const Integer& y) { Integer r; r.rep = gcd(x.rep, y.rep); return r; } diff --git a/gnu/lib/libg++/include/LogNorm.h b/gnu/lib/libg++/include/LogNorm.h index ac98141..b5c4b46 100644 --- a/gnu/lib/libg++/include/LogNorm.h +++ b/gnu/lib/libg++/include/LogNorm.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Dirk Grunwald (grunwald@cs.uiuc.edu) @@ -19,7 +19,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. #ifdef __GNUG__ #pragma interface #endif -#define _LogNormal_h +#define _LogNormal_h #include <Normal.h> @@ -44,7 +44,7 @@ inline void LogNormal::setState() pMean = log(m2 / sqrt(logVariance + m2) ); // from ch@heike.informatik.uni-dortmund.de: // (was pVariance = log((sqrt(logVariance + m2)/m2 )); ) - pStdDev = sqrt(log((logVariance + m2)/m2 )); + pStdDev = sqrt(log((logVariance + m2)/m2 )); } inline LogNormal::LogNormal(double mean, double variance, RNG *gen) diff --git a/gnu/lib/libg++/include/MLCG.h b/gnu/lib/libg++/include/MLCG.h index 8fa08a8..9b288a7 100644 --- a/gnu/lib/libg++/include/MLCG.h +++ b/gnu/lib/libg++/include/MLCG.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Dirk Grunwald (grunwald@cs.uiuc.edu) @@ -16,7 +16,7 @@ License along with this library; if not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _MLCG_h -#define _MLCG_h 1 +#define _MLCG_h 1 #ifdef __GNUG__ #pragma interface #endif diff --git a/gnu/lib/libg++/include/NegExp.h b/gnu/lib/libg++/include/NegExp.h index b96f913..041e083 100644 --- a/gnu/lib/libg++/include/NegExp.h +++ b/gnu/lib/libg++/include/NegExp.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Dirk Grunwald (grunwald@cs.uiuc.edu) @@ -25,7 +25,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. // // Negative Exponential Random Numbers // -// +// #include <Random.h> diff --git a/gnu/lib/libg++/include/Normal.h b/gnu/lib/libg++/include/Normal.h index 8c8358e..ab80f2a 100644 --- a/gnu/lib/libg++/include/Normal.h +++ b/gnu/lib/libg++/include/Normal.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Dirk Grunwald (grunwald@cs.uiuc.edu) @@ -19,7 +19,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. #ifdef __GNUG__ #pragma interface #endif -#define _Normal_h +#define _Normal_h #include <Random.h> @@ -31,7 +31,7 @@ protected: double pMean; double pVariance; double pStdDev; - + public: Normal(double xmean, double xvariance, RNG *gen); double mean(); diff --git a/gnu/lib/libg++/include/Obstack.h b/gnu/lib/libg++/include/Obstack.h index 384157f..6e353fb 100644 --- a/gnu/lib/libg++/include/Obstack.h +++ b/gnu/lib/libg++/include/Obstack.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Doug Lea (dl@rocky.oswego.edu) @@ -84,127 +84,127 @@ public: inline Obstack::~Obstack() { - _free(0); + _free(0); } inline void* Obstack::base() { - return objectbase; + return objectbase; } inline void* Obstack::next_free() { - return nextfree; + return nextfree; } inline int Obstack::alignment_mask() { - return alignmentmask; + return alignmentmask; } inline int Obstack::chunk_size() { - return chunksize; + return chunksize; } inline int Obstack::size() { - return nextfree - objectbase; + return nextfree - objectbase; } inline int Obstack::room() { - return chunklimit - nextfree; + return chunklimit - nextfree; } inline void Obstack:: grow(const void* data, int size) { - if (nextfree+size > chunklimit) + if (nextfree+size > chunklimit) newchunk(size); memcpy(nextfree, data, size); - nextfree += size; + nextfree += size; } inline void Obstack:: grow(const void* data, int size, char terminator) { - if (nextfree+size+1 > chunklimit) + if (nextfree+size+1 > chunklimit) newchunk(size+1); memcpy(nextfree, data, size); - nextfree += size; - *(nextfree)++ = terminator; + nextfree += size; + *(nextfree)++ = terminator; } inline void Obstack:: grow(const char* s) { - grow((const void*)s, strlen(s), 0); + grow((const void*)s, strlen(s), 0); } inline void Obstack:: grow(char c) { - if (nextfree+1 > chunklimit) - newchunk(1); - *(nextfree)++ = c; + if (nextfree+1 > chunklimit) + newchunk(1); + *(nextfree)++ = c; } inline void Obstack:: blank(int size) { - if (nextfree+size > chunklimit) + if (nextfree+size > chunklimit) newchunk(size); - nextfree += size; + nextfree += size; } inline void* Obstack::finish(char terminator) { - grow(terminator); - return finish(); + grow(terminator); + return finish(); } inline void* Obstack::copy(const void* data, int size) { grow (data, size); - return finish(); + return finish(); } inline void* Obstack::copy(const void* data, int size, char terminator) { - grow(data, size, terminator); - return finish(); + grow(data, size, terminator); + return finish(); } inline void* Obstack::copy(const char* s) { - grow((const void*)s, strlen(s), 0); - return finish(); + grow((const void*)s, strlen(s), 0); + return finish(); } inline void* Obstack::copy(char c) { grow(c); - return finish(); + return finish(); } inline void* Obstack::alloc(int size) { blank(size); - return finish(); + return finish(); } -inline void Obstack:: free(void* obj) +inline void Obstack:: free(void* obj) { if (obj >= (void*)chunk && obj<(void*)chunklimit) nextfree = objectbase = (char *) obj; - else - _free(obj); + else + _free(obj); } inline void Obstack:: grow_fast(char c) { - *(nextfree)++ = c; + *(nextfree)++ = c; } inline void Obstack:: blank_fast(int size) { - nextfree += size; + nextfree += size; } inline void Obstack:: shrink(int size) // from ken@cs.rochester.edu diff --git a/gnu/lib/libg++/include/PlotFile.h b/gnu/lib/libg++/include/PlotFile.h index 91ab6ae..1a401cd 100644 --- a/gnu/lib/libg++/include/PlotFile.h +++ b/gnu/lib/libg++/include/PlotFile.h @@ -22,10 +22,10 @@ the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ -/* +/* a very simple implementation of a class to output unix "plot" format plotter files. See corresponding unix man pages for - more details. + more details. written by Doug Lea (dl@rocky.oswego.edu) converted to use iostream library by Per Bothner (bothner@cygnus.com) @@ -39,7 +39,7 @@ the executable file might be covered by the GNU General Public License. */ #include <fstream.h> -/* +/* Some plot libraries have the `box' command to draw boxes. Some don't. `box' is included here via moves & lines to allow both possiblilties. */ @@ -51,21 +51,21 @@ protected: PlotFile& cmd(char c); PlotFile& operator << (const int x); PlotFile& operator << (const char *s); - + public: - + PlotFile() : ofstream() { } PlotFile(int fd) : ofstream(fd) { } PlotFile(const char *name, int mode=ios::out, int prot=0664) : ofstream(name, mode, prot) { } - + // PlotFile& remove() { ofstream::remove(); return *this; } - + // int filedesc() { return ofstream::filedesc(); } // const char* name() { return File::name(); } // void setname(const char* newname) { File::setname(newname); } // int iocount() { return File::iocount(); } - + PlotFile& arc(const int xi, const int yi, const int x0, const int y0, const int x1, const int y1); @@ -75,7 +75,7 @@ public: PlotFile& cont(const int xi, const int yi); PlotFile& dot(const int xi, const int yi, const int dx, int n, const int* pat); - PlotFile& erase(); + PlotFile& erase(); PlotFile& label(const char* s); PlotFile& line(const int x0, const int y0, const int x1, const int y1); diff --git a/gnu/lib/libg++/include/Poisson.h b/gnu/lib/libg++/include/Poisson.h index e585145..895b072 100644 --- a/gnu/lib/libg++/include/Poisson.h +++ b/gnu/lib/libg++/include/Poisson.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Dirk Grunwald (grunwald@cs.uiuc.edu) @@ -19,7 +19,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. #ifdef __GNUG__ #pragma interface #endif -#define _Poisson_h +#define _Poisson_h #include <Random.h> diff --git a/gnu/lib/libg++/include/RNG.h b/gnu/lib/libg++/include/RNG.h index b924fb6..81b5e16 100644 --- a/gnu/lib/libg++/include/RNG.h +++ b/gnu/lib/libg++/include/RNG.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Dirk Grunwald (grunwald@cs.uiuc.edu) diff --git a/gnu/lib/libg++/include/Random.h b/gnu/lib/libg++/include/Random.h index 925698f..e3e624a 100644 --- a/gnu/lib/libg++/include/Random.h +++ b/gnu/lib/libg++/include/Random.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Dirk Grunwald (grunwald@cs.uiuc.edu) diff --git a/gnu/lib/libg++/include/Rational.h b/gnu/lib/libg++/include/Rational.h index 131aabc..1f8b76b 100644 --- a/gnu/lib/libg++/include/Rational.h +++ b/gnu/lib/libg++/include/Rational.h @@ -1,6 +1,6 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Doug Lea (dl@rocky.oswego.edu) @@ -171,22 +171,22 @@ inline int operator != (const Rational& x, const Rational& y) inline int operator < (const Rational& x, const Rational& y) { - return compare(x, y) < 0; + return compare(x, y) < 0; } inline int operator <= (const Rational& x, const Rational& y) { - return compare(x, y) <= 0; + return compare(x, y) <= 0; } inline int operator > (const Rational& x, const Rational& y) { - return compare(x, y) > 0; + return compare(x, y) > 0; } inline int operator >= (const Rational& x, const Rational& y) { - return compare(x, y) >= 0; + return compare(x, y) >= 0; } inline int sign(const Rational& x) @@ -200,25 +200,25 @@ inline void Rational::negate() } -inline Rational& Rational::operator += (const Rational& y) +inline Rational& Rational::operator += (const Rational& y) { add(*this, y, *this); return *this; } -inline Rational& Rational::operator -= (const Rational& y) +inline Rational& Rational::operator -= (const Rational& y) { sub(*this, y, *this); return *this; } -inline Rational& Rational::operator *= (const Rational& y) +inline Rational& Rational::operator *= (const Rational& y) { mul(*this, y, *this); return *this; } -inline Rational& Rational::operator /= (const Rational& y) +inline Rational& Rational::operator /= (const Rational& y) { div(*this, y, *this); return *this; @@ -264,7 +264,7 @@ inline Rational operator / (const Rational& x, const Rational& y) return r #else /* NO_NRV */ -inline Rational operator + (const Rational& x, const Rational& y) +inline Rational operator + (const Rational& x, const Rational& y) { Rational r; add(x, y, r); return r; } diff --git a/gnu/lib/libg++/include/Regex.h b/gnu/lib/libg++/include/Regex.h index c8cf731..adc1cea 100644 --- a/gnu/lib/libg++/include/Regex.h +++ b/gnu/lib/libg++/include/Regex.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Doug Lea (dl@rocky.oswego.edu) @@ -44,15 +44,15 @@ protected: re_registers* reg; public: - Regex(const char* t, - int fast = 0, - int bufsize = 40, + Regex(const char* t, + int fast = 0, + int bufsize = 40, const char* transtable = 0); ~Regex(); int match(const char* s, int len, int pos = 0) const; - int search(const char* s, int len, + int search(const char* s, int len, int& matchlen, int startpos = 0) const; int match_info(int& start, int& length, int nth = 0) const; diff --git a/gnu/lib/libg++/include/RndInt.h b/gnu/lib/libg++/include/RndInt.h index b16c7f8..bf0f955 100644 --- a/gnu/lib/libg++/include/RndInt.h +++ b/gnu/lib/libg++/include/RndInt.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1990 Free Software Foundation adapted from a submission from John Reidl <riedl@cs.purdue.edu> @@ -40,13 +40,13 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. // in a specified range. By default the range is 0..1. Since in my // experience random numbers are often needed for a wide variety of // ranges in the same program, this generator accepts a new low or high value -// as an argument to the asLong and operator() methods to temporarily +// as an argument to the asLong and operator() methods to temporarily // override stored values #include <math.h> #include <RNG.h> -class RandomInteger +class RandomInteger { protected: RNG *pGenerator; @@ -90,20 +90,20 @@ class RandomInteger }; -inline RandomInteger::RandomInteger(long low, long high, RNG *gen) +inline RandomInteger::RandomInteger(long low, long high, RNG *gen) : pLow((low < high) ? low : high), pHigh((low < high) ? high : low), pGenerator(gen) {} -inline RandomInteger::RandomInteger(long high, RNG *gen) +inline RandomInteger::RandomInteger(long high, RNG *gen) : pLow((0 < high) ? 0 : high), pHigh((0 < high) ? high : 0), pGenerator(gen) {} - -inline RandomInteger::RandomInteger(RNG *gen) + +inline RandomInteger::RandomInteger(RNG *gen) : pLow(0), pHigh(1), pGenerator(gen) @@ -113,28 +113,28 @@ inline RNG* RandomInteger::generator() const { return pGenerator;} inline long RandomInteger::low() const { return pLow; } inline long RandomInteger::high() const { return pHigh; } -inline RNG* RandomInteger::generator(RNG *gen) +inline RNG* RandomInteger::generator(RNG *gen) { RNG *tmp = pGenerator; pGenerator = gen; return tmp; } -inline long RandomInteger::low(long x) +inline long RandomInteger::low(long x) { long tmp = pLow; pLow = x; return tmp; } -inline long RandomInteger:: high(long x) +inline long RandomInteger:: high(long x) { long tmp = pHigh; pHigh = x; return tmp; } inline long RandomInteger:: _asLong(long low, long high) -{ +{ return (pGenerator->asLong() % (high-low+1)) + low; } -inline long RandomInteger:: asLong() +inline long RandomInteger:: asLong() { return _asLong(pLow, pHigh); } @@ -149,7 +149,7 @@ inline long RandomInteger:: asLong(long low, long high) return _asLong(low, high); } -inline long RandomInteger:: operator () () +inline long RandomInteger:: operator () () { return _asLong(pLow, pHigh); } @@ -167,7 +167,7 @@ inline long RandomInteger:: operator () (long low, long high) -inline int RandomInteger:: asInt() +inline int RandomInteger:: asInt() { return int(asLong()); } diff --git a/gnu/lib/libg++/include/SFile.h b/gnu/lib/libg++/include/SFile.h index 3726844..d4b4c71 100644 --- a/gnu/lib/libg++/include/SFile.h +++ b/gnu/lib/libg++/include/SFile.h @@ -41,10 +41,10 @@ public: SFile(int fd, int size); SFile(const char *name, int size, int mode, int prot=0664); void open(const char *name, int size, int mode, int prot=0664); - + int size() { return sz; } int setsize(int s) { int old = sz; sz = s; return old; } - + SFile& get(void* x); SFile& put(void* x); SFile& operator[](long i); diff --git a/gnu/lib/libg++/include/SLList.h b/gnu/lib/libg++/include/SLList.h index 8c133d7..4be457f 100644 --- a/gnu/lib/libg++/include/SLList.h +++ b/gnu/lib/libg++/include/SLList.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988, 1992 Free Software Foundation written by Doug Lea (dl@rocky.oswego.edu) @@ -104,7 +104,7 @@ public: Pix ins_after(Pix p, const T& item) { return BaseSLList::ins_after(p, &item); } void join(SLList<T>& a) { BaseSLList::join(a); } - + T& front() { if (last == 0) error("front: empty list"); return ((SLNode<T>*)last->tl)->hd; } diff --git a/gnu/lib/libg++/include/SmplHist.h b/gnu/lib/libg++/include/SmplHist.h index a9a7550..54614b9 100644 --- a/gnu/lib/libg++/include/SmplHist.h +++ b/gnu/lib/libg++/include/SmplHist.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Dirk Grunwald (grunwald@cs.uiuc.edu) @@ -28,7 +28,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. extern const int SampleHistogramMinimum; extern const int SampleHistogramMaximum; -class SampleHistogram : public SampleStatistic +class SampleHistogram : public SampleStatistic { protected: short howManyBuckets; @@ -36,7 +36,7 @@ protected: double *bucketLimit; public: - + SampleHistogram(double low, double hi, double bucketWidth = -1.0); ~SampleHistogram(); diff --git a/gnu/lib/libg++/include/SmplStat.h b/gnu/lib/libg++/include/SmplStat.h index 191ec67..2ed5ab9 100644 --- a/gnu/lib/libg++/include/SmplStat.h +++ b/gnu/lib/libg++/include/SmplStat.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Dirk Grunwald (grunwald@cs.uiuc.edu) @@ -34,7 +34,7 @@ protected: SampleStatistic(); virtual ~SampleStatistic(); - virtual void reset(); + virtual void reset(); virtual void operator+=(double); int samples(); @@ -54,7 +54,7 @@ protected: extern void default_SampleStatistic_error_handler(const char*); extern one_arg_error_handler_t SampleStatistic_error_handler; -extern one_arg_error_handler_t +extern one_arg_error_handler_t set_SampleStatistic_error_handler(one_arg_error_handler_t f); inline SampleStatistic:: SampleStatistic(){ reset();} diff --git a/gnu/lib/libg++/include/String.h b/gnu/lib/libg++/include/String.h index 95b2bdf..7a3d82b 100644 --- a/gnu/lib/libg++/include/String.h +++ b/gnu/lib/libg++/include/String.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Doug Lea (dl@rocky.oswego.edu) @@ -28,9 +28,9 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. struct StrRep // internal String representations { - unsigned short len; // string length + unsigned short len; // string length unsigned short sz; // allocated space - char s[1]; // the string starts here + char s[1]; // the string starts here // (at least 1 char for trailing null) // allocated & expanded via non-public fcts }; @@ -89,7 +89,7 @@ public: int matches(const Regex& r) const; -// IO +// IO friend ostream& operator<<(ostream& s, const SubString& x); @@ -99,7 +99,7 @@ public: int empty() const; const char* chars() const; - int OK() const; + int OK() const; }; @@ -140,12 +140,12 @@ public: // concatenation - String& operator += (const String& y); + String& operator += (const String& y); String& operator += (const SubString& y); String& operator += (const char* t); String& operator += (char c); - void prepend(const String& y); + void prepend(const String& y); void prepend(const SubString& y); void prepend(const char* t); void prepend(char c); @@ -169,7 +169,7 @@ public: friend inline void cat(const char*, const char*, String&); friend inline void cat(const char*, char, String&); -// double concatenation, by request. (yes, there are too many versions, +// double concatenation, by request. (yes, there are too many versions, // but if one is supported, then the others should be too...) // Concatenate first 3 args, store in last arg @@ -204,11 +204,11 @@ public: // return position of target in string or -1 for failure - int index(char c, int startpos = 0) const; - int index(const String& y, int startpos = 0) const; - int index(const SubString& y, int startpos = 0) const; - int index(const char* t, int startpos = 0) const; - int index(const Regex& r, int startpos = 0) const; + int index(char c, int startpos = 0) const; + int index(const String& y, int startpos = 0) const; + int index(const SubString& y, int startpos = 0) const; + int index(const char* t, int startpos = 0) const; + int index(const Regex& r, int startpos = 0) const; // return 1 if target appears anyhere in String; else 0 @@ -218,7 +218,7 @@ public: int contains(const char* t) const; int contains(const Regex& r) const; -// return 1 if target appears anywhere after position pos +// return 1 if target appears anywhere after position pos // (or before, if pos is negative) in String; else 0 int contains(char c, int pos) const; @@ -237,7 +237,7 @@ public: // return number of occurences of target in String - int freq(char c) const; + int freq(char c) const; int freq(const String& y) const; int freq(const SubString& y) const; int freq(const char* t) const; @@ -251,11 +251,11 @@ public: SubString at(int pos, int len); SubString operator () (int pos, int len); // synonym for at - SubString at(const String& x, int startpos = 0); - SubString at(const SubString& x, int startpos = 0); + SubString at(const String& x, int startpos = 0); + SubString at(const SubString& x, int startpos = 0); SubString at(const char* t, int startpos = 0); SubString at(char c, int startpos = 0); - SubString at(const Regex& r, int startpos = 0); + SubString at(const Regex& r, int startpos = 0); SubString before(int pos); SubString before(const String& x, int startpos = 0); @@ -311,14 +311,14 @@ public: // split string into array res at separators; return number of elements - friend int split(const String& x, String res[], int maxn, + friend int split(const String& x, String res[], int maxn, const String& sep); - friend int split(const String& x, String res[], int maxn, + friend int split(const String& x, String res[], int maxn, const Regex& sep); - friend String common_prefix(const String& x, const String& y, + friend String common_prefix(const String& x, const String& y, int startpos = 0); - friend String common_suffix(const String& x, const String& y, + friend String common_suffix(const String& x, const String& y, int startpos = -1); friend String replicate(char c, int n); friend String replicate(const String& y, int n); @@ -358,7 +358,7 @@ public: friend ostream& operator<<(ostream& s, const SubString& x); friend istream& operator>>(istream& s, String& x); - friend int readline(istream& s, String& x, + friend int readline(istream& s, String& x, char terminator = '\n', int discard_terminator = 1); @@ -409,17 +409,17 @@ inline const char* SubString::chars() const { return &(S.rep->s[pos]); } // constructors -inline String::String() +inline String::String() : rep(&_nilStrRep) {} -inline String::String(const String& x) +inline String::String(const String& x) : rep(Scopy(0, x.rep)) {} -inline String::String(const char* t) +inline String::String(const char* t) : rep(Salloc(0, t, -1, -1)) {} inline String::String(const char* t, int tlen) : rep(Salloc(0, t, tlen, tlen)) {} inline String::String(const SubString& y) : rep(Salloc(0, y.chars(), y.length(), y.length())) {} -inline String::String(char c) +inline String::String(char c) : rep(Salloc(0, &c, 1, 1)) {} inline String::~String() { if (rep != &_nilStrRep) delete rep; } @@ -434,7 +434,7 @@ inline SubString::~SubString() {} // assignment inline String& String::operator = (const String& y) -{ +{ rep = Scopy(rep, y.rep); return *this; } @@ -773,67 +773,67 @@ inline String operator + (const String& x, const String& y) String r; cat(x, y, r); return r; } -inline String operator + (const String& x, const SubString& y) +inline String operator + (const String& x, const SubString& y) { String r; cat(x, y, r); return r; } -inline String operator + (const String& x, const char* y) +inline String operator + (const String& x, const char* y) { String r; cat(x, y, r); return r; } -inline String operator + (const String& x, char y) +inline String operator + (const String& x, char y) { String r; cat(x, y, r); return r; } -inline String operator + (const SubString& x, const String& y) +inline String operator + (const SubString& x, const String& y) { String r; cat(x, y, r); return r; } -inline String operator + (const SubString& x, const SubString& y) +inline String operator + (const SubString& x, const SubString& y) { String r; cat(x, y, r); return r; } -inline String operator + (const SubString& x, const char* y) +inline String operator + (const SubString& x, const char* y) { String r; cat(x, y, r); return r; } -inline String operator + (const SubString& x, char y) +inline String operator + (const SubString& x, char y) { String r; cat(x, y, r); return r; } -inline String operator + (const char* x, const String& y) +inline String operator + (const char* x, const String& y) { String r; cat(x, y, r); return r; } -inline String operator + (const char* x, const SubString& y) +inline String operator + (const char* x, const SubString& y) { String r; cat(x, y, r); return r; } -inline String reverse(const String& x) +inline String reverse(const String& x) { String r; r.rep = Sreverse(x.rep, r.rep); return r; } -inline String upcase(const String& x) +inline String upcase(const String& x) { String r; r.rep = Supcase(x.rep, r.rep); return r; } -inline String downcase(const String& x) +inline String downcase(const String& x) { String r; r.rep = Sdowncase(x.rep, r.rep); return r; } -inline String capitalize(const String& x) +inline String capitalize(const String& x) { String r; r.rep = Scapitalize(x.rep, r.rep); return r; } @@ -849,12 +849,12 @@ inline void String::prepend(const String& y) inline void String::prepend(const char* y) { - rep = Sprepend(rep, y, -1); + rep = Sprepend(rep, y, -1); } inline void String::prepend(char y) { - rep = Sprepend(rep, &y, 1); + rep = Sprepend(rep, &y, 1); } inline void String::prepend(const SubString& y) @@ -890,31 +890,31 @@ inline void String::capitalize() // element extraction -inline char& String::operator [] (int i) -{ +inline char& String::operator [] (int i) +{ if (((unsigned)i) >= length()) error("invalid index"); return rep->s[i]; } inline const char& String::operator [] (int i) const -{ +{ if (((unsigned)i) >= length()) error("invalid index"); return rep->s[i]; } inline char String::elem (int i) const -{ +{ if (((unsigned)i) >= length()) error("invalid index"); return rep->s[i]; } inline char String::firstchar() const -{ +{ return elem(0); } inline char String::lastchar() const -{ +{ return elem(length() - 1); } @@ -926,17 +926,17 @@ inline int String::index(char c, int startpos) const } inline int String::index(const char* t, int startpos) const -{ +{ return search(startpos, length(), t); } inline int String::index(const String& y, int startpos) const -{ +{ return search(startpos, length(), y.chars(), y.length()); } inline int String::index(const SubString& y, int startpos) const -{ +{ return search(startpos, length(), y.chars(), y.length()); } @@ -951,17 +951,17 @@ inline int String::contains(char c) const } inline int String::contains(const char* t) const -{ +{ return search(0, length(), t) >= 0; } inline int String::contains(const String& y) const -{ +{ return search(0, length(), y.chars(), y.length()) >= 0; } inline int String::contains(const SubString& y) const -{ +{ return search(0, length(), y.chars(), y.length()) >= 0; } @@ -1024,17 +1024,17 @@ inline int String::matches(const Regex& r, int p) const inline int SubString::contains(const char* t) const -{ +{ return S.search(pos, pos+len, t) >= 0; } inline int SubString::contains(const String& y) const -{ +{ return S.search(pos, pos+len, y.chars(), y.length()) >= 0; } inline int SubString::contains(const SubString& y) const -{ +{ return S.search(pos, pos+len, y.chars(), y.length()) >= 0; } @@ -1088,99 +1088,99 @@ inline ostream& operator<<(ostream& s, const String& x) // a zillion comparison operators -inline int operator==(const String& x, const String& y) +inline int operator==(const String& x, const String& y) { - return compare(x, y) == 0; + return compare(x, y) == 0; } inline int operator!=(const String& x, const String& y) { - return compare(x, y) != 0; + return compare(x, y) != 0; } inline int operator>(const String& x, const String& y) { - return compare(x, y) > 0; + return compare(x, y) > 0; } inline int operator>=(const String& x, const String& y) { - return compare(x, y) >= 0; + return compare(x, y) >= 0; } inline int operator<(const String& x, const String& y) { - return compare(x, y) < 0; + return compare(x, y) < 0; } inline int operator<=(const String& x, const String& y) { - return compare(x, y) <= 0; + return compare(x, y) <= 0; } -inline int operator==(const String& x, const SubString& y) +inline int operator==(const String& x, const SubString& y) { - return compare(x, y) == 0; + return compare(x, y) == 0; } inline int operator!=(const String& x, const SubString& y) { - return compare(x, y) != 0; + return compare(x, y) != 0; } -inline int operator>(const String& x, const SubString& y) +inline int operator>(const String& x, const SubString& y) { - return compare(x, y) > 0; + return compare(x, y) > 0; } inline int operator>=(const String& x, const SubString& y) { - return compare(x, y) >= 0; + return compare(x, y) >= 0; } -inline int operator<(const String& x, const SubString& y) +inline int operator<(const String& x, const SubString& y) { - return compare(x, y) < 0; + return compare(x, y) < 0; } inline int operator<=(const String& x, const SubString& y) { - return compare(x, y) <= 0; + return compare(x, y) <= 0; } -inline int operator==(const String& x, const char* t) +inline int operator==(const String& x, const char* t) { - return compare(x, t) == 0; + return compare(x, t) == 0; } -inline int operator!=(const String& x, const char* t) +inline int operator!=(const String& x, const char* t) { - return compare(x, t) != 0; + return compare(x, t) != 0; } -inline int operator>(const String& x, const char* t) +inline int operator>(const String& x, const char* t) { - return compare(x, t) > 0; + return compare(x, t) > 0; } -inline int operator>=(const String& x, const char* t) +inline int operator>=(const String& x, const char* t) { - return compare(x, t) >= 0; + return compare(x, t) >= 0; } -inline int operator<(const String& x, const char* t) +inline int operator<(const String& x, const char* t) { - return compare(x, t) < 0; + return compare(x, t) < 0; } -inline int operator<=(const String& x, const char* t) +inline int operator<=(const String& x, const char* t) { - return compare(x, t) <= 0; + return compare(x, t) <= 0; } -inline int operator==(const SubString& x, const String& y) +inline int operator==(const SubString& x, const String& y) { - return compare(y, x) == 0; + return compare(y, x) == 0; } inline int operator!=(const SubString& x, const String& y) @@ -1188,29 +1188,29 @@ inline int operator!=(const SubString& x, const String& y) return compare(y, x) != 0; } -inline int operator>(const SubString& x, const String& y) +inline int operator>(const SubString& x, const String& y) { return compare(y, x) < 0; } -inline int operator>=(const SubString& x, const String& y) +inline int operator>=(const SubString& x, const String& y) { return compare(y, x) <= 0; } -inline int operator<(const SubString& x, const String& y) +inline int operator<(const SubString& x, const String& y) { return compare(y, x) > 0; } -inline int operator<=(const SubString& x, const String& y) +inline int operator<=(const SubString& x, const String& y) { return compare(y, x) >= 0; } -inline int operator==(const SubString& x, const SubString& y) +inline int operator==(const SubString& x, const SubString& y) { - return compare(x, y) == 0; + return compare(x, y) == 0; } inline int operator!=(const SubString& x, const SubString& y) @@ -1218,7 +1218,7 @@ inline int operator!=(const SubString& x, const SubString& y) return compare(x, y) != 0; } -inline int operator>(const SubString& x, const SubString& y) +inline int operator>(const SubString& x, const SubString& y) { return compare(x, y) > 0; } @@ -1228,7 +1228,7 @@ inline int operator>=(const SubString& x, const SubString& y) return compare(x, y) >= 0; } -inline int operator<(const SubString& x, const SubString& y) +inline int operator<(const SubString& x, const SubString& y) { return compare(x, y) < 0; } @@ -1238,34 +1238,34 @@ inline int operator<=(const SubString& x, const SubString& y) return compare(x, y) <= 0; } -inline int operator==(const SubString& x, const char* t) +inline int operator==(const SubString& x, const char* t) { - return compare(x, t) == 0; + return compare(x, t) == 0; } -inline int operator!=(const SubString& x, const char* t) +inline int operator!=(const SubString& x, const char* t) { return compare(x, t) != 0; } -inline int operator>(const SubString& x, const char* t) +inline int operator>(const SubString& x, const char* t) { - return compare(x, t) > 0; + return compare(x, t) > 0; } -inline int operator>=(const SubString& x, const char* t) +inline int operator>=(const SubString& x, const char* t) { - return compare(x, t) >= 0; + return compare(x, t) >= 0; } -inline int operator<(const SubString& x, const char* t) +inline int operator<(const SubString& x, const char* t) { - return compare(x, t) < 0; + return compare(x, t) < 0; } -inline int operator<=(const SubString& x, const char* t) +inline int operator<=(const SubString& x, const char* t) { - return compare(x, t) <= 0; + return compare(x, t) <= 0; } @@ -1275,7 +1275,7 @@ inline SubString String::_substr(int first, int l) { if (first < 0 || (unsigned)(first + l) > length() ) return SubString(_nilString, 0, 0) ; - else + else return SubString(*this, first, l); } diff --git a/gnu/lib/libg++/include/Uniform.h b/gnu/lib/libg++/include/Uniform.h index 5933f6b..91536eb 100644 --- a/gnu/lib/libg++/include/Uniform.h +++ b/gnu/lib/libg++/include/Uniform.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Dirk Grunwald (grunwald@cs.uiuc.edu) @@ -25,7 +25,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. // // The interval [lo..hi] -// +// class Uniform: public Random { double pLow; diff --git a/gnu/lib/libg++/include/Weibull.h b/gnu/lib/libg++/include/Weibull.h index d03567a..c0360dc 100644 --- a/gnu/lib/libg++/include/Weibull.h +++ b/gnu/lib/libg++/include/Weibull.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Dirk Grunwald (grunwald@cs.uiuc.edu) @@ -19,7 +19,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. #ifdef __GNUG__ #pragma interface #endif -#define _Weibull_h +#define _Weibull_h #include <Random.h> @@ -30,7 +30,7 @@ protected: double pBeta; void setState(); - + public: Weibull(double alpha, double beta, RNG *gen); @@ -47,7 +47,7 @@ public: inline void Weibull::setState() { pInvAlpha = 1.0 / pAlpha; } - + inline Weibull::Weibull(double alpha, double beta, RNG *gen) : Random(gen) { pAlpha = alpha; diff --git a/gnu/lib/libg++/include/_G_config.h b/gnu/lib/libg++/include/_G_config.h index fabb570..cbd1acf 100644 --- a/gnu/lib/libg++/include/_G_config.h +++ b/gnu/lib/libg++/include/_G_config.h @@ -1,4 +1,4 @@ -/* AUTOMATICALLY GENERATED; DO NOT EDIT! */ +/* AUTOMATICALLY GENERATED; DO NOT EDIT! */ #include <sys/types.h> #ifndef _G_config_h #define _G_config_h diff --git a/gnu/lib/libg++/include/builtin.h b/gnu/lib/libg++/include/builtin.h index 73bb431..e2d7bce 100644 --- a/gnu/lib/libg++/include/builtin.h +++ b/gnu/lib/libg++/include/builtin.h @@ -1,6 +1,6 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988, 1992 Free Software Foundation written by Doug Lea (dl@rocky.oswego.edu) @@ -42,7 +42,7 @@ typedef void (*one_arg_error_handler_t)(const char*); typedef void (*two_arg_error_handler_t)(const char*, const char*); long gcd(long, long); -long lg(unsigned long); +long lg(unsigned long); double pow(double, long); long pow(long, long); @@ -60,30 +60,30 @@ extern _VOLATILE_VOID default_two_arg_error_handler(const char*, const char*); extern two_arg_error_handler_t lib_error_handler; -extern two_arg_error_handler_t +extern two_arg_error_handler_t set_lib_error_handler(two_arg_error_handler_t f); #if !defined(IV) #if ! _G_MATH_H_INLINES /* hpux and SCO define this in math.h */ -inline double abs(double arg) +inline double abs(double arg) { return (arg < 0.0)? -arg : arg; } #endif -inline float abs(float arg) +inline float abs(float arg) { return (arg < 0.0)? -arg : arg; } -inline short abs(short arg) +inline short abs(short arg) { return (arg < 0)? -arg : arg; } -inline long abs(long arg) +inline long abs(long arg) { return (arg < 0)? -arg : arg; } diff --git a/gnu/lib/libg++/include/builtinbuf.h b/gnu/lib/libg++/include/builtinbuf.h index fb91e6a..d67629a 100644 --- a/gnu/lib/libg++/include/builtinbuf.h +++ b/gnu/lib/libg++/include/builtinbuf.h @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 1993 Free Software Foundation This file is part of the GNU IO Library. This library is free diff --git a/gnu/lib/libg++/include/compare.h b/gnu/lib/libg++/include/compare.h index bd13614..aec3c30 100644 --- a/gnu/lib/libg++/include/compare.h +++ b/gnu/lib/libg++/include/compare.h @@ -1,6 +1,6 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988 Free Software Foundation written by Doug Lea (dl@rocky.oswego.edu) diff --git a/gnu/lib/libg++/include/defines.h b/gnu/lib/libg++/include/defines.h index 0f2fb3b..f5056b6 100644 --- a/gnu/lib/libg++/include/defines.h +++ b/gnu/lib/libg++/include/defines.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1994 Free Software Foundation written by Jason Merrill (jason@cygnus.com) diff --git a/gnu/lib/libg++/include/editbuf.h b/gnu/lib/libg++/include/editbuf.h index 8535155..2cac3bb 100644 --- a/gnu/lib/libg++/include/editbuf.h +++ b/gnu/lib/libg++/include/editbuf.h @@ -39,9 +39,9 @@ typedef /*unsigned*/ char buf_char; // Logical pos from start of buffer (does not count gap). typedef long buf_index; - + // Pos from start of buffer, possibly including gap_size. -typedef long buf_offset; +typedef long buf_offset; #if 0 struct buf_cookie { diff --git a/gnu/lib/libg++/include/floatio.h b/gnu/lib/libg++/include/floatio.h index edfe297..880f807 100644 --- a/gnu/lib/libg++/include/floatio.h +++ b/gnu/lib/libg++/include/floatio.h @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 1993 Free Software Foundation This file is part of the GNU IO Library. This library is free diff --git a/gnu/lib/libg++/include/iomanip.h b/gnu/lib/libg++/include/iomanip.h index bf3d6f4..a87e7bf 100644 --- a/gnu/lib/libg++/include/iomanip.h +++ b/gnu/lib/libg++/include/iomanip.h @@ -42,10 +42,10 @@ template<class TP> class smanip; // TP = Type Param template<class TP> class sapp { ios& (*_f)(ios&, TP); -public: +public: sapp(ios& (*f)(ios&, TP)) : _f(f) {} // - smanip<TP> operator()(TP a) + smanip<TP> operator()(TP a) { return smanip<TP>(_f, a); } }; @@ -55,7 +55,7 @@ template <class TP> class smanip { public: smanip(ios& (*f)(ios&, TP), TP a) : _f(f), _a(a) {} // - friend + friend istream& operator>>(istream& i, const smanip<TP>& m); friend ostream& operator<<(ostream& o, const smanip<TP>& m); @@ -85,11 +85,11 @@ extern template ostream& operator<<(ostream&, const smanip<ios::fmtflags>&); // Input-Stream Manipulators //----------------------------------------------------------------------------- // -template<class TP> class imanip; +template<class TP> class imanip; template<class TP> class iapp { istream& (*_f)(istream&, TP); -public: +public: iapp(istream& (*f)(istream&,TP)) : _f(f) {} // imanip<TP> operator()(TP a) @@ -102,7 +102,7 @@ template <class TP> class imanip { public: imanip(istream& (*f)(istream&, TP), TP a) : _f(f), _a(a) {} // - friend + friend istream& operator>>(istream& i, const imanip<TP>& m) { return (*m._f)( i, m._a); } }; @@ -112,11 +112,11 @@ public: // Output-Stream Manipulators //----------------------------------------------------------------------------- // -template<class TP> class omanip; +template<class TP> class omanip; template<class TP> class oapp { ostream& (*_f)(ostream&, TP); -public: +public: oapp(ostream& (*f)(ostream&,TP)) : _f(f) {} // omanip<TP> operator()(TP a) @@ -141,7 +141,7 @@ public: // // Macro to define an iomanip function, with one argument -// The underlying function is `__iomanip_<name>' +// The underlying function is `__iomanip_<name>' // #define __DEFINE_IOMANIP_FN1(type,param,function) \ extern ios& __iomanip_##function (ios&, param); \ diff --git a/gnu/lib/libg++/include/iostream.h b/gnu/lib/libg++/include/iostream.h index e370be2..4802b37 100644 --- a/gnu/lib/libg++/include/iostream.h +++ b/gnu/lib/libg++/include/iostream.h @@ -1,4 +1,4 @@ -/* This is part of libio/iostream, providing -*- C++ -*- input/output. +/* This is part of libio/iostream, providing -*- C++ -*- input/output. Copyright (C) 1993 Free Software Foundation This file is part of the GNU IO Library. This library is free diff --git a/gnu/lib/libg++/include/iostreamP.h b/gnu/lib/libg++/include/iostreamP.h index 720deb3..e24c93f 100644 --- a/gnu/lib/libg++/include/iostreamP.h +++ b/gnu/lib/libg++/include/iostreamP.h @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 1993 Free Software Foundation This file is part of the GNU IO Library. This library is free diff --git a/gnu/lib/libg++/include/libio.h b/gnu/lib/libg++/include/libio.h index 8a9c25b..f00b730 100644 --- a/gnu/lib/libg++/include/libio.h +++ b/gnu/lib/libg++/include/libio.h @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 1993 Free Software Foundation This file is part of the GNU IO Library. This library is free @@ -185,21 +185,21 @@ struct _IO_FILE { char *_IO_save_end; /* Pointer to end of non-current get area. */ struct _IO_marker *_markers; - + struct _IO_FILE *_chain; - + struct _IO_jump_t *_jumps; /* Jump table */ - + int _fileno; int _blksize; _IO_off_t _offset; - + #define __HAVE_COLUMN /* temporary */ /* 1+column number of pbase(); 0 is unknown. */ unsigned short _cur_column; char _unused; char _shortbuf[1]; - + /* char* _save_gptr; char* _save_egptr; */ }; diff --git a/gnu/lib/libg++/include/libioP.h b/gnu/lib/libg++/include/libioP.h index ca87047..074b9d7 100644 --- a/gnu/lib/libg++/include/libioP.h +++ b/gnu/lib/libg++/include/libioP.h @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 1993 Free Software Foundation This file is part of the GNU IO Library. This library is free diff --git a/gnu/lib/libg++/include/parsestream.h b/gnu/lib/libg++/include/parsestream.h index b168707..c0dfce2 100644 --- a/gnu/lib/libg++/include/parsestream.h +++ b/gnu/lib/libg++/include/parsestream.h @@ -67,7 +67,7 @@ class parsebuf : public streambuf { // Length of current line, not counting either '\n'. int line_length() { return _line_length; } - // Current line - not a copy, so file ops may trash it. + // Current line - not a copy, so file ops may trash it. virtual char* current_line(); virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out); virtual streambuf* setbuf(char* p, int len); diff --git a/gnu/lib/libg++/include/rx.h b/gnu/lib/libg++/include/rx.h index 0c9db1e..edb26b4 100644 --- a/gnu/lib/libg++/include/rx.h +++ b/gnu/lib/libg++/include/rx.h @@ -67,7 +67,7 @@ typedef int (*rx_sp_comparer) (void * a, void * b); typedef int (*rx_sp_comparer) (); #endif -struct rx_sp_node +struct rx_sp_node { void * key; void * data; @@ -135,7 +135,7 @@ struct rx_hash_rules /* Matchers decide what to do by examining a series of these. * Instruction types are described below. */ -struct rx_inx +struct rx_inx { void * inx; void * data; @@ -179,7 +179,7 @@ struct rx /* --------- The remaining fields are for internal use only. --------- */ /* --------- But! they should be initialized to 0. --------- */ /* NODEC is the number of nodes in the NFA with non-epsilon - * orx transitions. + * orx transitions. */ int nodec; @@ -196,7 +196,7 @@ struct rx /* A memo for sets of states in the possible_future lists of an nfa: */ struct rx_hash set_list_memo; - /* The instruction table is indexed by the enum of instructions defined in + /* The instruction table is indexed by the enum of instructions defined in * rxrun.h. The values in the table are used to fill in the `inx' * slot of instruction frames (see rxrun.h). */ @@ -213,7 +213,7 @@ struct rx /* An RX NFA may contain epsilon edges labeled with side effects. * These side effects represent match actions that can not normally be * defined in a `pure' NFA; for example, recording the location at - * which a paren is crossed in a register structure. + * which a paren is crossed in a register structure. * * A matcher is supposed to find a particular path * through the NFA (such as leftmost-longest), and then to execute the @@ -222,7 +222,7 @@ struct rx * backtracking. * * As the NFA is manipulated during matching sets of side effects. - * Simple lists are used to hold side effect lists. + * Simple lists are used to hold side effect lists. */ typedef void * rx_side_effect; @@ -287,7 +287,7 @@ struct rexp_node struct rx_nfa_state { - int id; + int id; struct rx_nfa_edge *edges; struct rx_possible_future *futures; unsigned int is_final:1; @@ -333,17 +333,17 @@ struct rx_possible_future enum rx_opcode { - /* + /* * BACKTRACK_POINT is invoked when a transition results in more * than one possible future. * * There is one occurence of this instruction per transition_class - * structure; that occurence is only ever executed if the + * structure; that occurence is only ever executed if the * transition_class contains a list of more than 1 edge. */ rx_backtrack_point = 0, /* data is (struct transition_class *) */ - /* + /* * RX_DO_SIDE_EFFECTS evaluates the side effects of an epsilon path. * There is one occurence of this instruction per rx_distinct_future. * This instruction is skipped if a rx_distinct_future has no side effects. @@ -351,7 +351,7 @@ enum rx_opcode rx_do_side_effects = rx_backtrack_point + 1, /* data is (struct rx_distinct_future *) */ - /* + /* * RX_CACHE_MISS instructions are stored in rx_distinct_futures whose * destination superstate has been reclaimed (or was never built). * It recomputes the destination superstate. @@ -361,9 +361,9 @@ enum rx_opcode rx_cache_miss = rx_do_side_effects + 1, /* data is (struct rx_distinct_future *) */ - /* + /* * RX_NEXT_CHAR is called to consume the next character and take the - * corresponding transition. This is the only instruction that uses + * corresponding transition. This is the only instruction that uses * the DATA field of the instruction frame instead of DATA_2. * (see EXPLORE_FUTURE in regex.c). */ @@ -373,7 +373,7 @@ enum rx_opcode */ rx_backtrack = rx_next_char + 1, /* no data */ - /* + /* * RX_ERROR_INX is stored only in places that should never be executed. */ rx_error_inx = rx_backtrack + 1, /* Not supposed to occur. */ @@ -390,7 +390,7 @@ extern void * rx_id_instruction_table[rx_num_instructions]; /* If the instruction is `rx_next_char' then data is valid. Otherwise it's 0 * and data_2 is valid. */ -struct rx_inx +struct rx_inx { void * inx; void * data; @@ -431,7 +431,7 @@ struct rx_superset /* Every character occurs in at most one super edge per super-state. * But, that edge might have more than one option, indicating a point - * of non-determinism. + * of non-determinism. */ struct rx_super_edge { @@ -447,7 +447,7 @@ struct rx_super_edge * without warning. To protect a superstate, use LOCK_SUPERSTATE. * * Joe Keane thought of calling these superstates and several people - * have commented on what a good name it is for what they do. + * have commented on what a good name it is for what they do. */ struct rx_superstate { @@ -501,7 +501,7 @@ typedef void (*rx_morecore_fn)(struct rx_cache *); typedef void (*rx_morecore_fn)(); #endif -/* You use this to control the allocation of superstate data +/* You use this to control the allocation of superstate data * during matching. Most of it should be initialized to 0. * * A MORECORE function is necessary. It should allocate @@ -512,10 +512,10 @@ typedef void (*rx_morecore_fn)(); * the system will try to allocate. The default is 128. Batch style * applications that are very regexp intensive should use as high a number * as possible without thrashing. - * + * * The LOCAL_CSET_SIZE is the number of characters in a character set. * It is therefore the number of entries in a superstate transition table. - * Generally, it should be 256. If your character set has 16 bits, + * Generally, it should be 256. If your character set has 16 bits, * it is better to translate your regexps into equivalent 8 bit patterns. */ @@ -523,7 +523,7 @@ struct rx_cache { struct rx_hash_rules superset_hash_rules; - /* Objects are allocated by incrementing a pointer that + /* Objects are allocated by incrementing a pointer that * scans across rx_blocklists. */ struct rx_blocklist * memory; @@ -614,7 +614,7 @@ typedef enum rx_get_burst_return (*rx_get_burst_fn) (struct rx_string_position * pos, void * app_closure, int stop); - + #else typedef enum rx_get_burst_return (*rx_get_burst_fn) (); #endif @@ -628,7 +628,7 @@ enum rx_back_check_return rx_back_check_fail }; -/* Back_check should advance the position it is passed +/* Back_check should advance the position it is passed * over rparen - lparen characters and return pass iff * the characters starting at POS match those indexed * by [LPAREN..RPAREN]. @@ -645,7 +645,7 @@ typedef enum rx_back_check_return unsigned char * translate, void * app_closure, int stop); - + #else typedef enum rx_back_check_return (*rx_back_check_fn) (); #endif @@ -683,7 +683,7 @@ enum rx_search_return /* regex.h - * + * * The remaining declarations replace regex.h. */ @@ -707,7 +707,7 @@ typedef enum REG_EESCAPE, /* Trailing backslash. */ REG_ESUBREG, /* Invalid back reference. */ REG_EBRACK, /* Unmatched left bracket. */ - REG_EPAREN, /* Parenthesis imbalance. */ + REG_EPAREN, /* Parenthesis imbalance. */ REG_EBRACE, /* Unmatched \{. */ REG_BADBR, /* Invalid contents of \{\}. */ REG_ERANGE, /* Invalid range end. */ @@ -741,8 +741,8 @@ enum re_side_effects }; /* These hold paramaters for the kinds of side effects that are possible - * in the supported pattern languages. These include things like the - * numeric bounds of {} operators and the index of paren registers for + * in the supported pattern languages. These include things like the + * numeric bounds of {} operators and the index of paren registers for * subexpression measurement or backreferencing. */ struct re_se_params @@ -761,10 +761,10 @@ struct re_pattern_buffer unsigned int no_sub:1; /* If set, don't return register offsets. */ unsigned int not_bol:1; /* If set, the anchors ('^' and '$') don't */ - unsigned int not_eol:1; /* match at the ends of the string. */ + unsigned int not_eol:1; /* match at the ends of the string. */ unsigned int newline_anchor:1;/* If true, an anchor at a newline matches.*/ unsigned int least_subs:1; /* If set, and returning registers, return - * as few values as possible. Only + * as few values as possible. Only * backreferenced groups and group 0 (the whole * match) will be returned. */ @@ -780,18 +780,18 @@ struct re_pattern_buffer unsigned int is_anchored:1; /* Anchorded by ^? */ unsigned int begbuf_only:1; /* Anchored to char position 0? */ - + /* If REGS_UNALLOCATED, allocate space in the `regs' structure * for `max (RE_NREGS, re_nsub + 1)' groups. * If REGS_REALLOCATE, reallocate space if necessary. - * If REGS_FIXED, use what's there. + * If REGS_FIXED, use what's there. */ #define REGS_UNALLOCATED 0 #define REGS_REALLOCATE 1 #define REGS_FIXED 2 unsigned int regs_allocated:2; - + /* Either a translate table to apply to all characters before * comparing them, or zero for no translation. The translation * is applied to a pattern when it is compiled and to a string @@ -799,11 +799,11 @@ struct re_pattern_buffer */ unsigned char * translate; - /* If this is a valid pointer, it tells rx not to store the extents of + /* If this is a valid pointer, it tells rx not to store the extents of * certain subexpressions (those corresponding to non-zero entries). * Passing 0x1 is the same as passing an array of all ones. Passing 0x0 * is the same as passing an array of all zeros. - * The array should contain as many entries as their are subexps in the + * The array should contain as many entries as their are subexps in the * regexp. */ char * syntax_parens; @@ -820,7 +820,7 @@ struct re_pattern_buffer char *fastmap; unsigned int fastmap_accurate:1; /* These three are internal. */ - unsigned int can_match_empty:1; + unsigned int can_match_empty:1; struct rx_nfa_state * start; /* The nfa starting state. */ /* This is the list of iterator bounds for {lo,hi} constructs. @@ -871,7 +871,7 @@ typedef struct #define RE_BACKSLASH_ESCAPE_IN_LISTS (1) /* If this bit is not set, then + and ? are operators, and \+ and \? are - literals. + literals. If set, then \+ and \? are operators and + and ? are literals. */ #define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1) @@ -887,7 +887,7 @@ typedef struct ^ is an anchor if it is at the beginning of a regular expression or after an open-group or an alternation operator; $ is an anchor if it is at the end of a regular expression, or - before a close-group or an alternation operator. + before a close-group or an alternation operator. This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because POSIX draft 11.2 says that * etc. in leading positions is undefined. @@ -898,7 +898,7 @@ typedef struct /* If this bit is set, then special characters are always special regardless of where they are in the pattern. If this bit is not set, then special characters are special only in - some contexts; otherwise they are ordinary. Specifically, + some contexts; otherwise they are ordinary. Specifically, * + ? and intervals are only special when not after the beginning, open-group, or alternation operator. */ #define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1) @@ -920,7 +920,7 @@ typedef struct #define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1) /* If this bit is set, either \{...\} or {...} defines an - interval, depending on RE_NO_BK_BRACES. + interval, depending on RE_NO_BK_BRACES. If not set, \{, \}, {, and } are literals. */ #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1) @@ -945,7 +945,7 @@ typedef struct If not set, then \<digit> is a back-reference. */ #define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1) -/* If this bit is set, then | is an alternation operator, and \| is literal. +/* If this bit is set, then | is an alternation operator, and \| is literal. If not set, then \| is an alternation operator, and | is literal. */ #define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1) @@ -967,7 +967,7 @@ extern reg_syntax_t re_syntax_options; /* Define combinations of the above bits for the standard possibilities. (The [[[ comments delimit what gets put into the Texinfo file, so - don't delete them!) */ + don't delete them!) */ /* [[[begin syntaxes]]] */ #define RE_SYNTAX_EMACS 0 @@ -1031,7 +1031,7 @@ extern reg_syntax_t re_syntax_options; #ifdef RE_DUP_MAX #undef RE_DUP_MAX #endif -#define RE_DUP_MAX ((1 << 15) - 1) +#define RE_DUP_MAX ((1 << 15) - 1) #if !defined(BSD) || (BSD < 199306) @@ -1044,7 +1044,7 @@ extern reg_syntax_t re_syntax_options; /* If this bit is set, then ignore case when matching. If not set, then case is significant. */ #define REG_ICASE (REG_EXTENDED << 1) - + /* If this bit is set, then anchors do not match at newline characters in the string. If not set, then anchors do match at newlines. */ @@ -1070,7 +1070,7 @@ extern reg_syntax_t re_syntax_options; /* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer, * `re_match_2' returns information about at least this many registers - * the first time a `regs' structure is passed. + * the first time a `regs' structure is passed. * * Also, this is the greatest number of backreferenced subexpressions * allowed in a pattern being matched without caller-supplied registers. @@ -1087,7 +1087,7 @@ extern char rx_version_string[]; #ifdef RX_WANT_RX_DEFS /* This is decls to the interesting subsystems and lower layers - * of rx. Everything which doesn't have a public counterpart in + * of rx. Everything which doesn't have a public counterpart in * regex.c is declared here. */ @@ -1318,7 +1318,7 @@ struct rx_backtrack_frame { char * counter_stack_sp; - /* A frame is used to save the matchers state when it crosses a + /* A frame is used to save the matchers state when it crosses a * backtracking point. The `stk_' fields correspond to variables * in re_search_2 (just strip off thes `stk_'). They are documented * tere. @@ -1331,7 +1331,7 @@ struct rx_backtrack_frame int stk_test_ret; /* This is the list of options left to explore at the backtrack - * point for which this frame was created. + * point for which this frame was created. */ struct rx_distinct_future * df; struct rx_distinct_future * first_df; @@ -1407,15 +1407,15 @@ struct rx_search_state int * best_lpspace; /* in case the user doesn't want these */ int * best_rpspace; /* values, we still need space to store * them. Normally, this memoryis unused - * and the space pointed to by REGS is + * and the space pointed to by REGS is * used instead. */ - + int last_l; /* Highest index of a valid lparen. */ int last_r; /* It's dual. */ - + int * best_lparen; /* This contains the best known register */ - int * best_rparen; /* assignments. + int * best_rparen; /* assignments. * This may point to the same mem as * best_lpspace, or it might point to memory * passed by the caller. @@ -1424,7 +1424,7 @@ struct rx_search_state int best_last_r; - unsigned char * translate; + unsigned char * translate; struct rx_string_position outer_pos; @@ -1443,7 +1443,7 @@ struct rx_search_state rx_get_burst_fn saved_get_burst; rx_back_check_fn saved_back_check; struct re_registers * saved_regs; - + /** ** state for fastmap **/ @@ -1455,23 +1455,23 @@ struct rx_search_state enum rx_fastmap_entry fastmap_resume_pt; /** - ** state for test_match + ** state for test_match **/ /* The current superNFA position of the matcher. */ struct rx_superstate * super; - + /* The matcher interprets a series of instruction frames. * This is the `instruction counter' for the interpretation. */ struct rx_inx * ifr; - + /* We insert a ghost character in the string to prime * the nfa. test_pos.pos, test_pos.str_half, and test_pos.end_half * keep track of the test-match position and string-half. */ unsigned char c; - + /* Position within the string. */ struct rx_string_position test_pos; @@ -1481,7 +1481,7 @@ struct rx_search_state int chunk_bytes; struct rx_stack_chunk * free_chunks; - /* To return from this function, set test_ret and + /* To return from this function, set test_ret and * `goto test_do_return'. * * Possible return values are: @@ -1501,14 +1501,14 @@ struct rx_search_state int test_ret; int could_have_continued; - + #ifdef RX_DEBUG int backtrack_depth; /* There is a search tree with every node as set of deterministic - * transitions in the super nfa. For every branch of a + * transitions in the super nfa. For every branch of a * backtrack point is an edge in the tree. * This counts up a pre-order of nodes in that tree. - * It's saved on the search stack and printed when debugging. + * It's saved on the search stack and printed when debugging. */ int line_no; int lines_found; @@ -1521,7 +1521,7 @@ struct rx_search_state struct rx_inx * saved_this_tr_table; int saved_reg; struct rx_backtrack_frame * saved_bf; - + }; @@ -1536,7 +1536,7 @@ init_fastmap (rxb, search_state) search_state->fastmap = (rxb->fastmap ? (char *)rxb->fastmap : (char *)rx_slowmap); - /* Update the fastmap now if not correct already. + /* Update the fastmap now if not correct already. * When the regexp was compiled, the fastmap was computed * and stored in a bitset. This expands the bitset into a * character array containing 1s and 0s. @@ -1586,7 +1586,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state) * This sentinal will trap the fastmap loop when it reaches the last * valid character in a string half. * - * This must be reset when the fastmap/search loop crosses a string + * This must be reset when the fastmap/search loop crosses a string * boundry, and before returning to the caller. So sometimes, * the fastmap loop is restarted with `continue', othertimes by * `goto init_fastmap_sentinal'. @@ -1605,7 +1605,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state) search_state->fastmap_chr = -1; search_state->fastmap_val = 0; } - + if (search_state->outer_pos.pos >= search_state->outer_pos.end) goto fastmap_hit_bound; else @@ -1629,7 +1629,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state) ++search_state->outer_pos.pos; if (*search_state->outer_pos.pos != search_state->fastmap_chr) return rx_fastmap_ok; - else + else { ++search_state->outer_pos.pos; if (search_state->outer_pos.pos == search_state->outer_pos.end) @@ -1659,7 +1659,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state) --search_state->outer_pos.pos; if ((*search_state->outer_pos.pos != search_state->fastmap_chr) || search_state->fastmap_val) return rx_fastmap_ok; - else + else { --search_state->outer_pos.pos; if (search_state->outer_pos.pos == bound) @@ -1669,12 +1669,12 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state) } } } - + case rx_fastmap_string_break: fastmap_hit_bound: { /* If we hit a bound, it may be time to fetch another burst - * of string, or it may be time to return a continuation to + * of string, or it may be time to return a continuation to * the caller, or it might be time to fail. */ @@ -1692,7 +1692,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state) case rx_get_burst_ok: goto init_fastmap_sentinal; case rx_get_burst_no_more: - /* ...not a string split, simply no more string. + /* ...not a string split, simply no more string. * * When searching backward, running out of string * is reason to quit. @@ -1714,7 +1714,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state) #ifdef emacs /* The `emacs' switch turns on certain matching commands - * that make sense only in Emacs. + * that make sense only in Emacs. */ #include "config.h" #include "lisp.h" @@ -1731,7 +1731,7 @@ fastmap_search (rxb, stop, get_burst, app_closure, search_state) #else /* not RX_RX_MEMDBUG */ /* We used to test for `BSTRING' here, but only GCC and Emacs define - * `BSTRING', as far as I know, and neither of them use this code. + * `BSTRING', as far as I know, and neither of them use this code. */ #if HAVE_STRING_H || STDC_HEADERS #include <string.h> @@ -1767,7 +1767,7 @@ char *realloc (); * This must be nonzero for the wordchar and notwordchar pattern * commands in re_match_2. */ -#ifndef Sword +#ifndef Sword #define Sword 1 #endif @@ -1780,7 +1780,7 @@ RX_DECL char re_syntax_table[CHAR_SET_SIZE]; /* Test if at very beginning or at very end of the virtual concatenation - * of `string1' and `string2'. If only one string, it's `string2'. + * of `string1' and `string2'. If only one string, it's `string2'. */ #define AT_STRINGS_BEG() \ @@ -1799,14 +1799,14 @@ RX_DECL char re_syntax_table[CHAR_SET_SIZE]; * the first character in string2; and if before the beginning of * string2, look at the last character in string1. * - * Assumes `string1' exists, so use in conjunction with AT_STRINGS_BEG (). + * Assumes `string1' exists, so use in conjunction with AT_STRINGS_BEG (). */ #define LETTER_P(POS,OFF) \ ( SYNTAX (fetch_char(POS, OFF, app_closure, stop)) \ == Sword) /* Test if the character at D and the one after D differ with respect - * to being word-constituent. + * to being word-constituent. */ #define AT_WORD_BOUNDARY(d) \ (AT_STRINGS_BEG () || AT_STRINGS_END () || LETTER_P (d,0) != LETTER_P (d, 1)) @@ -1948,17 +1948,17 @@ rx_search (rxb, startpos, range, stop, total_size, = search_state.best_lpspace = search_state.best_rpspace = 0); - + /* figure the number of registers we may need for use in backreferences. - * the number here includes an element for register zero. + * the number here includes an element for register zero. */ search_state.num_regs = rxb->re_nsub + 1; - - + + /* check for out-of-range startpos. */ if ((startpos < 0) || (startpos > total_size)) return rx_search_fail; - + /* fix up range if it might eventually take us outside the string. */ { int endpos; @@ -1968,7 +1968,7 @@ rx_search (rxb, startpos, range, stop, total_size, else if (endpos > total_size) range = total_size - startpos; } - + /* if the search isn't to be a backwards one, don't waste time in a * long search for a pattern that says it is anchored. */ @@ -1979,7 +1979,7 @@ rx_search (rxb, startpos, range, stop, total_size, else range = 1; } - + /* decide whether to use internal or user-provided reg buffers. */ if (!regs || rxb->no_sub) { @@ -1991,7 +1991,7 @@ rx_search (rxb, startpos, range, stop, total_size, search_state.best_rparen = search_state.best_rpspace; } else - { + { /* have the register data arrays been allocated? */ if (rxb->regs_allocated == REGS_UNALLOCATED) { /* no. so allocate them with malloc. we need one @@ -2025,7 +2025,7 @@ rx_search (rxb, startpos, range, stop, total_size, } else if (rxb->regs_allocated != REGS_FIXED) return rx_search_error; - + if (regs->num_regs < search_state.num_regs + 1) { search_state.best_lpspace = @@ -2043,38 +2043,38 @@ rx_search (rxb, startpos, range, stop, total_size, search_state.best_rparen = regs->end; } } - + search_state.lparen = (int *) REGEX_ALLOCATE (search_state.num_regs * sizeof(int )); search_state.rparen = (int *) REGEX_ALLOCATE (search_state.num_regs * sizeof(int )); - + if (! ( search_state.best_rparen && search_state.best_lparen && search_state.lparen && search_state.rparen)) return rx_search_error; - + search_state.best_last_l = search_state.best_last_r = -1; - + search_state.translate = (rxb->translate ? rxb->translate : rx_id_translation); - - - + + + /* - * two nfa's were compiled. + * two nfa's were compiled. * `0' is complete. * `1' faster but gets registers wrong and ends too soon. */ search_state.nfa_choice = (regs && !rxb->least_subs) ? '\0' : '\1'; - + /* we have the option to look for the best match or the first * one we can find. if the user isn't asking for register information, * we don't need to find the best match. */ search_state.first_found = !regs; - + if (range >= 0) { search_state.outer_pos.search_end = MIN (total_size, startpos + range) + 1; @@ -2085,20 +2085,20 @@ rx_search (rxb, startpos, range, stop, total_size, search_state.outer_pos.search_end = MAX(-1, startpos + range); search_state.outer_pos.search_direction = -1; } - + /* the vacuous search always turns up nothing. */ if ((search_state.outer_pos.search_direction == 1) ? (startpos > search_state.outer_pos.search_end) : (startpos < search_state.outer_pos.search_end)) return rx_search_fail; - + /* now we build the starting state of the supernfa. */ { struct rx_superset * start_contents; struct rx_nfa_state_set * start_nfa_set; - + /* we presume here that the nfa start state has only one - * possible future with no side effects. + * possible future with no side effects. */ start_nfa_set = rxb->start->futures->destset; if ( rxb->rx.start_set @@ -2110,10 +2110,10 @@ rx_search (rxb, startpos, range, stop, total_size, rx_superstate_eclosure_union (&rxb->rx, rx_superset_cons (&rxb->rx, 0, 0), start_nfa_set); - + if (!start_contents) return rx_search_fail; - + start_contents->starts_for = &rxb->rx; rxb->rx.start_set = start_contents; } @@ -2126,7 +2126,7 @@ rx_search (rxb, startpos, range, stop, total_size, else { rx_protect_superset (&rxb->rx, start_contents); - + search_state.start_super = rx_superstate (&rxb->rx, start_contents); if (!search_state.start_super) return rx_search_fail; @@ -2134,9 +2134,9 @@ rx_search (rxb, startpos, range, stop, total_size, rx_release_superset (&rxb->rx, start_contents); } } - - - + + + ( search_state.outer_pos.string = search_state.outer_pos.end = 0); @@ -2166,8 +2166,8 @@ rx_search (rxb, startpos, range, stop, total_size, break; } } - - /* now the fastmap loop has brought us to a plausible + + /* now the fastmap loop has brought us to a plausible * starting point for a match. so, it's time to run the * nfa and see if a match occured. */ @@ -2225,12 +2225,12 @@ rx_search (rxb, startpos, range, stop, total_size, : (startpos > search_state.outer_pos.search_end)) goto pseudo_do; - + finish: uninit_fastmap (rxb, &search_state); if (search_state.start_super) rx_unlock_superstate (&rxb->rx, search_state.start_super); - + #ifdef regex_malloc if (search_state.lparen) free (search_state.lparen); if (search_state.rparen) free (search_state.rparen); @@ -2255,7 +2255,7 @@ rx_search (rxb, startpos, range, stop, total_size, search_state.lparen[0] = startpos; search_state.super = search_state.start_super; search_state.c = search_state.nfa_choice; - search_state.test_pos.pos = search_state.outer_pos.pos - 1; + search_state.test_pos.pos = search_state.outer_pos.pos - 1; search_state.test_pos.string = search_state.outer_pos.string; search_state.test_pos.end = search_state.outer_pos.end; search_state.test_pos.offset = search_state.outer_pos.offset; @@ -2272,8 +2272,8 @@ rx_search (rxb, startpos, range, stop, total_size, search_state.free_chunks = 0; search_state.test_ret = rx_test_line_finished; search_state.could_have_continued = 0; - } - /* This is while (1)...except that the body of the loop is interrupted + } + /* This is while (1)...except that the body of the loop is interrupted * by some alternative entry points. */ pseudo_while_1: @@ -2288,42 +2288,42 @@ rx_search (rxb, startpos, range, stop, total_size, case rx_test_start: #ifdef RX_DEBUG /* There is a search tree with every node as set of deterministic - * transitions in the super nfa. For every branch of a + * transitions in the super nfa. For every branch of a * backtrack point is an edge in the tree. * This counts up a pre-order of nodes in that tree. - * It's saved on the search stack and printed when debugging. + * It's saved on the search stack and printed when debugging. */ search_state.line_no = 0; search_state.lines_found = 0; #endif - + top_of_cycle: - /* A superstate is basicly a transition table, indexed by - * characters from the string being tested, and containing + /* A superstate is basicly a transition table, indexed by + * characters from the string being tested, and containing * RX_INX (`instruction frame') structures. */ search_state.ifr = &search_state.super->transitions [search_state.c]; - + recurse_test_match: /* This is the point to which control is sent when the * test matcher `recurses'. Before jumping here, some variables * need to be saved on the stack and the next instruction frame * has to be computed. */ - + restart: /* Some instructions don't advance the matcher, but just * carry out some side effects and fetch a new instruction. * To dispatch that new instruction, `goto restart'. */ - + { struct rx_inx * next_tr_table; struct rx_inx * this_tr_table; - /* The fastest route through the loop is when the instruction + /* The fastest route through the loop is when the instruction * is RX_NEXT_CHAR. This case is detected when SEARCH_STATE.IFR->DATA * is non-zero. In that case, it points to the next - * superstate. + * superstate. * * This allows us to not bother fetching the bytecode. */ @@ -2335,19 +2335,19 @@ rx_search (rxb, startpos, range, stop, total_size, if (rx_debug_trace) { struct rx_superset * setp; - + fprintf (stderr, "%d %d>> re_next_char @ %d (%d)", search_state.line_no, search_state.backtrack_depth, (search_state.test_pos.pos - search_state.test_pos.string + search_state.test_pos.offset), search_state.c); - + search_state.super = ((struct rx_superstate *) ((char *)this_tr_table - ((unsigned long) ((struct rx_superstate *)0)->transitions))); - + setp = search_state.super->contents; fprintf (stderr, " superstet (rx=%d, &=%x: ", rxb->rx.rx_id, setp); @@ -2374,22 +2374,22 @@ rx_search (rxb, startpos, range, stop, total_size, search_state.saved_next_tr_table = next_tr_table; test_pc = rx_test_cache_hit_loop; goto test_return_continuation; - + resume_continuation_1: /* Continuation one jumps here to do its work: */ search_state.saved_this_tr_table = this_tr_table; search_state.saved_next_tr_table = next_tr_table; goto try_burst_1; - + case rx_get_burst_ok: /* get_burst succeeded...keep going */ break; - + case rx_get_burst_no_more: search_state.test_ret = rx_test_line_finished; search_state.could_have_continued = 1; goto test_do_return; - + case rx_get_burst_error: /* An error... */ search_state.test_ret = rx_test_internal_error; @@ -2400,8 +2400,8 @@ rx_search (rxb, startpos, range, stop, total_size, search_state.ifr = this_tr_table + search_state.c; next_tr_table = (struct rx_inx *)search_state.ifr->data; } /* Fast loop through cached transition tables */ - - /* Here when we ran out of cached next-char transitions. + + /* Here when we ran out of cached next-char transitions. * So, it will be necessary to do a more expensive * dispatch on the current instruction. The superstate * pointer is allowed to become invalid during next-char @@ -2413,7 +2413,7 @@ rx_search (rxb, startpos, range, stop, total_size, - ((unsigned long) ((struct rx_superstate *)0)->transitions))); } - + /* We've encountered an instruction other than next-char. * Dispatch that instruction: */ @@ -2422,13 +2422,13 @@ rx_search (rxb, startpos, range, stop, total_size, if (rx_debug_trace) { struct rx_superset * setp = search_state.super->contents; - + fprintf (stderr, "%d %d>> %s @ %d (%d)", search_state.line_no, search_state.backtrack_depth, inx_names[inx], (search_state.test_pos.pos - search_state.test_pos.string + (test_pos.half == 0 ? 0 : size1)), search_state.c); - + fprintf (stderr, " superstet (rx=%d, &=%x: ", rxb->rx.rx_id, setp); while (setp) @@ -2442,8 +2442,8 @@ rx_search (rxb, startpos, range, stop, total_size, switch ((enum rx_opcode)inx) { case rx_do_side_effects: - - /* RX_DO_SIDE_EFFECTS occurs when we cross epsilon + + /* RX_DO_SIDE_EFFECTS occurs when we cross epsilon * edges associated with parentheses, backreferencing, etc. */ { @@ -2463,7 +2463,7 @@ rx_search (rxb, startpos, range, stop, total_size, if (rx_debug_trace) { struct rx_superset * setp = search_state.super->contents; - + fprintf (stderr, "....%d %d>> %s\n", search_state.line_no, search_state.backtrack_depth, efnames[-effect]); @@ -2590,7 +2590,7 @@ rx_search (rxb, startpos, range, stop, total_size, else goto test_do_return; } - + case re_se_try: /* This is the first side effect in every * expression. @@ -2598,7 +2598,7 @@ rx_search (rxb, startpos, range, stop, total_size, * FOR NO GOOD REASON...get rid of it... */ break; - + case re_se_pushpos: { int urhere = @@ -2621,7 +2621,7 @@ rx_search (rxb, startpos, range, stop, total_size, cf->cdr = old_cf; break; } - + case re_se_chkpos: { int urhere = @@ -2637,13 +2637,13 @@ rx_search (rxb, startpos, range, stop, total_size, break; } break; - + case re_se_poppos: POP(search_state.counter_stack, sizeof (struct rx_counter_frame)); break; - - + + case re_se_at_dot: case re_se_syntax: case re_se_not_syntax: @@ -2677,10 +2677,10 @@ rx_search (rxb, startpos, range, stop, total_size, switch (rxb->se_params [effect].se) { case re_se_win: - /* This side effect indicates that we've - * found a match, though not necessarily the - * best match. This is a fancy assignment to - * register 0 unless the caller didn't + /* This side effect indicates that we've + * found a match, though not necessarily the + * best match. This is a fancy assignment to + * register 0 unless the caller didn't * care about registers. In which case, * this stops the match. */ @@ -2689,7 +2689,7 @@ rx_search (rxb, startpos, range, stop, total_size, ((int)(search_state.test_pos.pos - search_state.test_pos.string) + search_state.test_pos.offset); - + if ( (search_state.best_last_r < 0) || (urhere + 1 > search_state.best_rparen[0])) { @@ -2705,7 +2705,7 @@ rx_search (rxb, startpos, range, stop, total_size, search_state.best_rparen[0] = urhere + 1; search_state.best_last_r = search_state.last_r; } - /* If we're not reporting the match-length + /* If we're not reporting the match-length * or other register info, we need look no * further. */ @@ -2722,7 +2722,7 @@ rx_search (rxb, startpos, range, stop, total_size, ((int)(search_state.test_pos.pos - search_state.test_pos.string) + search_state.test_pos.offset); - + int reg = rxb->se_params [effect].op1; #if 0 if (reg > search_state.last_l) @@ -2742,7 +2742,7 @@ rx_search (rxb, startpos, range, stop, total_size, } break; } - + case re_se_rparen: { int urhere = @@ -2759,14 +2759,14 @@ rx_search (rxb, startpos, range, stop, total_size, } break; } - + case re_se_backref: { int reg = rxb->se_params [effect].op1; if ( reg > search_state.last_r || search_state.rparen[reg] < 0) goto test_do_return; - + { int backref_status; check_backreference: @@ -2873,7 +2873,7 @@ rx_search (rxb, startpos, range, stop, total_size, search_state.ifr = &df->future_frame; goto restart; } - + case rx_backtrack_point: { /* A backtrack point indicates that we've reached a @@ -2883,18 +2883,18 @@ rx_search (rxb, startpos, range, stop, total_size, * A backtracking strategy is used. We keep track of what * registers are valid so we can erase side effects. * - * First, make sure there is some stack space to hold + * First, make sure there is some stack space to hold * our state. */ - + struct rx_backtrack_frame * bf; - + PUSH(search_state.backtrack_stack, search_state.backtrack_frame_bytes); #ifdef RX_DEBUG ++search_state.backtrack_depth; #endif - + bf = ((struct rx_backtrack_frame *) search_state.backtrack_stack->sp); { @@ -2929,30 +2929,30 @@ rx_search (rxb, startpos, range, stop, total_size, stk[x] = search_state.rparen[x]; } } - + /* Here is a while loop whose body is mainly a function * call and some code to handle a return from that * function. * * From here on for the rest of `case backtrack_point' it - * is unsafe to assume that the search_state copies of + * is unsafe to assume that the search_state copies of * variables saved on the backtracking stack are valid * -- so read their values from the backtracking stack. * * This lets us use one generation fewer stack saves in * the call-graph of a search. */ - + while_non_det_options: #ifdef RX_DEBUG ++search_state.lines_found; if (rx_debug_trace) fprintf (stderr, "@@@ %d calls %d @@@\n", search_state.line_no, search_state.lines_found); - + search_state.line_no = search_state.lines_found; #endif - + if (bf->df->next_same_super_edge[0] == bf->first_df) { /* This is a tail-call optimization -- we don't recurse @@ -2961,7 +2961,7 @@ rx_search (rxb, startpos, range, stop, total_size, search_state.ifr = (bf->df->effects ? &bf->df->side_effects_frame : &bf->df->future_frame); - + rx_unlock_superstate (&rxb->rx, search_state.super); POP(search_state.backtrack_stack, search_state.backtrack_frame_bytes); @@ -2983,14 +2983,14 @@ rx_search (rxb, startpos, range, stop, total_size, cf->val = old_cf->val; cf->inherited_from = old_cf; cf->cdr = 0; - } + } /* `Call' this test-match block */ search_state.ifr = (bf->df->effects ? &bf->df->side_effects_frame : &bf->df->future_frame); goto recurse_test_match; } - + /* Returns in this block are accomplished by * goto test_do_return. There are two cases. * If there is some search-stack left, @@ -2998,9 +2998,9 @@ rx_search (rxb, startpos, range, stop, total_size, * If there is no search-stack left, then * we should return to the fastmap/search loop. */ - + test_do_return: - + if (!search_state.backtrack_stack) { #ifdef RX_DEBUG @@ -3008,18 +3008,18 @@ rx_search (rxb, startpos, range, stop, total_size, fprintf (stderr, "!!! %d bails returning %d !!!\n", search_state.line_no, search_state.test_ret); #endif - + /* No more search-stack -- this test is done. */ if (search_state.test_ret) goto return_from_test_match; else goto error_in_testing_match; } - - /* Returning from a recursive call to + + /* Returning from a recursive call to * the test match block: */ - + bf = ((struct rx_backtrack_frame *) search_state.backtrack_stack->sp); #ifdef RX_DEBUG @@ -3029,7 +3029,7 @@ rx_search (rxb, startpos, range, stop, total_size, search_state.test_ret, bf->stk_search_state.line_no); #endif - + while (search_state.counter_stack && (!bf->counter_stack_sp || (bf->counter_stack_sp @@ -3038,15 +3038,15 @@ rx_search (rxb, startpos, range, stop, total_size, POP(search_state.counter_stack, sizeof (struct rx_counter_frame)); } - + if (search_state.test_ret == rx_test_error) { POP (search_state.backtrack_stack, search_state.backtrack_frame_bytes); goto test_do_return; } - - /* If a non-longest match was found and that is good + + /* If a non-longest match was found and that is good * enough, return immediately. */ if ( (search_state.test_ret == rx_test_found_first) @@ -3057,7 +3057,7 @@ rx_search (rxb, startpos, range, stop, total_size, search_state.backtrack_frame_bytes); goto test_do_return; } - + search_state.test_ret = bf->stk_test_ret; search_state.last_l = bf->stk_last_l; search_state.last_r = bf->stk_last_r; @@ -3067,7 +3067,7 @@ rx_search (rxb, startpos, range, stop, total_size, #ifdef RX_DEBUG search_state.line_no = bf->stk_search_state.line_no; #endif - + if (rxb->match_regs_on_stack) { int x; @@ -3079,7 +3079,7 @@ rx_search (rxb, startpos, range, stop, total_size, for (x = 0; x <= search_state.last_r; ++x) search_state.rparen[x] = stk[x]; } - + { int x; try_burst_2: @@ -3107,8 +3107,8 @@ rx_search (rxb, startpos, range, stop, total_size, search_state.test_pos = bf->stk_test_pos; goto while_non_det_options; } - - + + case rx_cache_miss: /* Because the superstate NFA is lazily constructed, * and in fact may erode from underneath us, we sometimes @@ -3125,14 +3125,14 @@ rx_search (rxb, startpos, range, stop, total_size, goto test_do_return; } goto restart; - + case rx_backtrack: /* RX_BACKTRACK means that we've reached the empty * superstate, indicating that match can't succeed * from this point. */ goto test_do_return; - + case rx_next_char: case rx_error_inx: case rx_num_instructions: @@ -3141,21 +3141,21 @@ rx_search (rxb, startpos, range, stop, total_size, } goto pseudo_while_1; } - - /* Healthy exits from the test-match loop do a - * `goto return_from_test_match' On the other hand, + + /* Healthy exits from the test-match loop do a + * `goto return_from_test_match' On the other hand, * we might end up here. */ error_in_testing_match: test_state = rx_test_error; goto test_returns_to_search; - + /***** fastmap/search loop body * considering the results testing for a match */ - + return_from_test_match: - + if (search_state.best_last_l >= 0) { if (regs && (regs->start != search_state.best_lparen)) @@ -3185,7 +3185,7 @@ rx_search (rxb, startpos, range, stop, total_size, test_state = rx_test_fail; goto test_returns_to_search; } - + test_return_continuation: search_state.test_match_resume_pt = test_pc; test_state = rx_test_continuation; @@ -3203,16 +3203,16 @@ rx_search (rxb, startpos, range, stop, total_size, /* Integers are used to represent side effects. * * Simple side effects are given negative integer names by these enums. - * + * * Non-negative names are reserved for complex effects. * - * Complex effects are those that take arguments. For example, + * Complex effects are those that take arguments. For example, * a register assignment associated with a group is complex because * it requires an argument to tell which group is being matched. - * + * * The integer name of a complex effect is an index into rxb->se_params. */ - + RX_DEF_SE(1, re_se_try, = -1) /* Epsilon from start state */ RX_DEF_SE(0, re_se_pushback, = re_se_try - 1) @@ -3228,15 +3228,15 @@ rx_search (rxb, startpos, range, stop, total_size, RX_DEF_SE(1, re_se_begbuf, = re_se_not_syntax - 1) /* match beginning of buffer */ RX_DEF_SE(1, re_se_hat, = re_se_begbuf - 1) /* match beginning of line */ - RX_DEF_SE(1, re_se_wordbeg, = re_se_hat - 1) + RX_DEF_SE(1, re_se_wordbeg, = re_se_hat - 1) RX_DEF_SE(1, re_se_wordbound, = re_se_wordbeg - 1) RX_DEF_SE(1, re_se_notwordbound, = re_se_wordbound - 1) RX_DEF_SE(1, re_se_wordend, = re_se_notwordbound - 1) RX_DEF_SE(1, re_se_endbuf, = re_se_wordend - 1) - /* This fails except at the end of a line. - * It deserves to go here since it is typicly one of the last steps + /* This fails except at the end of a line. + * It deserves to go here since it is typicly one of the last steps * in a match. */ RX_DEF_SE(1, re_se_dollar, = re_se_endbuf - 1) @@ -3244,7 +3244,7 @@ rx_search (rxb, startpos, range, stop, total_size, /* Simple effects: */ RX_DEF_SE(1, re_se_fail, = re_se_dollar - 1) - /* Complex effects. These are used in the 'se' field of + /* Complex effects. These are used in the 'se' field of * a struct re_se_params. Indexes into the se array * are stored as instructions on nfa edges. */ @@ -3252,7 +3252,7 @@ rx_search (rxb, startpos, range, stop, total_size, RX_DEF_CPLX_SE(1, re_se_lparen, = re_se_win + 1) RX_DEF_CPLX_SE(1, re_se_rparen, = re_se_lparen + 1) RX_DEF_CPLX_SE(0, re_se_backref, = re_se_rparen + 1) - RX_DEF_CPLX_SE(0, re_se_iter, = re_se_backref + 1) + RX_DEF_CPLX_SE(0, re_se_iter, = re_se_backref + 1) RX_DEF_CPLX_SE(0, re_se_end_iter, = re_se_iter + 1) RX_DEF_CPLX_SE(0, re_se_tv, = re_se_end_iter + 1) diff --git a/gnu/lib/libg++/include/std.h b/gnu/lib/libg++/include/std.h index 069b522..dcafc35 100644 --- a/gnu/lib/libg++/include/std.h +++ b/gnu/lib/libg++/include/std.h @@ -1,5 +1,5 @@ // This may look like C code, but it is really -*- C++ -*- -/* +/* Copyright (C) 1988, 1992 Free Software Foundation written by Doug Lea (dl@rocky.oswego.edu) @@ -24,7 +24,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <stdio.h> +#include <stdio.h> #include <errno.h> #include <fcntl.h> @@ -32,4 +32,4 @@ extern "C" { int strcasecmp _G_ARGS((const char*, const char*)); } -#endif +#endif diff --git a/gnu/lib/libg++/include/stream.h b/gnu/lib/libg++/include/stream.h index 488f367..f9569a5 100644 --- a/gnu/lib/libg++/include/stream.h +++ b/gnu/lib/libg++/include/stream.h @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 1993 Free Software Foundation This file is part of the GNU IO Library. This library is free diff --git a/gnu/lib/libg++/include/streambuf.h b/gnu/lib/libg++/include/streambuf.h index efbab12..7a3df54 100644 --- a/gnu/lib/libg++/include/streambuf.h +++ b/gnu/lib/libg++/include/streambuf.h @@ -314,7 +314,7 @@ struct streambuf : public _IO_FILE { // protected?? void setp(char* p, char* ep) { _IO_write_base=_IO_write_ptr=p; _IO_write_end=ep; } void setg(char* eb, char* g, char *eg) { - if (_IO_file_flags & _IO_IN_BACKUP) _IO_free_backup_area(this); + if (_IO_file_flags & _IO_IN_BACKUP) _IO_free_backup_area(this); _IO_read_base = eb; _IO_read_ptr = g; _IO_read_end = eg; } char *shortbuf() { return _shortbuf; } @@ -336,7 +336,7 @@ struct streambuf : public _IO_FILE { // protected?? void unsave_markers(); // Make all streammarkers !saving(). int put_mode() { return _flags & _IO_CURRENTLY_PUTTING; } int switch_to_get_mode(); - + streambuf(int flags=0); public: static int flush_all(); diff --git a/gnu/lib/libg++/include/strfile.h b/gnu/lib/libg++/include/strfile.h index bff25b1..950f2f5 100644 --- a/gnu/lib/libg++/include/strfile.h +++ b/gnu/lib/libg++/include/strfile.h @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 1993 Free Software Foundation This file is part of the GNU IO Library. This library is free |