Updated to 2.4
This commit is contained in:
parent
121edb2307
commit
ea1ba63613
|
@ -1,3 +1,3 @@
|
|||
libg++ version 2.3.90.
|
||||
libg++ version 2.4
|
||||
|
||||
complete, unmodified libg++ sources are available from prep.ai.mit.edu.
|
||||
|
|
|
@ -305,8 +305,11 @@ int filebuf::sync()
|
|||
streampos delta = gptr() - egptr();
|
||||
if (in_backup())
|
||||
delta -= eGptr() - Gbase();
|
||||
if (sys_seek(delta, ios::cur) == EOF)
|
||||
return EOF;
|
||||
_G_fpos_t new_pos = sys_seek(delta, ios::cur);
|
||||
if (new_pos == EOF)
|
||||
return EOF;
|
||||
_fb._offset = new_pos;
|
||||
setg(eback(), gptr(), gptr());
|
||||
}
|
||||
// FIXME: Cleanup - can this be shared?
|
||||
// setg(base(), ptr, ptr);
|
||||
|
|
|
@ -279,7 +279,7 @@ literal:
|
|||
* that suppress this.
|
||||
*/
|
||||
if ((flags & NOSKIP) == 0) {
|
||||
n = *_gptr;
|
||||
n = (unsigned char)*_gptr;
|
||||
while (isspace(n)) {
|
||||
_gptr++;
|
||||
nread++;
|
||||
|
@ -339,7 +339,7 @@ literal:
|
|||
/* take only those things in the class */
|
||||
if (flags & SUPPRESS) {
|
||||
n = 0;
|
||||
while (ccltab[*_gptr]) {
|
||||
while (ccltab[(unsigned char)*_gptr]) {
|
||||
n++, _gptr++;
|
||||
if (--width == 0)
|
||||
break;
|
||||
|
@ -354,7 +354,7 @@ literal:
|
|||
goto match_failure;
|
||||
} else {
|
||||
p0 = p = va_arg(ap, char *);
|
||||
while (ccltab[*_gptr]) {
|
||||
while (ccltab[(unsigned char)*_gptr]) {
|
||||
*p++ = *_gptr++;
|
||||
if (--width == 0)
|
||||
break;
|
||||
|
@ -380,7 +380,7 @@ literal:
|
|||
width = ~0;
|
||||
if (flags & SUPPRESS) {
|
||||
n = 0;
|
||||
while (!isspace(*_gptr)) {
|
||||
while (!isspace((unsigned char)*_gptr)) {
|
||||
n++, _gptr++;
|
||||
if (--width == 0)
|
||||
break;
|
||||
|
@ -392,7 +392,7 @@ literal:
|
|||
nread += n;
|
||||
} else {
|
||||
p0 = p = va_arg(ap, char *);
|
||||
while (!isspace(*_gptr)) {
|
||||
while (!isspace((unsigned char)*_gptr)) {
|
||||
*p++ = *_gptr++;
|
||||
if (--width == 0)
|
||||
break;
|
||||
|
@ -413,7 +413,7 @@ literal:
|
|||
width = sizeof(buf) - 1;
|
||||
flags |= SIGNOK | NDIGITS | NZDIGITS;
|
||||
for (p = buf; width; width--) {
|
||||
c = *_gptr;
|
||||
c = (unsigned char)*_gptr;
|
||||
/*
|
||||
* Switch on the character; `goto ok'
|
||||
* if we accept it as a part of number.
|
||||
|
@ -544,7 +544,7 @@ literal:
|
|||
width = sizeof(buf) - 1;
|
||||
flags |= SIGNOK | NDIGITS | DPTOK | EXPOK;
|
||||
for (p = buf; width; width--) {
|
||||
c = *_gptr;
|
||||
c = (unsigned char)*_gptr;
|
||||
/*
|
||||
* This code mimicks the integer conversion
|
||||
* code, but is much simpler.
|
||||
|
|
|
@ -172,6 +172,12 @@ void strstreambuf::init_static(char *ptr, int size, char *pstart)
|
|||
_len = egptr() - ptr;
|
||||
}
|
||||
|
||||
void strstreambuf::init_static (const char *ptr, int size)
|
||||
{
|
||||
init_static((char*)ptr, size, NULL);
|
||||
xsetflags(_S_NO_WRITES);
|
||||
}
|
||||
|
||||
strstreambuf::~strstreambuf()
|
||||
{
|
||||
if (_base && !(_flags & _S_USER_BUF))
|
||||
|
|
|
@ -30,8 +30,8 @@ class strstreambuf : public backupbuf {
|
|||
_free_type _free_buffer;
|
||||
void init_dynamic(_alloc_type alloc, _free_type free,
|
||||
int initial_size = 128);
|
||||
void init_const() { xsetflags(_S_NO_WRITES); }
|
||||
void init_static(char *ptr, int size, char *pstart);
|
||||
void init_static(const char *ptr, int size);
|
||||
protected:
|
||||
int is_static() const { return _allocate_buffer == (_alloc_type)0; }
|
||||
virtual int overflow(int = EOF);
|
||||
|
@ -48,14 +48,14 @@ class strstreambuf : public backupbuf {
|
|||
strstreambuf(unsigned char *ptr, int size, unsigned char *pstart = NULL)
|
||||
{ init_static((char*)ptr, size, (char*)pstart); }
|
||||
strstreambuf(const char *ptr, int size)
|
||||
{ init_static((char*)ptr, size, NULL); init_const(); }
|
||||
{ init_static(ptr, size); }
|
||||
strstreambuf(const unsigned char *ptr, int size)
|
||||
{ init_static((char*)ptr, size, NULL); init_const(); }
|
||||
{ init_static((const char*)ptr, size); }
|
||||
#ifndef _G_BROKEN_SIGNED_CHAR
|
||||
strstreambuf(signed char *ptr, int size, signed char *pstart = NULL)
|
||||
{ init_static((char*)ptr, size, (char*)pstart); }
|
||||
strstreambuf(const signed char *ptr, int size)
|
||||
{ init_static((char*)ptr, size, NULL); init_const(); }
|
||||
{ init_static((const char*)ptr, size); }
|
||||
#endif
|
||||
// Note: frozen() is always true if is_static().
|
||||
int frozen() { return _flags & _S_USER_BUF ? 1 : 0; }
|
||||
|
|
|
@ -43,7 +43,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|||
#define Fix32_fs ((double)((unsigned long)(1 << 31)))
|
||||
|
||||
#define Fix32_msb ((unsigned long)(1 << 31))
|
||||
#define Fix32_m_max ((1 << 31) - 1)
|
||||
#define Fix32_m_max ((long)((1 << 31) - 1))
|
||||
#define Fix32_m_min ((long)(1 << 31))
|
||||
|
||||
#define Fix32_mult Fix32_fs
|
||||
|
|
|
@ -197,17 +197,16 @@ public:
|
|||
|
||||
// coercion & conversion
|
||||
|
||||
int fits_in_long() const;
|
||||
int fits_in_double() const;
|
||||
int fits_in_long() const { return Iislong(rep); }
|
||||
int fits_in_double() const { return Iisdouble(rep); }
|
||||
|
||||
#ifdef __GNUC__
|
||||
// There two operators cause a number of ambiguities, and will
|
||||
// probably be removed in a future version.
|
||||
operator long() const;
|
||||
operator double() const;
|
||||
#if 0
|
||||
// There two operators cause a number of ambiguities.
|
||||
operator long() const { return Itolong(rep); }
|
||||
operator double() const { return Itodouble(rep); }
|
||||
#endif
|
||||
long as_long() const;
|
||||
double as_double() const;
|
||||
long as_long() const { return Itolong(rep); }
|
||||
double as_double() const { return Itodouble(rep); }
|
||||
|
||||
friend char* Itoa(const Integer& x, int base = 10, int width = 0);
|
||||
friend Integer atoI(const char* s, int base = 10);
|
||||
|
@ -308,45 +307,11 @@ inline void Integer::operator = (long y)
|
|||
rep = Icopy_long(rep, y);
|
||||
}
|
||||
|
||||
inline long Integer::as_long() const
|
||||
{
|
||||
return Itolong(rep);
|
||||
}
|
||||
|
||||
#ifdef __GNUC__
|
||||
inline Integer::operator long() const
|
||||
{
|
||||
return Itolong(rep);
|
||||
}
|
||||
#endif
|
||||
|
||||
inline int Integer::initialized() const
|
||||
{
|
||||
return rep != 0;
|
||||
}
|
||||
|
||||
inline int Integer::fits_in_long() const
|
||||
{
|
||||
return Iislong(rep);
|
||||
}
|
||||
|
||||
inline double Integer::as_double() const
|
||||
{
|
||||
return Itodouble(rep);
|
||||
}
|
||||
|
||||
#ifdef __GNUC__
|
||||
inline Integer::operator double() const
|
||||
{
|
||||
return Itodouble(rep);
|
||||
}
|
||||
#endif
|
||||
|
||||
inline int Integer::fits_in_double() const
|
||||
{
|
||||
return Iisdouble(rep);
|
||||
}
|
||||
|
||||
// procedural versions
|
||||
|
||||
inline int compare(const Integer& x, const Integer& y)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
LIB= g++
|
||||
CC= gcc
|
||||
SRCS= AllocRing.cc Obstack.cc builtin.cc \
|
||||
regex.cc Regex.cc String.cc Integer.cc Rational.cc Complex.cc Random.cc \
|
||||
BitSet.cc BitString.cc LogNorm.cc SmplHist.cc SmplStat.cc \
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* AUTOMATICALLY GENERATED; DO NOT EDIT! */
|
||||
#ifndef _G_config_h
|
||||
#define _G_config_h
|
||||
#define _G_LIB_VERSION "2.3.90"
|
||||
#define _G_LIB_VERSION "2.4"
|
||||
#define _G_NAMES_HAVE_UNDERSCORE 1
|
||||
#define _G_DOLLAR_IN_LABEL 1
|
||||
#define _G_HAVE_ST_BLKSIZE 1
|
||||
|
|
|
@ -224,7 +224,7 @@ enum regexpcode
|
|||
|
||||
/* Store NUMBER in two contiguous bytes starting at DESTINATION. */
|
||||
#define STORE_NUMBER(destination, number) \
|
||||
{ (destination)[0] = (number) & 0377; \
|
||||
{ (destination)[0] = (char)((number) & 0377); \
|
||||
(destination)[1] = (number) >> 8; }
|
||||
|
||||
/* Same as STORE_NUMBER, except increment the destination pointer to
|
||||
|
@ -2551,16 +2551,12 @@ bcmp_translate (char *s1, char *s2, int len, unsigned char *translate)
|
|||
|
||||
/* Entry points compatible with 4.2 BSD regex library. */
|
||||
|
||||
#ifndef emacs
|
||||
#if 0
|
||||
|
||||
static struct re_pattern_buffer re_comp_buf;
|
||||
|
||||
char *
|
||||
#ifndef __386BSD__
|
||||
re_comp (char *s)
|
||||
#else
|
||||
re_comp (const char *s)
|
||||
#endif
|
||||
{
|
||||
if (!s)
|
||||
{
|
||||
|
@ -2581,11 +2577,7 @@ re_comp (const char *s)
|
|||
}
|
||||
|
||||
int
|
||||
#ifndef __386BSD__
|
||||
re_exec (char *s)
|
||||
#else
|
||||
re_exec (const char *s)
|
||||
#endif
|
||||
{
|
||||
int len = strlen (s);
|
||||
return 0 <= re_search (&re_comp_buf, s, len, 0, len,
|
||||
|
|
|
@ -236,13 +236,10 @@ extern int re_match (struct re_pattern_buffer *, char *, int, int,
|
|||
extern int re_match_2 (struct re_pattern_buffer *, char *, int,
|
||||
char *, int, int, struct re_registers *, int);
|
||||
|
||||
#if 0
|
||||
/* 4.2 bsd compatibility. */
|
||||
#if !defined (__386BSD__)
|
||||
extern char *re_comp (char *);
|
||||
extern int re_exec (char *);
|
||||
#else
|
||||
extern char *re_comp (const char *);
|
||||
extern int re_exec (const char *);
|
||||
#endif
|
||||
|
||||
#else /* !__STDC__ */
|
||||
|
@ -254,9 +251,11 @@ extern void re_compile_fastmap ();
|
|||
extern int re_search (), re_search_2 ();
|
||||
extern int re_match (), re_match_2 ();
|
||||
|
||||
#if 0
|
||||
/* 4.2 bsd compatibility. */
|
||||
extern char *re_comp ();
|
||||
extern int re_exec ();
|
||||
#endif
|
||||
|
||||
#endif /* __STDC__ */
|
||||
|
||||
|
|
Loading…
Reference in New Issue