home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-12-28 | 27.5 KB | 1,120 lines |
- *** 1.8 1992/11/08 00:19:13
- --- Changelo 1992/12/28 07:41:07
- ***************
- *** 276,278 ****
- --- 276,293 ----
- dont pass a zero size request to malloc.
-
- ---------------------------- Patchlevel 15 -----------------------------------
- +
- + xobstack.cc:: ++jrb
- + must use delete [] form, because was alloced with new [] form.
- +
- + filebuf.cc:: ++jrb
- + fix from net
- +
- + iostream.cc:: ++jrb
- + line 696 cast this as appro. gcc 2.3.2 barfs otherwise.
- +
- + *.cc, *.h:: ++jrb
- + half way thru syncing up with changes in libg++ 2.3 distribution.
- + i have done allthe non-io classes. still working on those.
- +
- + ---------------------------- Patchlevel 16 -----------------------------------
- *** 1.10 1992/11/08 00:19:13
- --- PatchLev.h 1992/12/28 07:41:08
- ***************
- *** 1,5 ****
-
- ! #define PatchLevel "15"
-
- /*
- * the Patch Level above is to identify the version
- --- 1,5 ----
-
- ! #define PatchLevel "16"
-
- /*
- * the Patch Level above is to identify the version
- *** 1.7 1992/07/17 18:24:43
- --- filebuf.cc 1992/12/28 07:41:12
- ***************
- *** 305,310 ****
- --- 305,312 ----
- if (do_flush()) return EOF;
- #endif
-
- + switch_to_get_mode();
- +
- _G_ssize_t count = sys_read(base(), ebuf() - base());
- if (count <= 0) {
- if (count == 0)
- *** 1.7 1992/07/17 18:24:43
- --- iostream.cc 1992/12/28 07:41:15
- ***************
- *** 693,699 ****
- _strbuf->vscan(format, ap, &_state);
- va_end(ap);
- }
- ! return *this;
- }
-
- // NOTE: extension for compatibility with old libg++.
- --- 693,699 ----
- _strbuf->vscan(format, ap, &_state);
- va_end(ap);
- }
- ! return *(istream *)this;
- }
-
- // NOTE: extension for compatibility with old libg++.
- *** 1.8 1992/11/08 00:19:13
- --- mincl 1992/12/28 07:41:17
- ***************
- *** 13,19 ****
- xgeom.cc xgetopt.cc xhypgeom.cc xinteger.cc xlognorm.cc xmlcg.cc \
- xnegexp.cc xnormal.cc xobstack.cc xpoisson.cc xrandom.cc xrationa.cc \
- xregex.cc xrndint.cc xrng.cc xsmplhis.cc xsmplsta.cc \
- ! xstring.cc xuniform.cc xweibull.cc xeh.cc
-
- IOSRC = editbuf.cc filebuf.cc fstream.cc igetline.cc indstrea.cc iostream.cc \
- makebuf.cc parsestr.cc sbufvfor.cc sbufvsca.cc sgetline.cc stdstrbu.cc \
- --- 13,19 ----
- xgeom.cc xgetopt.cc xhypgeom.cc xinteger.cc xlognorm.cc xmlcg.cc \
- xnegexp.cc xnormal.cc xobstack.cc xpoisson.cc xrandom.cc xrationa.cc \
- xregex.cc xrndint.cc xrng.cc xsmplhis.cc xsmplsta.cc \
- ! xstring.cc xuniform.cc xweibull.cc xeh.cc xdllist.cc xsllist.cc
-
- IOSRC = editbuf.cc filebuf.cc fstream.cc igetline.cc indstrea.cc iostream.cc \
- makebuf.cc parsestr.cc sbufvfor.cc sbufvsca.cc sgetline.cc stdstrbu.cc \
- ***************
- *** 63,68 ****
- --- 63,73 ----
-
- _bin_del.o: gnuaux.c
- $(CC) -c $(CFLAGS) -DL_builtin_del $^ -o $@
- +
- + # dont ask me why, but with gcc 2.3.1 and 2.3.2 -fomit-frame-pointer
- + # breaks xbitset
- + xbitset.o: xbitset.cc
- + $(GXX) $(GXXFFLAGS) -c xbitset.cc
-
- # DO NOT DELETE THIS LINE -- g++dep uses it.
- # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
- *** 1.7 1992/07/20 22:21:08
- --- regex.cc 1992/12/28 07:41:18
- ***************
- *** 52,68 ****
-
- #else /* not emacs */
-
- - #include <string.h>
- #include <g_config.h>
- !
- ! #if defined (_G_SYSV) || defined (STDC_HEADERS)
- ! #if !(defined(BSTRING) || defined(atarist))
- ! #define bcopy(s,d,n) memcpy((d),(s),(n))
- ! #define bcmp(s1,s2,n) memcmp((s1),(s2),(n))
- ! #define bzero(s,n) memset((s),0,(n))
- ! #endif
- ! #endif
- !
- #include <stdlib.h>
-
- /* Define the syntax stuff, so we can do the \<, \>, etc. */
- --- 52,59 ----
-
- #else /* not emacs */
-
- #include <g_config.h>
- ! #include <string.h>
- #include <stdlib.h>
-
- /* Define the syntax stuff, so we can do the \<, \>, etc. */
- ***************
- *** 94,100 ****
- if (done)
- return;
-
- ! bzero (re_syntax_table, sizeof re_syntax_table);
-
- for (c = 'a'; c <= 'z'; c++)
- re_syntax_table[c] = Sword;
- --- 85,91 ----
- if (done)
- return;
-
- ! memset (re_syntax_table, 0, sizeof re_syntax_table);
-
- for (c = 'a'; c <= 'z'; c++)
- re_syntax_table[c] = Sword;
- ***************
- *** 657,663 ****
-
- BUFPUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
- /* Clear the whole map */
- ! bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
-
- if ((obscure_syntax & RE_HAT_NOT_NEWLINE) && b[-2] == charset_not)
- SET_LIST_BIT ('\n');
- --- 648,654 ----
-
- BUFPUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
- /* Clear the whole map */
- ! memset (b, 0, (1 << BYTEWIDTH) / BYTEWIDTH);
-
- if ((obscure_syntax & RE_HAT_NOT_NEWLINE) && b[-2] == charset_not)
- SET_LIST_BIT ('\n');
- ***************
- *** 1318,1324 ****
-
- unsigned is_a_succeed_n;
-
- ! bzero (fastmap, (1 << BYTEWIDTH));
- bufp->fastmap_accurate = 1;
- bufp->can_be_null = 0;
-
- --- 1309,1315 ----
-
- unsigned is_a_succeed_n;
-
- ! memset (fastmap, 0, (1 << BYTEWIDTH));
- bufp->fastmap_accurate = 1;
- bufp->can_be_null = 0;
-
- ***************
- *** 1735,1741 ****
- stackx = (unsigned char **) alloca (2 * len \
- * sizeof (unsigned char *));\
- /* Only copy what is in use. */ \
- ! bcopy (stackb, stackx, len * sizeof (char *)); \
- stackp = stackx + (stackp - stackb); \
- stackb = stackx; \
- stacke = stackb + 2 * len; \
- --- 1726,1732 ----
- stackx = (unsigned char **) alloca (2 * len \
- * sizeof (unsigned char *));\
- /* Only copy what is in use. */ \
- ! memcpy (stackx, stackb, len * sizeof (char *)); \
- stackp = stackx + (stackp - stackb); \
- stackb = stackx; \
- stacke = stackb + 2 * len; \
- ***************
- *** 2162,2168 ****
- past them. */
- if (translate
- ? bcmp_translate ((char*)d, (char*)d2, mcnt, translate)
- ! : bcmp (d, d2, mcnt))
- goto fail;
- d += mcnt, d2 += mcnt;
- }
- --- 2153,2159 ----
- past them. */
- if (translate
- ? bcmp_translate ((char*)d, (char*)d2, mcnt, translate)
- ! : memcmp (d, d2, mcnt))
- goto fail;
- d += mcnt, d2 += mcnt;
- }
- *** 1.6 1992/07/17 18:24:43
- --- xbitset.cc 1992/12/28 07:41:22
- ***************
- *** 78,92 ****
- (*lib_error_handler)("BitSet", "Requested length out of range");
-
- BitSetRep* rep = (BitSetRep *) new char[allocsiz];
- ! bzero(rep, allocsiz);
- rep->sz = (allocsiz - sizeof(BitSetRep) + sizeof(short)) / sizeof(short);
- return rep;
- }
-
- ! BitSetRep* BitSetalloc(BitSetRep* old, const unsigned short* src, int srclen,
- int newvirt, int newlen)
- {
- ! if (old == &_nilBitSetRep) old = 0;
- BitSetRep* rep;
- if (old == 0 || newlen >= old->sz)
- rep = BSnew(newlen);
- --- 78,92 ----
- (*lib_error_handler)("BitSet", "Requested length out of range");
-
- BitSetRep* rep = (BitSetRep *) new char[allocsiz];
- ! memset(rep, 0, allocsiz);
- rep->sz = (allocsiz - sizeof(BitSetRep) + sizeof(short)) / sizeof(short);
- return rep;
- }
-
- ! BitSetRep* BitSetalloc(BitSetRep* old, const unsigned short* src, int srclen,
- int newvirt, int newlen)
- {
- ! if (old == &_nilBitSetRep) old = 0;
- BitSetRep* rep;
- if (old == 0 || newlen >= old->sz)
- rep = BSnew(newlen);
- ***************
- *** 97,104 ****
- rep->virt = newvirt;
-
- if (srclen != 0 && src != rep->s)
- ! bcopy(src, rep->s, srclen * sizeof(short));
- !
- if (old != rep && old != 0) delete old;
- return rep;
- }
- --- 97,106 ----
- rep->virt = newvirt;
-
- if (srclen != 0 && src != rep->s)
- ! memcpy(rep->s, src, srclen * sizeof(short));
- ! // BUG fix: extend virtual bit! 20 Oct 1992 Kevin Karplus
- ! if (rep->virt)
- ! memset(&rep->s[srclen], ONES, (newlen - srclen) * sizeof(short));
- if (old != rep && old != 0) delete old;
- return rep;
- }
- ***************
- *** 114,121 ****
- else if (newlen >= old->sz)
- {
- rep = BSnew(newlen);
- ! bcopy(old->s, rep->s, old->len * sizeof(short));
- rep->virt = old->virt;
- delete old;
- }
- else
- --- 116,126 ----
- else if (newlen >= old->sz)
- {
- rep = BSnew(newlen);
- ! memcpy(rep->s, old->s, old->len * sizeof(short));
- rep->virt = old->virt;
- + // BUG fix: extend virtual bit! 20 Oct 1992 Kevin Karplus
- + if (rep->virt)
- + memset(&rep->s[old->len], ONES, (newlen - old->len) * sizeof(short));
- delete old;
- }
- else
- ***************
- *** 154,160 ****
- else
- rep = old;
-
- ! bcopy(src->s, rep->s, newlen * sizeof(short));
- rep->len = newlen;
- rep->virt = src->virt;
- }
- --- 159,165 ----
- else
- rep = old;
-
- ! memcpy(rep->s, src->s, newlen * sizeof(short));
- rep->len = newlen;
- rep->virt = src->virt;
- }
- ***************
- *** 178,188 ****
-
- int operator == (const BitSet& x, const BitSet& y)
- {
- ! return x.rep->len == y.rep->len && x.rep->virt == y.rep->virt &&
- ! bcmp((void*)x.rep->s, (void*)y.rep->s,
- ! x.rep->len * sizeof(short)) == 0;
- ! }
-
-
- int operator <= (const BitSet& x, const BitSet& y)
- {
- --- 183,214 ----
-
- int operator == (const BitSet& x, const BitSet& y)
- {
- ! if (x.rep->virt != y.rep->virt)
- ! return 0;
- ! int xl = x.rep->len;
- ! int yl = y.rep->len;
-
- + unsigned short* xs = x.rep->s;
- + unsigned short* ys = y.rep->s;
- + if (xl<=yl)
- + {
- + if (memcmp((void*)xs, (void*)ys, xl * sizeof(short)))
- + return 0;
- + for (register int i=xl; i<yl; i++)
- + if (ys[i])
- + return 0;
- + return 1;
- + }
- + else
- + {
- + if (memcmp((void*)xs, (void*)ys, yl * sizeof(short)))
- + return 0;
- + for (register int i=yl; i<xl; i++)
- + if (xs[i])
- + return 0;
- + return 1;
- + }
- + }
-
- int operator <= (const BitSet& x, const BitSet& y)
- {
- ***************
- *** 427,433 ****
-
- void BitSet::clear()
- {
- ! if (rep->len > 0) bzero(rep->s, rep->sz * sizeof(short));
- rep->len = rep->virt = 0;
- }
-
- --- 453,459 ----
-
- void BitSet::clear()
- {
- ! if (rep->len > 0) memset(rep->s, 0, rep->sz * sizeof(short));
- rep->len = rep->virt = 0;
- }
-
- *** 1.6 1992/07/20 22:21:08
- --- xbitstri.cc 1992/12/28 07:41:23
- ***************
- *** 159,165 ****
- static inline void bit_clear(unsigned short* ds, int nbits)
- {
- int n = (unsigned)(nbits) / BITSTRBITS;
- ! if (n > 0) bzero((void*)ds, n * sizeof(short));
- ds[n] &= ONES << (nbits & (BITSTRBITS - 1));
- }
-
- --- 159,165 ----
- static inline void bit_clear(unsigned short* ds, int nbits)
- {
- int n = (unsigned)(nbits) / BITSTRBITS;
- ! if (n > 0) memset((void*)ds, 0, n * sizeof(short));
- ds[n] &= ONES << (nbits & (BITSTRBITS - 1));
- }
-
- ***************
- *** 296,302 ****
- (*lib_error_handler)("BitString", "Requested length out of range");
-
- BitStrRep* rep = (BitStrRep *) new char[allocsiz];
- ! bzero(rep, allocsiz);
- rep->sz = (allocsiz - sizeof(BitStrRep) + sizeof(short)) / sizeof(short);
- return rep;
- }
- --- 296,302 ----
- (*lib_error_handler)("BitString", "Requested length out of range");
-
- BitStrRep* rep = (BitStrRep *) new char[allocsiz];
- ! memset(rep, 0, allocsiz);
- rep->sz = (allocsiz - sizeof(BitStrRep) + sizeof(short)) / sizeof(short);
- return rep;
- }
- ***************
- *** 336,342 ****
- else if (news > old->sz)
- {
- rep = BSnew(newlen);
- ! bcopy(old->s, rep->s, BitStr_len(old->len) * sizeof(short));
- delete old;
- }
- else
- --- 336,342 ----
- else if (news > old->sz)
- {
- rep = BSnew(newlen);
- ! memcpy(rep->s, old->s, BitStr_len(old->len) * sizeof(short));
- delete old;
- }
- else
- ***************
- *** 373,379 ****
- else
- rep = old;
-
- ! bcopy(src->s, rep->s, news * sizeof(short));
- rep->len = newlen;
- }
- check_last(rep);
- --- 373,379 ----
- else
- rep = old;
-
- ! memcpy(rep->s, src->s, news * sizeof(short));
- rep->len = newlen;
- }
- check_last(rep);
- ***************
- *** 384,390 ****
- int operator == (const BitString& x, const BitString& y)
- {
- return x.rep->len == y.rep->len &&
- ! bcmp((void*)x.rep->s, (void*)y.rep->s,
- BitStr_len(x.rep->len) * sizeof(short)) == 0;
- }
-
- --- 384,390 ----
- int operator == (const BitString& x, const BitString& y)
- {
- return x.rep->len == y.rep->len &&
- ! memcmp((void*)x.rep->s, (void*)y.rep->s,
- BitStr_len(x.rep->len) * sizeof(short)) == 0;
- }
-
- *** 1.4 1992/06/03 02:12:17
- --- xcursesw.cc 1992/12/28 07:41:23
- ***************
- *** 29,34 ****
- --- 29,36 ----
- // because curses.h defines a clear macro that conflicts with iostream. Sigh.
- #include <xcursesw.h>
-
- + #if _G_HAVE_CURSES
- +
- int CursesWindow::count = 0;
-
- /*
- ***************
- *** 278,280 ****
- --- 280,284 ----
- (*lib_error_handler)("CursesWindow", "Too many windows destroyed");
- }
- }
- +
- + #endif /* _G_HAVE_CURSES */
- *** 1.5 1992/06/08 20:42:41
- --- xfix.cc 1992/12/28 07:41:24
- ***************
- *** 89,95 ****
- if (siz <= 0) siz = 1;
- size_t allocsiz = (sizeof(_Frep) + (siz - 1) * sizeof(uint16));
- _Fix z = (_Fix)(new char[allocsiz]);
- ! bzero(z, allocsiz);
- z->len = len;
- z->siz = siz;
- z->ref = 1;
- --- 89,95 ----
- if (siz <= 0) siz = 1;
- size_t allocsiz = (sizeof(_Frep) + (siz - 1) * sizeof(uint16));
- _Fix z = (_Fix)(new char[allocsiz]);
- ! memset(z, 0, allocsiz);
- z->len = len;
- z->siz = siz;
- z->ref = 1;
- *** 1.2 1992/07/17 18:24:43
- --- xgetopt.cc 1992/12/28 07:41:25
- ***************
- *** 34,44 ****
- char* GetOpt::nextchar = 0;
- int GetOpt::first_nonopt = 0;
- int GetOpt::last_nonopt = 0;
- - #if (__GNUG__ == 1)
- - OrderingEnum GetOpt::ordering = GetOpt::REQUIRE_ORDER;
- - #else
- - GetOpt::OrderingEnum GetOpt::ordering = GetOpt::REQUIRE_ORDER;
- - #endif /* (__GNUG__ == 1) */
-
- GetOpt::GetOpt (int argc, char **argv, const char *optstring)
- :opterr (1), nargc (argc), nargv (argv), noptstring (optstring)
- --- 34,39 ----
- ***************
- *** 70,79 ****
-
- /* Interchange the two blocks of data in argv. */
-
- ! bcopy (&argv[first_nonopt], temp, nonopts_size);
- ! bcopy (&argv[last_nonopt], &argv[first_nonopt],
- (optind - last_nonopt) * sizeof (char *));
- ! bcopy (temp, &argv[first_nonopt + optind - last_nonopt],
- nonopts_size);
-
- /* Update records for the slots the non-options now occupy. */
- --- 65,74 ----
-
- /* Interchange the two blocks of data in argv. */
-
- ! memcpy (temp, &argv[first_nonopt], nonopts_size);
- ! memcpy (&argv[first_nonopt], &argv[last_nonopt],
- (optind - last_nonopt) * sizeof (char *));
- ! memcpy (&argv[first_nonopt + optind - last_nonopt], temp,
- nonopts_size);
-
- /* Update records for the slots the non-options now occupy. */
- ***************
- *** 195,201 ****
-
- {
- char c = *nextchar++;
- ! char *temp = (char *) index (noptstring, c);
-
- /* Increment `optind' when we start to process its last character. */
- if (*nextchar == 0)
- --- 190,196 ----
-
- {
- char c = *nextchar++;
- ! char *temp = (char *) strchr (noptstring, c);
-
- /* Increment `optind' when we start to process its last character. */
- if (*nextchar == 0)
- *** 1.7 1992/07/20 22:21:08
- --- xinteger.cc 1992/12/28 07:41:26
- ***************
- *** 32,37 ****
- --- 32,38 ----
- #include <std.h>
- #include <ctype.h>
- #include <math.h>
- + #include <float.h>
- #include <limits.h>
- #include <xobstack.h>
- #include <xallocri.h>
- ***************
- *** 38,43 ****
- --- 39,52 ----
- #include <new.h>
- #include <builtin.h>
-
- + #ifndef HUGE_VAL
- + #ifdef HUGE
- + #define HUGE_VAL HUGE
- + #else
- + #define HUGE_VAL DBL_MAX
- + #endif
- + #endif
- +
- /*
- Sizes of shifts for multiple-precision arithmetic.
- These should not be changed unless Integer representation
- ***************
- *** 280,298 ****
-
- IntRep* Icopy_long(IntRep* old, long x)
- {
- unsigned short src[SHORT_PER_LONG];
- - unsigned long u;
- - int newsgn;
- - if (newsgn = (x >= 0))
- - u = x;
- - else
- - u = -x;
-
- unsigned short srclen = 0;
- ! while (u != 0)
- {
- ! src[srclen++] = extract(u);
- ! u = down(u);
- }
-
- IntRep* rep;
- --- 289,309 ----
-
- IntRep* Icopy_long(IntRep* old, long x)
- {
- + int newsgn = (x >= 0);
- + IntRep* rep = Icopy_ulong(old, newsgn ? x : -x);
- + rep->sgn = newsgn;
- + return rep;
- + }
- +
- + IntRep* Icopy_ulong(IntRep* old, unsigned long x)
- + {
- unsigned short src[SHORT_PER_LONG];
-
- unsigned short srclen = 0;
- ! while (x != 0)
- {
- ! src[srclen++] = extract(x);
- ! x = down(x);
- }
-
- IntRep* rep;
- ***************
- *** 305,316 ****
- rep = old;
-
- rep->len = srclen;
- ! rep->sgn = newsgn;
-
- scpy(src, rep->s, srclen);
-
- return rep;
- -
- }
-
- // special case for zero -- it's worth it!
- --- 316,326 ----
- rep = old;
-
- rep->len = srclen;
- ! rep->sgn = I_POSITIVE;
-
- scpy(src, rep->s, srclen);
-
- return rep;
- }
-
- // special case for zero -- it's worth it!
- ***************
- *** 408,414 ****
- double Itodouble(const IntRep* rep)
- {
- double d = 0.0;
- ! double bound = HUGE / 2.0;
- for (int i = rep->len - 1; i >= 0; --i)
- {
- unsigned short a = I_RADIX >> 1;
- --- 418,424 ----
- double Itodouble(const IntRep* rep)
- {
- double d = 0.0;
- ! double bound = DBL_MAX / 2.0;
- for (int i = rep->len - 1; i >= 0; --i)
- {
- unsigned short a = I_RADIX >> 1;
- ***************
- *** 415,421 ****
- while (a != 0)
- {
- if (d >= bound)
- ! return (rep->sgn == I_NEGATIVE) ? -HUGE : HUGE;
- d *= 2.0;
- if (rep->s[i] & a)
- d += 1.0;
- --- 425,431 ----
- while (a != 0)
- {
- if (d >= bound)
- ! return (rep->sgn == I_NEGATIVE) ? -HUGE_VAL : HUGE_VAL;
- d *= 2.0;
- if (rep->s[i] & a)
- d += 1.0;
- ***************
- *** 435,441 ****
- int Iisdouble(const IntRep* rep)
- {
- double d = 0.0;
- ! double bound = HUGE / 2.0;
- for (int i = rep->len - 1; i >= 0; --i)
- {
- unsigned short a = I_RADIX >> 1;
- --- 445,451 ----
- int Iisdouble(const IntRep* rep)
- {
- double d = 0.0;
- ! double bound = DBL_MAX / 2.0;
- for (int i = rep->len - 1; i >= 0; --i)
- {
- unsigned short a = I_RADIX >> 1;
- ***************
- *** 460,466 ****
- divide(num, den, q, r);
- double d1 = double(q);
-
- ! if (d1 == HUGE || d1 == -HUGE || sign(r) == 0)
- return d1;
- else // use as much precision as available for fractional part
- {
- --- 470,476 ----
- divide(num, den, q, r);
- double d1 = double(q);
-
- ! if (d1 >= DBL_MAX || d1 <= -DBL_MAX || sign(r) == 0)
- return d1;
- else // use as much precision as available for fractional part
- {
- ***************
- *** 562,570 ****
- if (diff == 0)
- diff = docmp(x->s, tmp, xl);
- }
- }
- - if (xsgn == I_NEGATIVE)
- - diff = -diff;
- return diff;
- }
- }
- --- 572,580 ----
- if (diff == 0)
- diff = docmp(x->s, tmp, xl);
- }
- + if (xsgn == I_NEGATIVE)
- + diff = -diff;
- }
- return diff;
- }
- }
- ***************
- *** 2332,2338 ****
- break;
- }
- else if (!know_base & !got_one && ch == '0')
- ! base = 8;
- else if (!know_base & !got_one && base == 8 && (ch == 'X' || ch == 'x'))
- base = 16;
- else if (base == 8)
- --- 2342,2348 ----
- break;
- }
- else if (!know_base & !got_one && ch == '0')
- ! base = 8, got_one = 1;
- else if (!know_base & !got_one && base == 8 && (ch == 'X' || ch == 'x'))
- base = 16;
- else if (base == 8)
- *** 1.2 1992/05/31 04:14:02
- --- xobstack.cc 1992/12/28 07:41:27
- ***************
- *** 40,46 ****
- while (lp != 0 && ((void*)lp > obj || (void*)(lp)->limit < obj))
- {
- plp = lp -> prev;
- ! delete(lp);
- lp = plp;
- }
- if (lp)
- --- 40,46 ----
- while (lp != 0 && ((void*)lp > obj || (void*)(lp)->limit < obj))
- {
- plp = lp -> prev;
- ! delete [] (char*)lp;
- lp = plp;
- }
- if (lp)
- ***************
- *** 68,74 ****
- new_chunk->prev = old_chunk;
- new_chunk->limit = chunklimit = (char *) new_chunk + new_size;
-
- ! bcopy((void*)objectbase, (void*)new_chunk->contents, obj_size);
- objectbase = new_chunk->contents;
- nextfree = objectbase + obj_size;
- }
- --- 68,74 ----
- new_chunk->prev = old_chunk;
- new_chunk->limit = chunklimit = (char *) new_chunk + new_size;
-
- ! memcpy((void*)new_chunk->contents, (void*)objectbase, obj_size);
- objectbase = new_chunk->contents;
- nextfree = objectbase + obj_size;
- }
- *** 1.2 1992/06/08 20:42:41
- --- xregex.cc 1992/12/28 07:41:28
- ***************
- *** 49,55 ****
- buf = new re_pattern_buffer;
- reg = new re_registers;
- if (fast)
- ! buf->fastmap = malloc(256);
- else
- buf->fastmap = 0;
- buf->translate = (char*)transtable;
- --- 49,55 ----
- buf = new re_pattern_buffer;
- reg = new re_registers;
- if (fast)
- ! buf->fastmap = (char*)malloc(256);
- else
- buf->fastmap = 0;
- buf->translate = (char*)transtable;
- ***************
- *** 56,62 ****
- if (tlen > bufsize)
- bufsize = tlen;
- buf->allocated = bufsize;
- ! buf->buffer = malloc(buf->allocated);
- char* msg = re_compile_pattern((const char*)t, tlen, buf);
- if (msg != 0)
- (*lib_error_handler)("Regex", msg);
- --- 56,62 ----
- if (tlen > bufsize)
- bufsize = tlen;
- buf->allocated = bufsize;
- ! buf->buffer = (char *)malloc(buf->allocated);
- char* msg = re_compile_pattern((const char*)t, tlen, buf);
- if (msg != 0)
- (*lib_error_handler)("Regex", msg);
- *** 1.1 1992/03/22 07:42:32
- --- xsample.cc 1992/12/28 07:41:29
- ***************
- *** 21,27 ****
- --- 21,36 ----
- #include <stream.h>
- #include <xsmplsta.h>
- #include <math.h>
- + #include <float.h>
-
- + #ifndef HUGE_VAL
- + #ifdef HUGE
- + #define HUGE_VAL HUGE
- + #else
- + #define HUGE_VAL DBL_MAX
- + #endif
- + #endif
- +
- // error handling
-
- void default_SampleStatistic_error_handler(const char* msg)
- ***************
- *** 53,59 ****
- int positive = p >= 0.5;
- p = (positive)? 1.0 - p : p;
- if (p <= 0.0 || df <= 0)
- ! t = HUGE;
- else if (p == 0.5)
- t = 0.0;
- else if (df == 1)
- --- 62,68 ----
- int positive = p >= 0.5;
- p = (positive)? 1.0 - p : p;
- if (p <= 0.0 || df <= 0)
- ! t = HUGE_VAL;
- else if (p == 0.5)
- t = 0.0;
- else if (df == 1)
- ***************
- *** 78,85 ****
- SampleStatistic::reset()
- {
- n = 0; x = x2 = 0.0;
- ! maxValue = -HUGE;
- ! minValue = HUGE;
- }
-
- void
- --- 87,94 ----
- SampleStatistic::reset()
- {
- n = 0; x = x2 = 0.0;
- ! maxValue = -HUGE_VAL;
- ! minValue = HUGE_VAL;
- }
-
- void
- ***************
- *** 128,136 ****
- SampleStatistic::confidence(int interval)
- {
- int df = n - 1;
- ! if (df <= 0) return HUGE;
- double t = tval(double(100 + interval) * 0.005, df);
- ! if (t == HUGE)
- return t;
- else
- return (t * stdDev()) / sqrt(double(n));
- --- 137,145 ----
- SampleStatistic::confidence(int interval)
- {
- int df = n - 1;
- ! if (df <= 0) return HUGE_VAL;
- double t = tval(double(100 + interval) * 0.005, df);
- ! if (t == HUGE_VAL)
- return t;
- else
- return (t * stdDev()) / sqrt(double(n));
- ***************
- *** 140,148 ****
- SampleStatistic::confidence(double p_value)
- {
- int df = n - 1;
- ! if (df <= 0) return HUGE;
- double t = tval((1.0 + p_value) * 0.5, df);
- ! if (t == HUGE)
- return t;
- else
- return (t * stdDev()) / sqrt(double(n));
- --- 149,157 ----
- SampleStatistic::confidence(double p_value)
- {
- int df = n - 1;
- ! if (df <= 0) return HUGE_VAL;
- double t = tval((1.0 + p_value) * 0.5, df);
- ! if (t == HUGE_VAL)
- return t;
- else
- return (t * stdDev()) / sqrt(double(n));
- ***************
- *** 175,181 ****
- bucketLimit[i] = lim;
- lim += width;
- }
- ! bucketLimit[howManyBuckets-1] = HUGE; /* from math.h */
- }
-
- SampleHistogram::~SampleHistogram()
- --- 184,190 ----
- bucketLimit[i] = lim;
- lim += width;
- }
- ! bucketLimit[howManyBuckets-1] = HUGE_VAL; /* from math.h */
- }
-
- SampleHistogram::~SampleHistogram()
- ***************
- *** 211,217 ****
- SampleHistogram::printBuckets(ostream& s)
- {
- for(int i = 0; i < howManyBuckets; i++) {
- ! if (bucketLimit[i] >= HUGE) {
- s << "< max : " << bucketCount[i] << "\n";
- } else {
- s << "< " << bucketLimit[i] << " : " << bucketCount[i] << "\n";
- --- 220,226 ----
- SampleHistogram::printBuckets(ostream& s)
- {
- for(int i = 0; i < howManyBuckets; i++) {
- ! if (bucketLimit[i] >= HUGE_VAL) {
- s << "< max : " << bucketCount[i] << "\n";
- } else {
- s << "< " << bucketLimit[i] << " : " << bucketCount[i] << "\n";
- *** 1.1 1992/03/22 07:42:32
- --- xsmplhis.cc 1992/12/28 07:41:30
- ***************
- *** 22,27 ****
- --- 22,35 ----
- #include <xsmplhis.h>
- #include <math.h>
-
- + #ifndef HUGE_VAL
- + #ifdef HUGE
- + #define HUGE_VAL HUGE
- + #else
- + #include <float.h>
- + #define HUGE_VAL DBL_MAX
- + #endif
- + #endif
-
- const int SampleHistogramMinimum = -2;
- const int SampleHistogramMaximum = -1;
- ***************
- *** 47,53 ****
- bucketLimit[i] = lim;
- lim += width;
- }
- ! bucketLimit[howManyBuckets-1] = HUGE; /* from math.h */
- }
-
- SampleHistogram::~SampleHistogram()
- --- 55,61 ----
- bucketLimit[i] = lim;
- lim += width;
- }
- ! bucketLimit[howManyBuckets-1] = HUGE_VAL; /* from math.h */
- }
-
- SampleHistogram::~SampleHistogram()
- ***************
- *** 83,89 ****
- SampleHistogram::printBuckets(ostream& s)
- {
- for(int i = 0; i < howManyBuckets; i++) {
- ! if (bucketLimit[i] >= HUGE) {
- s << "< max : " << bucketCount[i] << "\n";
- } else {
- s << "< " << bucketLimit[i] << " : " << bucketCount[i] << "\n";
- --- 91,97 ----
- SampleHistogram::printBuckets(ostream& s)
- {
- for(int i = 0; i < howManyBuckets; i++) {
- ! if (bucketLimit[i] >= HUGE_VAL) {
- s << "< max : " << bucketCount[i] << "\n";
- } else {
- s << "< " << bucketLimit[i] << " : " << bucketCount[i] << "\n";
- *** 1.1 1992/03/22 07:42:32
- --- xsmplsta.cc 1992/12/28 07:41:30
- ***************
- *** 22,27 ****
- --- 22,36 ----
- #include <xsmplsta.h>
- #include <math.h>
-
- + #ifndef HUGE_VAL
- + #ifdef HUGE
- + #define HUGE_VAL HUGE
- + #else
- + #include <float.h>
- + #define HUGE_VAL DBL_MAX
- + #endif
- + #endif
- +
- // error handling
-
- void default_SampleStatistic_error_handler(const char* msg)
- ***************
- *** 53,59 ****
- int positive = p >= 0.5;
- p = (positive)? 1.0 - p : p;
- if (p <= 0.0 || df <= 0)
- ! t = HUGE;
- else if (p == 0.5)
- t = 0.0;
- else if (df == 1)
- --- 62,68 ----
- int positive = p >= 0.5;
- p = (positive)? 1.0 - p : p;
- if (p <= 0.0 || df <= 0)
- ! t = HUGE_VAL;
- else if (p == 0.5)
- t = 0.0;
- else if (df == 1)
- ***************
- *** 78,85 ****
- SampleStatistic::reset()
- {
- n = 0; x = x2 = 0.0;
- ! maxValue = -HUGE;
- ! minValue = HUGE;
- }
-
- void
- --- 87,94 ----
- SampleStatistic::reset()
- {
- n = 0; x = x2 = 0.0;
- ! maxValue = -HUGE_VAL;
- ! minValue = HUGE_VAL;
- }
-
- void
- ***************
- *** 128,136 ****
- SampleStatistic::confidence(int interval)
- {
- int df = n - 1;
- ! if (df <= 0) return HUGE;
- double t = tval(double(100 + interval) * 0.005, df);
- ! if (t == HUGE)
- return t;
- else
- return (t * stdDev()) / sqrt(double(n));
- --- 137,145 ----
- SampleStatistic::confidence(int interval)
- {
- int df = n - 1;
- ! if (df <= 0) return HUGE_VAL;
- double t = tval(double(100 + interval) * 0.005, df);
- ! if (t == HUGE_VAL)
- return t;
- else
- return (t * stdDev()) / sqrt(double(n));
- ***************
- *** 140,148 ****
- SampleStatistic::confidence(double p_value)
- {
- int df = n - 1;
- ! if (df <= 0) return HUGE;
- double t = tval((1.0 + p_value) * 0.5, df);
- ! if (t == HUGE)
- return t;
- else
- return (t * stdDev()) / sqrt(double(n));
- --- 149,157 ----
- SampleStatistic::confidence(double p_value)
- {
- int df = n - 1;
- ! if (df <= 0) return HUGE_VAL;
- double t = tval((1.0 + p_value) * 0.5, df);
- ! if (t == HUGE_VAL)
- return t;
- else
- return (t * stdDev()) / sqrt(double(n));
-