summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorpaul <paul@NetBSD.org>1993-07-16 03:31:54 +0000
committerpaul <paul@NetBSD.org>1993-07-16 03:31:54 +0000
commitea1ba6361378e7a6ff3574f691afd9499da5f306 (patch)
tree82e1e400fd314a11366719cc615a1da39465293a /gnu
parent121edb230743c80badea3dd5cb0ef1ce6488fc9f (diff)
Updated to 2.4
Diffstat (limited to 'gnu')
-rw-r--r--gnu/lib/libg++/VERSION2
-rw-r--r--gnu/lib/libg++/iostream/filebuf.C7
-rw-r--r--gnu/lib/libg++/iostream/sbufvscan.C14
-rw-r--r--gnu/lib/libg++/iostream/strstream.C6
-rw-r--r--gnu/lib/libg++/iostream/strstream.h8
-rw-r--r--gnu/lib/libg++/libg++/Fix16.h2
-rw-r--r--gnu/lib/libg++/libg++/Integer.h53
-rw-r--r--gnu/lib/libg++/libg++/Makefile1
-rw-r--r--gnu/lib/libg++/libg++/_G_config.h2
-rw-r--r--gnu/lib/libg++/libg++/regex.cc12
-rw-r--r--gnu/lib/libg++/libg++/regex.h7
11 files changed, 40 insertions, 74 deletions
diff --git a/gnu/lib/libg++/VERSION b/gnu/lib/libg++/VERSION
index dcd99480969..22c1fccec44 100644
--- a/gnu/lib/libg++/VERSION
+++ b/gnu/lib/libg++/VERSION
@@ -1,3 +1,3 @@
-libg++ version 2.3.90.
+libg++ version 2.4
complete, unmodified libg++ sources are available from prep.ai.mit.edu.
diff --git a/gnu/lib/libg++/iostream/filebuf.C b/gnu/lib/libg++/iostream/filebuf.C
index 94e592626ee..4d49d7f0e60 100644
--- a/gnu/lib/libg++/iostream/filebuf.C
+++ b/gnu/lib/libg++/iostream/filebuf.C
@@ -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);
diff --git a/gnu/lib/libg++/iostream/sbufvscan.C b/gnu/lib/libg++/iostream/sbufvscan.C
index 1c9e26ffa53..3c7d29a8c78 100644
--- a/gnu/lib/libg++/iostream/sbufvscan.C
+++ b/gnu/lib/libg++/iostream/sbufvscan.C
@@ -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.
diff --git a/gnu/lib/libg++/iostream/strstream.C b/gnu/lib/libg++/iostream/strstream.C
index f1f899d38ce..d5a57137d52 100644
--- a/gnu/lib/libg++/iostream/strstream.C
+++ b/gnu/lib/libg++/iostream/strstream.C
@@ -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))
diff --git a/gnu/lib/libg++/iostream/strstream.h b/gnu/lib/libg++/iostream/strstream.h
index 0cfac4bc43d..aa26c498cae 100644
--- a/gnu/lib/libg++/iostream/strstream.h
+++ b/gnu/lib/libg++/iostream/strstream.h
@@ -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; }
diff --git a/gnu/lib/libg++/libg++/Fix16.h b/gnu/lib/libg++/libg++/Fix16.h
index b663a9ebdcf..36728b40ce1 100644
--- a/gnu/lib/libg++/libg++/Fix16.h
+++ b/gnu/lib/libg++/libg++/Fix16.h
@@ -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
diff --git a/gnu/lib/libg++/libg++/Integer.h b/gnu/lib/libg++/libg++/Integer.h
index 731eb0d8f1f..d96d5b1975f 100644
--- a/gnu/lib/libg++/libg++/Integer.h
+++ b/gnu/lib/libg++/libg++/Integer.h
@@ -197,17 +197,16 @@ public:
// coercion & conversion
- int fits_in_long() const;
- int fits_in_double() const;
-
-#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;
+ int fits_in_long() const { return Iislong(rep); }
+ int fits_in_double() const { return Iisdouble(rep); }
+
+#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)
diff --git a/gnu/lib/libg++/libg++/Makefile b/gnu/lib/libg++/libg++/Makefile
index 4efe9f9a14b..086bf86c2df 100644
--- a/gnu/lib/libg++/libg++/Makefile
+++ b/gnu/lib/libg++/libg++/Makefile
@@ -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 \
diff --git a/gnu/lib/libg++/libg++/_G_config.h b/gnu/lib/libg++/libg++/_G_config.h
index aeec367c85b..ea6b1ce10bb 100644
--- a/gnu/lib/libg++/libg++/_G_config.h
+++ b/gnu/lib/libg++/libg++/_G_config.h
@@ -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
diff --git a/gnu/lib/libg++/libg++/regex.cc b/gnu/lib/libg++/libg++/regex.cc
index 4cfe68875e4..199308d0da2 100644
--- a/gnu/lib/libg++/libg++/regex.cc
+++ b/gnu/lib/libg++/libg++/regex.cc
@@ -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,
diff --git a/gnu/lib/libg++/libg++/regex.h b/gnu/lib/libg++/libg++/regex.h
index d771634b2fa..9e404e8da10 100644
--- a/gnu/lib/libg++/libg++/regex.h
+++ b/gnu/lib/libg++/libg++/regex.h
@@ -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__ */