home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update27.zoo / libg++ / src / diffs next >
Encoding:
Text File  |  1992-12-28  |  27.5 KB  |  1,120 lines

  1. *** 1.8    1992/11/08 00:19:13
  2. --- Changelo    1992/12/28 07:41:07
  3. ***************
  4. *** 276,278 ****
  5. --- 276,293 ----
  6.       dont pass a zero size request to malloc.
  7.   
  8.   ---------------------------- Patchlevel 15 -----------------------------------
  9. + xobstack.cc:: ++jrb
  10. +     must use delete [] form, because was alloced with new [] form.
  11. + filebuf.cc::  ++jrb
  12. +     fix from net
  13. + iostream.cc:: ++jrb
  14. +     line 696 cast this as appro. gcc 2.3.2 barfs otherwise.
  15. + *.cc, *.h:: ++jrb
  16. +     half way thru syncing up with changes in libg++ 2.3 distribution.
  17. +     i have done allthe non-io classes. still working on those.
  18. + ---------------------------- Patchlevel 16 -----------------------------------
  19. *** 1.10    1992/11/08 00:19:13
  20. --- PatchLev.h    1992/12/28 07:41:08
  21. ***************
  22. *** 1,5 ****
  23.   
  24. ! #define    PatchLevel "15"
  25.   
  26.   /*
  27.    *    the Patch Level above is to identify the version
  28. --- 1,5 ----
  29.   
  30. ! #define    PatchLevel "16"
  31.   
  32.   /*
  33.    *    the Patch Level above is to identify the version
  34. *** 1.7    1992/07/17 18:24:43
  35. --- filebuf.cc    1992/12/28 07:41:12
  36. ***************
  37. *** 305,310 ****
  38. --- 305,312 ----
  39.       if (do_flush()) return EOF;
  40.   #endif
  41.   
  42. +     switch_to_get_mode();
  43.       _G_ssize_t count = sys_read(base(), ebuf() - base());
  44.       if (count <= 0) {
  45.       if (count == 0)
  46. *** 1.7    1992/07/17 18:24:43
  47. --- iostream.cc    1992/12/28 07:41:15
  48. ***************
  49. *** 693,699 ****
  50.       _strbuf->vscan(format, ap, &_state);
  51.       va_end(ap);
  52.       }
  53. !     return *this;
  54.   }
  55.   
  56.   // NOTE: extension for compatibility with old libg++.
  57. --- 693,699 ----
  58.       _strbuf->vscan(format, ap, &_state);
  59.       va_end(ap);
  60.       }
  61. !     return *(istream *)this;
  62.   }
  63.   
  64.   // NOTE: extension for compatibility with old libg++.
  65. *** 1.8    1992/11/08 00:19:13
  66. --- mincl    1992/12/28 07:41:17
  67. ***************
  68. *** 13,19 ****
  69.   xgeom.cc xgetopt.cc xhypgeom.cc xinteger.cc  xlognorm.cc xmlcg.cc \
  70.   xnegexp.cc xnormal.cc xobstack.cc xpoisson.cc xrandom.cc xrationa.cc \
  71.   xregex.cc xrndint.cc xrng.cc xsmplhis.cc xsmplsta.cc \
  72. ! xstring.cc xuniform.cc xweibull.cc xeh.cc
  73.   
  74.   IOSRC = editbuf.cc filebuf.cc fstream.cc igetline.cc indstrea.cc iostream.cc \
  75.   makebuf.cc parsestr.cc sbufvfor.cc sbufvsca.cc sgetline.cc stdstrbu.cc \
  76. --- 13,19 ----
  77.   xgeom.cc xgetopt.cc xhypgeom.cc xinteger.cc  xlognorm.cc xmlcg.cc \
  78.   xnegexp.cc xnormal.cc xobstack.cc xpoisson.cc xrandom.cc xrationa.cc \
  79.   xregex.cc xrndint.cc xrng.cc xsmplhis.cc xsmplsta.cc \
  80. ! xstring.cc xuniform.cc xweibull.cc xeh.cc xdllist.cc xsllist.cc
  81.   
  82.   IOSRC = editbuf.cc filebuf.cc fstream.cc igetline.cc indstrea.cc iostream.cc \
  83.   makebuf.cc parsestr.cc sbufvfor.cc sbufvsca.cc sgetline.cc stdstrbu.cc \
  84. ***************
  85. *** 63,68 ****
  86. --- 63,73 ----
  87.   
  88.   _bin_del.o: gnuaux.c
  89.       $(CC) -c $(CFLAGS) -DL_builtin_del $^ -o $@
  90. + # dont ask me why, but with gcc 2.3.1 and 2.3.2 -fomit-frame-pointer
  91. + # breaks xbitset
  92. + xbitset.o: xbitset.cc
  93. +     $(GXX) $(GXXFFLAGS) -c xbitset.cc
  94.   
  95.   # DO NOT DELETE THIS LINE -- g++dep uses it.
  96.   # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
  97. *** 1.7    1992/07/20 22:21:08
  98. --- regex.cc    1992/12/28 07:41:18
  99. ***************
  100. *** 52,68 ****
  101.   
  102.   #else  /* not emacs */
  103.   
  104. - #include <string.h>
  105.   #include <g_config.h>
  106. ! #if defined (_G_SYSV) || defined (STDC_HEADERS)
  107. ! #if !(defined(BSTRING) || defined(atarist))
  108. ! #define bcopy(s,d,n)    memcpy((d),(s),(n))
  109. ! #define bcmp(s1,s2,n)    memcmp((s1),(s2),(n))
  110. ! #define bzero(s,n)    memset((s),0,(n))
  111. ! #endif
  112. ! #endif
  113.   #include <stdlib.h>
  114.   
  115.   /* Define the syntax stuff, so we can do the \<, \>, etc.  */
  116. --- 52,59 ----
  117.   
  118.   #else  /* not emacs */
  119.   
  120.   #include <g_config.h>
  121. ! #include <string.h>
  122.   #include <stdlib.h>
  123.   
  124.   /* Define the syntax stuff, so we can do the \<, \>, etc.  */
  125. ***************
  126. *** 94,100 ****
  127.      if (done)
  128.        return;
  129.   
  130. !    bzero (re_syntax_table, sizeof re_syntax_table);
  131.   
  132.      for (c = 'a'; c <= 'z'; c++)
  133.        re_syntax_table[c] = Sword;
  134. --- 85,91 ----
  135.      if (done)
  136.        return;
  137.   
  138. !    memset (re_syntax_table, 0, sizeof re_syntax_table);
  139.   
  140.      for (c = 'a'; c <= 'z'; c++)
  141.        re_syntax_table[c] = Sword;
  142. ***************
  143. *** 657,663 ****
  144.   
  145.         BUFPUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
  146.         /* Clear the whole map */
  147. !       bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
  148.             
  149.         if ((obscure_syntax & RE_HAT_NOT_NEWLINE) && b[-2] == charset_not)
  150.               SET_LIST_BIT ('\n');
  151. --- 648,654 ----
  152.   
  153.         BUFPUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
  154.         /* Clear the whole map */
  155. !       memset (b, 0, (1 << BYTEWIDTH) / BYTEWIDTH);
  156.             
  157.         if ((obscure_syntax & RE_HAT_NOT_NEWLINE) && b[-2] == charset_not)
  158.               SET_LIST_BIT ('\n');
  159. ***************
  160. *** 1318,1324 ****
  161.   
  162.     unsigned is_a_succeed_n;
  163.   
  164. !   bzero (fastmap, (1 << BYTEWIDTH));
  165.     bufp->fastmap_accurate = 1;
  166.     bufp->can_be_null = 0;
  167.         
  168. --- 1309,1315 ----
  169.   
  170.     unsigned is_a_succeed_n;
  171.   
  172. !   memset (fastmap, 0, (1 << BYTEWIDTH));
  173.     bufp->fastmap_accurate = 1;
  174.     bufp->can_be_null = 0;
  175.         
  176. ***************
  177. *** 1735,1741 ****
  178.           stackx = (unsigned char **) alloca (2 * len            \
  179.                                               * sizeof (unsigned char *));\
  180.       /* Only copy what is in use.  */                \
  181. !         bcopy (stackb, stackx, len * sizeof (char *));            \
  182.       stackp = stackx + (stackp - stackb);                \
  183.       stackb = stackx;                        \
  184.       stacke = stackb + 2 * len;                    \
  185. --- 1726,1732 ----
  186.           stackx = (unsigned char **) alloca (2 * len            \
  187.                                               * sizeof (unsigned char *));\
  188.       /* Only copy what is in use.  */                \
  189. !         memcpy (stackx, stackb, len * sizeof (char *));            \
  190.       stackp = stackx + (stackp - stackb);                \
  191.       stackb = stackx;                        \
  192.       stacke = stackb + 2 * len;                    \
  193. ***************
  194. *** 2162,2168 ****
  195.                      past them.  */
  196.           if (translate 
  197.                       ? bcmp_translate ((char*)d, (char*)d2, mcnt, translate) 
  198. !                     : bcmp (d, d2, mcnt))
  199.             goto fail;
  200.           d += mcnt, d2 += mcnt;
  201.             }
  202. --- 2153,2159 ----
  203.                      past them.  */
  204.           if (translate 
  205.                       ? bcmp_translate ((char*)d, (char*)d2, mcnt, translate) 
  206. !                     : memcmp (d, d2, mcnt))
  207.             goto fail;
  208.           d += mcnt, d2 += mcnt;
  209.             }
  210. *** 1.6    1992/07/17 18:24:43
  211. --- xbitset.cc    1992/12/28 07:41:22
  212. ***************
  213. *** 78,92 ****
  214.       (*lib_error_handler)("BitSet", "Requested length out of range");
  215.       
  216.     BitSetRep* rep = (BitSetRep *) new char[allocsiz];
  217. !   bzero(rep, allocsiz);
  218.     rep->sz = (allocsiz - sizeof(BitSetRep) + sizeof(short)) / sizeof(short);
  219.     return rep;
  220.   }
  221.   
  222. ! BitSetRep* BitSetalloc(BitSetRep* old, const unsigned short* src, int srclen, 
  223.                   int newvirt, int newlen)
  224.   {
  225. !   if (old == &_nilBitSetRep) old = 0; 
  226.     BitSetRep* rep;
  227.     if (old == 0 || newlen >= old->sz)
  228.       rep = BSnew(newlen);
  229. --- 78,92 ----
  230.       (*lib_error_handler)("BitSet", "Requested length out of range");
  231.       
  232.     BitSetRep* rep = (BitSetRep *) new char[allocsiz];
  233. !   memset(rep, 0, allocsiz);
  234.     rep->sz = (allocsiz - sizeof(BitSetRep) + sizeof(short)) / sizeof(short);
  235.     return rep;
  236.   }
  237.   
  238. ! BitSetRep* BitSetalloc(BitSetRep* old, const unsigned short* src, int srclen,
  239.                   int newvirt, int newlen)
  240.   {
  241. !   if (old == &_nilBitSetRep) old = 0;
  242.     BitSetRep* rep;
  243.     if (old == 0 || newlen >= old->sz)
  244.       rep = BSnew(newlen);
  245. ***************
  246. *** 97,104 ****
  247.     rep->virt = newvirt;
  248.   
  249.     if (srclen != 0 && src != rep->s)
  250. !     bcopy(src, rep->s, srclen * sizeof(short));
  251.     if (old != rep && old != 0) delete old;
  252.     return rep;
  253.   }
  254. --- 97,106 ----
  255.     rep->virt = newvirt;
  256.   
  257.     if (srclen != 0 && src != rep->s)
  258. !     memcpy(rep->s, src, srclen * sizeof(short));
  259. !   // BUG fix: extend virtual bit! 20 Oct 1992 Kevin Karplus
  260. !   if (rep->virt)
  261. !       memset(&rep->s[srclen], ONES, (newlen - srclen) * sizeof(short));
  262.     if (old != rep && old != 0) delete old;
  263.     return rep;
  264.   }
  265. ***************
  266. *** 114,121 ****
  267.     else if (newlen >= old->sz)
  268.     {
  269.       rep = BSnew(newlen);
  270. !     bcopy(old->s, rep->s, old->len * sizeof(short));
  271.       rep->virt = old->virt;
  272.       delete old;
  273.     }
  274.     else
  275. --- 116,126 ----
  276.     else if (newlen >= old->sz)
  277.     {
  278.       rep = BSnew(newlen);
  279. !     memcpy(rep->s, old->s, old->len * sizeof(short));
  280.       rep->virt = old->virt;
  281. +     // BUG fix: extend virtual bit!  20 Oct 1992 Kevin Karplus
  282. +     if (rep->virt)
  283. +     memset(&rep->s[old->len], ONES, (newlen - old->len) * sizeof(short));
  284.       delete old;
  285.     }
  286.     else
  287. ***************
  288. *** 154,160 ****
  289.       else
  290.         rep = old;
  291.   
  292. !     bcopy(src->s, rep->s, newlen * sizeof(short));
  293.       rep->len = newlen;
  294.       rep->virt = src->virt;
  295.     }
  296. --- 159,165 ----
  297.       else
  298.         rep = old;
  299.   
  300. !     memcpy(rep->s, src->s, newlen * sizeof(short));
  301.       rep->len = newlen;
  302.       rep->virt = src->virt;
  303.     }
  304. ***************
  305. *** 178,188 ****
  306.   
  307.   int operator == (const BitSet& x, const BitSet& y)
  308.   {
  309. !   return x.rep->len == y.rep->len && x.rep->virt == y.rep->virt &&
  310. !     bcmp((void*)x.rep->s, (void*)y.rep->s, 
  311. !          x.rep->len * sizeof(short)) == 0;
  312. ! }
  313.   
  314.   
  315.   int operator <= (const BitSet& x, const BitSet& y)
  316.   {
  317. --- 183,214 ----
  318.   
  319.   int operator == (const BitSet& x, const BitSet& y)
  320.   {
  321. !   if (x.rep->virt != y.rep->virt)
  322. !     return 0;
  323. !   int xl = x.rep->len;
  324. !   int yl = y.rep->len;
  325.   
  326. +   unsigned short* xs = x.rep->s;
  327. +   unsigned short* ys = y.rep->s;
  328. +   if (xl<=yl)
  329. +     {
  330. +       if (memcmp((void*)xs, (void*)ys, xl * sizeof(short)))
  331. +       return 0;
  332. +       for (register int i=xl; i<yl; i++)
  333. +         if (ys[i])
  334. +       return 0;
  335. +       return 1;
  336. +     }
  337. +   else
  338. +     {
  339. +       if (memcmp((void*)xs, (void*)ys, yl * sizeof(short)))
  340. +       return 0;
  341. +       for (register int i=yl; i<xl; i++)
  342. +         if (xs[i]) 
  343. +       return 0;
  344. +       return 1;
  345. +     }
  346. + }
  347.   
  348.   int operator <= (const BitSet& x, const BitSet& y)
  349.   {
  350. ***************
  351. *** 427,433 ****
  352.   
  353.   void BitSet::clear()
  354.   {
  355. !   if (rep->len > 0) bzero(rep->s, rep->sz * sizeof(short));
  356.     rep->len = rep->virt = 0;
  357.   }
  358.   
  359. --- 453,459 ----
  360.   
  361.   void BitSet::clear()
  362.   {
  363. !   if (rep->len > 0) memset(rep->s, 0, rep->sz * sizeof(short));
  364.     rep->len = rep->virt = 0;
  365.   }
  366.   
  367. *** 1.6    1992/07/20 22:21:08
  368. --- xbitstri.cc    1992/12/28 07:41:23
  369. ***************
  370. *** 159,165 ****
  371.   static inline void bit_clear(unsigned short* ds, int nbits)
  372.   {
  373.     int n = (unsigned)(nbits) / BITSTRBITS;
  374. !   if (n > 0) bzero((void*)ds, n * sizeof(short));
  375.     ds[n] &= ONES << (nbits & (BITSTRBITS - 1));
  376.   }
  377.   
  378. --- 159,165 ----
  379.   static inline void bit_clear(unsigned short* ds, int nbits)
  380.   {
  381.     int n = (unsigned)(nbits) / BITSTRBITS;
  382. !   if (n > 0) memset((void*)ds, 0, n * sizeof(short));
  383.     ds[n] &= ONES << (nbits & (BITSTRBITS - 1));
  384.   }
  385.   
  386. ***************
  387. *** 296,302 ****
  388.       (*lib_error_handler)("BitString", "Requested length out of range");
  389.       
  390.     BitStrRep* rep = (BitStrRep *) new char[allocsiz];
  391. !   bzero(rep, allocsiz);
  392.     rep->sz = (allocsiz - sizeof(BitStrRep) + sizeof(short)) / sizeof(short);
  393.     return rep;
  394.   }
  395. --- 296,302 ----
  396.       (*lib_error_handler)("BitString", "Requested length out of range");
  397.       
  398.     BitStrRep* rep = (BitStrRep *) new char[allocsiz];
  399. !   memset(rep, 0, allocsiz);
  400.     rep->sz = (allocsiz - sizeof(BitStrRep) + sizeof(short)) / sizeof(short);
  401.     return rep;
  402.   }
  403. ***************
  404. *** 336,342 ****
  405.     else if (news > old->sz)
  406.     {
  407.       rep = BSnew(newlen);
  408. !     bcopy(old->s, rep->s, BitStr_len(old->len) * sizeof(short));
  409.       delete old;
  410.     }
  411.     else
  412. --- 336,342 ----
  413.     else if (news > old->sz)
  414.     {
  415.       rep = BSnew(newlen);
  416. !     memcpy(rep->s, old->s, BitStr_len(old->len) * sizeof(short));
  417.       delete old;
  418.     }
  419.     else
  420. ***************
  421. *** 373,379 ****
  422.       else
  423.         rep = old;
  424.       
  425. !     bcopy(src->s, rep->s, news * sizeof(short));
  426.       rep->len = newlen;
  427.     }
  428.     check_last(rep);
  429. --- 373,379 ----
  430.       else
  431.         rep = old;
  432.       
  433. !     memcpy(rep->s, src->s, news * sizeof(short));
  434.       rep->len = newlen;
  435.     }
  436.     check_last(rep);
  437. ***************
  438. *** 384,390 ****
  439.   int operator == (const BitString& x, const BitString& y)
  440.   {
  441.     return x.rep->len == y.rep->len && 
  442. !     bcmp((void*)x.rep->s, (void*)y.rep->s, 
  443.            BitStr_len(x.rep->len) * sizeof(short)) == 0;
  444.   }
  445.   
  446. --- 384,390 ----
  447.   int operator == (const BitString& x, const BitString& y)
  448.   {
  449.     return x.rep->len == y.rep->len && 
  450. !     memcmp((void*)x.rep->s, (void*)y.rep->s, 
  451.            BitStr_len(x.rep->len) * sizeof(short)) == 0;
  452.   }
  453.   
  454. *** 1.4    1992/06/03 02:12:17
  455. --- xcursesw.cc    1992/12/28 07:41:23
  456. ***************
  457. *** 29,34 ****
  458. --- 29,36 ----
  459.   // because curses.h defines a clear macro that conflicts with iostream. Sigh.
  460.   #include <xcursesw.h>
  461.   
  462. + #if _G_HAVE_CURSES
  463.   int CursesWindow::count = 0;
  464.   
  465.   /*
  466. ***************
  467. *** 278,280 ****
  468. --- 280,284 ----
  469.       (*lib_error_handler)("CursesWindow", "Too many windows destroyed");
  470.     }
  471.   }
  472. + #endif /* _G_HAVE_CURSES */
  473. *** 1.5    1992/06/08 20:42:41
  474. --- xfix.cc    1992/12/28 07:41:24
  475. ***************
  476. *** 89,95 ****
  477.     if (siz <= 0) siz = 1;
  478.     size_t allocsiz = (sizeof(_Frep) + (siz - 1) * sizeof(uint16));
  479.     _Fix z = (_Fix)(new char[allocsiz]);
  480. !   bzero(z, allocsiz);
  481.     z->len = len;
  482.     z->siz = siz;
  483.     z->ref = 1;
  484. --- 89,95 ----
  485.     if (siz <= 0) siz = 1;
  486.     size_t allocsiz = (sizeof(_Frep) + (siz - 1) * sizeof(uint16));
  487.     _Fix z = (_Fix)(new char[allocsiz]);
  488. !   memset(z, 0, allocsiz);
  489.     z->len = len;
  490.     z->siz = siz;
  491.     z->ref = 1;
  492. *** 1.2    1992/07/17 18:24:43
  493. --- xgetopt.cc    1992/12/28 07:41:25
  494. ***************
  495. *** 34,44 ****
  496.   char* GetOpt::nextchar = 0;
  497.   int GetOpt::first_nonopt = 0;
  498.   int GetOpt::last_nonopt = 0;
  499. - #if (__GNUG__ == 1) 
  500. - OrderingEnum GetOpt::ordering = GetOpt::REQUIRE_ORDER;
  501. - #else
  502. - GetOpt::OrderingEnum GetOpt::ordering = GetOpt::REQUIRE_ORDER;
  503. - #endif /* (__GNUG__ == 1)  */
  504.   
  505.   GetOpt::GetOpt (int argc, char **argv, const char *optstring)
  506.    :opterr (1), nargc (argc), nargv (argv), noptstring (optstring)
  507. --- 34,39 ----
  508. ***************
  509. *** 70,79 ****
  510.   
  511.     /* Interchange the two blocks of data in argv.  */
  512.   
  513. !   bcopy (&argv[first_nonopt], temp, nonopts_size);
  514. !   bcopy (&argv[last_nonopt], &argv[first_nonopt],
  515.            (optind - last_nonopt) * sizeof (char *));
  516. !   bcopy (temp, &argv[first_nonopt + optind - last_nonopt],
  517.            nonopts_size);
  518.   
  519.     /* Update records for the slots the non-options now occupy.  */
  520. --- 65,74 ----
  521.   
  522.     /* Interchange the two blocks of data in argv.  */
  523.   
  524. !   memcpy (temp, &argv[first_nonopt], nonopts_size);
  525. !   memcpy (&argv[first_nonopt], &argv[last_nonopt],
  526.            (optind - last_nonopt) * sizeof (char *));
  527. !   memcpy (&argv[first_nonopt + optind - last_nonopt], temp,
  528.            nonopts_size);
  529.   
  530.     /* Update records for the slots the non-options now occupy.  */
  531. ***************
  532. *** 195,201 ****
  533.   
  534.     {
  535.       char c = *nextchar++;
  536. !     char *temp = (char *) index (noptstring, c);
  537.   
  538.       /* Increment `optind' when we start to process its last character.  */
  539.       if (*nextchar == 0)
  540. --- 190,196 ----
  541.   
  542.     {
  543.       char c = *nextchar++;
  544. !     char *temp = (char *) strchr (noptstring, c);
  545.   
  546.       /* Increment `optind' when we start to process its last character.  */
  547.       if (*nextchar == 0)
  548. *** 1.7    1992/07/20 22:21:08
  549. --- xinteger.cc    1992/12/28 07:41:26
  550. ***************
  551. *** 32,37 ****
  552. --- 32,38 ----
  553.   #include <std.h>
  554.   #include <ctype.h>
  555.   #include <math.h>
  556. + #include <float.h>
  557.   #include <limits.h>
  558.   #include <xobstack.h>
  559.   #include <xallocri.h>
  560. ***************
  561. *** 38,43 ****
  562. --- 39,52 ----
  563.   #include <new.h>
  564.   #include <builtin.h>
  565.   
  566. + #ifndef HUGE_VAL
  567. + #ifdef HUGE
  568. + #define HUGE_VAL HUGE
  569. + #else
  570. + #define HUGE_VAL DBL_MAX
  571. + #endif
  572. + #endif
  573.   /*
  574.    Sizes of shifts for multiple-precision arithmetic.
  575.    These should not be changed unless Integer representation
  576. ***************
  577. *** 280,298 ****
  578.   
  579.   IntRep* Icopy_long(IntRep* old, long x)
  580.   {
  581.     unsigned short src[SHORT_PER_LONG];
  582. -   unsigned long u;
  583. -   int newsgn;
  584. -   if (newsgn = (x >= 0))
  585. -     u = x;
  586. -   else
  587. -     u = -x;
  588.     
  589.     unsigned short srclen = 0;
  590. !   while (u != 0)
  591.     {
  592. !     src[srclen++] = extract(u);
  593. !     u = down(u);
  594.     }
  595.   
  596.     IntRep* rep;
  597. --- 289,309 ----
  598.   
  599.   IntRep* Icopy_long(IntRep* old, long x)
  600.   {
  601. +   int newsgn = (x >= 0);
  602. +   IntRep* rep = Icopy_ulong(old, newsgn ? x : -x);
  603. +   rep->sgn = newsgn;
  604. +   return rep;
  605. + }
  606. + IntRep* Icopy_ulong(IntRep* old, unsigned long x)
  607. + {
  608.     unsigned short src[SHORT_PER_LONG];
  609.     
  610.     unsigned short srclen = 0;
  611. !   while (x != 0)
  612.     {
  613. !     src[srclen++] = extract(x);
  614. !     x = down(x);
  615.     }
  616.   
  617.     IntRep* rep;
  618. ***************
  619. *** 305,316 ****
  620.       rep = old;
  621.   
  622.     rep->len = srclen;
  623. !   rep->sgn = newsgn;
  624.   
  625.     scpy(src, rep->s, srclen);
  626.   
  627.     return rep;
  628.   }
  629.   
  630.   // special case for zero -- it's worth it!
  631. --- 316,326 ----
  632.       rep = old;
  633.   
  634.     rep->len = srclen;
  635. !   rep->sgn = I_POSITIVE;
  636.   
  637.     scpy(src, rep->s, srclen);
  638.   
  639.     return rep;
  640.   }
  641.   
  642.   // special case for zero -- it's worth it!
  643. ***************
  644. *** 408,414 ****
  645.   double Itodouble(const IntRep* rep)
  646.   { 
  647.     double d = 0.0;
  648. !   double bound = HUGE / 2.0;
  649.     for (int i = rep->len - 1; i >= 0; --i)
  650.     {
  651.       unsigned short a = I_RADIX >> 1;
  652. --- 418,424 ----
  653.   double Itodouble(const IntRep* rep)
  654.   { 
  655.     double d = 0.0;
  656. !   double bound = DBL_MAX / 2.0;
  657.     for (int i = rep->len - 1; i >= 0; --i)
  658.     {
  659.       unsigned short a = I_RADIX >> 1;
  660. ***************
  661. *** 415,421 ****
  662.       while (a != 0)
  663.       {
  664.         if (d >= bound)
  665. !         return (rep->sgn == I_NEGATIVE) ? -HUGE : HUGE;
  666.         d *= 2.0;
  667.         if (rep->s[i] & a)
  668.           d += 1.0;
  669. --- 425,431 ----
  670.       while (a != 0)
  671.       {
  672.         if (d >= bound)
  673. !         return (rep->sgn == I_NEGATIVE) ? -HUGE_VAL : HUGE_VAL;
  674.         d *= 2.0;
  675.         if (rep->s[i] & a)
  676.           d += 1.0;
  677. ***************
  678. *** 435,441 ****
  679.   int Iisdouble(const IntRep* rep)
  680.   {
  681.     double d = 0.0;
  682. !   double bound = HUGE / 2.0;
  683.     for (int i = rep->len - 1; i >= 0; --i)
  684.     {
  685.       unsigned short a = I_RADIX >> 1;
  686. --- 445,451 ----
  687.   int Iisdouble(const IntRep* rep)
  688.   {
  689.     double d = 0.0;
  690. !   double bound = DBL_MAX / 2.0;
  691.     for (int i = rep->len - 1; i >= 0; --i)
  692.     {
  693.       unsigned short a = I_RADIX >> 1;
  694. ***************
  695. *** 460,466 ****
  696.     divide(num, den, q, r);
  697.     double d1 = double(q);
  698.    
  699. !   if (d1 == HUGE || d1 == -HUGE || sign(r) == 0)
  700.       return d1;
  701.     else      // use as much precision as available for fractional part
  702.     {
  703. --- 470,476 ----
  704.     divide(num, den, q, r);
  705.     double d1 = double(q);
  706.    
  707. !   if (d1 >= DBL_MAX || d1 <= -DBL_MAX || sign(r) == 0)
  708.       return d1;
  709.     else      // use as much precision as available for fractional part
  710.     {
  711. ***************
  712. *** 562,570 ****
  713.           if (diff == 0)
  714.             diff = docmp(x->s, tmp, xl);
  715.         }
  716.       }
  717. -     if (xsgn == I_NEGATIVE)
  718. -       diff = -diff;
  719.       return diff;
  720.     }
  721.   }
  722. --- 572,580 ----
  723.           if (diff == 0)
  724.             diff = docmp(x->s, tmp, xl);
  725.         }
  726. +       if (xsgn == I_NEGATIVE)
  727. +     diff = -diff;
  728.       }
  729.       return diff;
  730.     }
  731.   }
  732. ***************
  733. *** 2332,2338 ****
  734.           break;
  735.       }
  736.       else if (!know_base & !got_one && ch == '0')
  737. !       base = 8;
  738.       else if (!know_base & !got_one && base == 8 && (ch == 'X' || ch == 'x'))
  739.         base = 16;
  740.       else if (base == 8)
  741. --- 2342,2348 ----
  742.           break;
  743.       }
  744.       else if (!know_base & !got_one && ch == '0')
  745. !       base = 8, got_one = 1;
  746.       else if (!know_base & !got_one && base == 8 && (ch == 'X' || ch == 'x'))
  747.         base = 16;
  748.       else if (base == 8)
  749. *** 1.2    1992/05/31 04:14:02
  750. --- xobstack.cc    1992/12/28 07:41:27
  751. ***************
  752. *** 40,46 ****
  753.     while (lp != 0 && ((void*)lp > obj || (void*)(lp)->limit < obj))
  754.     {
  755.       plp = lp -> prev;
  756. !     delete(lp);
  757.       lp = plp;
  758.     }
  759.     if (lp)
  760. --- 40,46 ----
  761.     while (lp != 0 && ((void*)lp > obj || (void*)(lp)->limit < obj))
  762.     {
  763.       plp = lp -> prev;
  764. !     delete [] (char*)lp;
  765.       lp = plp;
  766.     }
  767.     if (lp)
  768. ***************
  769. *** 68,74 ****
  770.     new_chunk->prev = old_chunk;
  771.     new_chunk->limit = chunklimit = (char *) new_chunk + new_size;
  772.   
  773. !   bcopy((void*)objectbase, (void*)new_chunk->contents, obj_size);
  774.     objectbase = new_chunk->contents;
  775.     nextfree = objectbase + obj_size;
  776.   }
  777. --- 68,74 ----
  778.     new_chunk->prev = old_chunk;
  779.     new_chunk->limit = chunklimit = (char *) new_chunk + new_size;
  780.   
  781. !   memcpy((void*)new_chunk->contents, (void*)objectbase, obj_size);
  782.     objectbase = new_chunk->contents;
  783.     nextfree = objectbase + obj_size;
  784.   }
  785. *** 1.2    1992/06/08 20:42:41
  786. --- xregex.cc    1992/12/28 07:41:28
  787. ***************
  788. *** 49,55 ****
  789.     buf = new re_pattern_buffer;
  790.     reg = new re_registers;
  791.     if (fast)
  792. !     buf->fastmap = malloc(256);
  793.     else
  794.       buf->fastmap = 0;
  795.     buf->translate = (char*)transtable;
  796. --- 49,55 ----
  797.     buf = new re_pattern_buffer;
  798.     reg = new re_registers;
  799.     if (fast)
  800. !     buf->fastmap = (char*)malloc(256);
  801.     else
  802.       buf->fastmap = 0;
  803.     buf->translate = (char*)transtable;
  804. ***************
  805. *** 56,62 ****
  806.     if (tlen > bufsize)
  807.       bufsize = tlen;
  808.     buf->allocated = bufsize;
  809. !   buf->buffer = malloc(buf->allocated);
  810.     char* msg = re_compile_pattern((const char*)t, tlen, buf);
  811.     if (msg != 0)
  812.       (*lib_error_handler)("Regex", msg);
  813. --- 56,62 ----
  814.     if (tlen > bufsize)
  815.       bufsize = tlen;
  816.     buf->allocated = bufsize;
  817. !   buf->buffer = (char *)malloc(buf->allocated);
  818.     char* msg = re_compile_pattern((const char*)t, tlen, buf);
  819.     if (msg != 0)
  820.       (*lib_error_handler)("Regex", msg);
  821. *** 1.1    1992/03/22 07:42:32
  822. --- xsample.cc    1992/12/28 07:41:29
  823. ***************
  824. *** 21,27 ****
  825. --- 21,36 ----
  826.   #include <stream.h>
  827.   #include <xsmplsta.h>
  828.   #include <math.h>
  829. + #include <float.h>
  830.   
  831. + #ifndef HUGE_VAL
  832. + #ifdef HUGE
  833. + #define HUGE_VAL HUGE
  834. + #else
  835. + #define HUGE_VAL DBL_MAX
  836. + #endif
  837. + #endif
  838.   // error handling
  839.   
  840.   void default_SampleStatistic_error_handler(const char* msg)
  841. ***************
  842. *** 53,59 ****
  843.     int positive = p >= 0.5;
  844.     p = (positive)? 1.0 - p : p;
  845.     if (p <= 0.0 || df <= 0)
  846. !     t = HUGE;
  847.     else if (p == 0.5)
  848.       t = 0.0;
  849.     else if (df == 1)
  850. --- 62,68 ----
  851.     int positive = p >= 0.5;
  852.     p = (positive)? 1.0 - p : p;
  853.     if (p <= 0.0 || df <= 0)
  854. !     t = HUGE_VAL;
  855.     else if (p == 0.5)
  856.       t = 0.0;
  857.     else if (df == 1)
  858. ***************
  859. *** 78,85 ****
  860.   SampleStatistic::reset()
  861.   {
  862.       n = 0; x = x2 = 0.0;
  863. !     maxValue = -HUGE;
  864. !     minValue = HUGE;
  865.   }
  866.   
  867.   void
  868. --- 87,94 ----
  869.   SampleStatistic::reset()
  870.   {
  871.       n = 0; x = x2 = 0.0;
  872. !     maxValue = -HUGE_VAL;
  873. !     minValue = HUGE_VAL;
  874.   }
  875.   
  876.   void
  877. ***************
  878. *** 128,136 ****
  879.   SampleStatistic::confidence(int interval)
  880.   {
  881.     int df = n - 1;
  882. !   if (df <= 0) return HUGE;
  883.     double t = tval(double(100 + interval) * 0.005, df);
  884. !   if (t == HUGE)
  885.       return t;
  886.     else
  887.       return (t * stdDev()) / sqrt(double(n));
  888. --- 137,145 ----
  889.   SampleStatistic::confidence(int interval)
  890.   {
  891.     int df = n - 1;
  892. !   if (df <= 0) return HUGE_VAL;
  893.     double t = tval(double(100 + interval) * 0.005, df);
  894. !   if (t == HUGE_VAL)
  895.       return t;
  896.     else
  897.       return (t * stdDev()) / sqrt(double(n));
  898. ***************
  899. *** 140,148 ****
  900.   SampleStatistic::confidence(double p_value)
  901.   {
  902.     int df = n - 1;
  903. !   if (df <= 0) return HUGE;
  904.     double t = tval((1.0 + p_value) * 0.5, df);
  905. !   if (t == HUGE)
  906.       return t;
  907.     else
  908.       return (t * stdDev()) / sqrt(double(n));
  909. --- 149,157 ----
  910.   SampleStatistic::confidence(double p_value)
  911.   {
  912.     int df = n - 1;
  913. !   if (df <= 0) return HUGE_VAL;
  914.     double t = tval((1.0 + p_value) * 0.5, df);
  915. !   if (t == HUGE_VAL)
  916.       return t;
  917.     else
  918.       return (t * stdDev()) / sqrt(double(n));
  919. ***************
  920. *** 175,181 ****
  921.       bucketLimit[i] = lim;
  922.       lim += width;
  923.       }
  924. !     bucketLimit[howManyBuckets-1] = HUGE;    /* from math.h */
  925.   }
  926.   
  927.   SampleHistogram::~SampleHistogram()
  928. --- 184,190 ----
  929.       bucketLimit[i] = lim;
  930.       lim += width;
  931.       }
  932. !     bucketLimit[howManyBuckets-1] = HUGE_VAL;    /* from math.h */
  933.   }
  934.   
  935.   SampleHistogram::~SampleHistogram()
  936. ***************
  937. *** 211,217 ****
  938.   SampleHistogram::printBuckets(ostream& s)
  939.   {
  940.       for(int i = 0; i < howManyBuckets; i++) {
  941. !     if (bucketLimit[i] >= HUGE) {
  942.           s << "< max : " << bucketCount[i] << "\n";
  943.       } else {
  944.           s << "< " << bucketLimit[i] << " : " << bucketCount[i] << "\n";
  945. --- 220,226 ----
  946.   SampleHistogram::printBuckets(ostream& s)
  947.   {
  948.       for(int i = 0; i < howManyBuckets; i++) {
  949. !     if (bucketLimit[i] >= HUGE_VAL) {
  950.           s << "< max : " << bucketCount[i] << "\n";
  951.       } else {
  952.           s << "< " << bucketLimit[i] << " : " << bucketCount[i] << "\n";
  953. *** 1.1    1992/03/22 07:42:32
  954. --- xsmplhis.cc    1992/12/28 07:41:30
  955. ***************
  956. *** 22,27 ****
  957. --- 22,35 ----
  958.   #include <xsmplhis.h>
  959.   #include <math.h>
  960.   
  961. + #ifndef HUGE_VAL
  962. + #ifdef HUGE
  963. + #define HUGE_VAL HUGE
  964. + #else
  965. + #include <float.h>
  966. + #define HUGE_VAL DBL_MAX
  967. + #endif
  968. + #endif
  969.   
  970.   const int SampleHistogramMinimum = -2;
  971.   const int SampleHistogramMaximum = -1;
  972. ***************
  973. *** 47,53 ****
  974.       bucketLimit[i] = lim;
  975.       lim += width;
  976.       }
  977. !     bucketLimit[howManyBuckets-1] = HUGE;    /* from math.h */
  978.   }
  979.   
  980.   SampleHistogram::~SampleHistogram()
  981. --- 55,61 ----
  982.       bucketLimit[i] = lim;
  983.       lim += width;
  984.       }
  985. !     bucketLimit[howManyBuckets-1] = HUGE_VAL;    /* from math.h */
  986.   }
  987.   
  988.   SampleHistogram::~SampleHistogram()
  989. ***************
  990. *** 83,89 ****
  991.   SampleHistogram::printBuckets(ostream& s)
  992.   {
  993.       for(int i = 0; i < howManyBuckets; i++) {
  994. !     if (bucketLimit[i] >= HUGE) {
  995.           s << "< max : " << bucketCount[i] << "\n";
  996.       } else {
  997.           s << "< " << bucketLimit[i] << " : " << bucketCount[i] << "\n";
  998. --- 91,97 ----
  999.   SampleHistogram::printBuckets(ostream& s)
  1000.   {
  1001.       for(int i = 0; i < howManyBuckets; i++) {
  1002. !     if (bucketLimit[i] >= HUGE_VAL) {
  1003.           s << "< max : " << bucketCount[i] << "\n";
  1004.       } else {
  1005.           s << "< " << bucketLimit[i] << " : " << bucketCount[i] << "\n";
  1006. *** 1.1    1992/03/22 07:42:32
  1007. --- xsmplsta.cc    1992/12/28 07:41:30
  1008. ***************
  1009. *** 22,27 ****
  1010. --- 22,36 ----
  1011.   #include <xsmplsta.h>
  1012.   #include <math.h>
  1013.   
  1014. + #ifndef HUGE_VAL
  1015. + #ifdef HUGE
  1016. + #define HUGE_VAL HUGE
  1017. + #else
  1018. + #include <float.h>
  1019. + #define HUGE_VAL DBL_MAX
  1020. + #endif
  1021. + #endif
  1022.   // error handling
  1023.   
  1024.   void default_SampleStatistic_error_handler(const char* msg)
  1025. ***************
  1026. *** 53,59 ****
  1027.     int positive = p >= 0.5;
  1028.     p = (positive)? 1.0 - p : p;
  1029.     if (p <= 0.0 || df <= 0)
  1030. !     t = HUGE;
  1031.     else if (p == 0.5)
  1032.       t = 0.0;
  1033.     else if (df == 1)
  1034. --- 62,68 ----
  1035.     int positive = p >= 0.5;
  1036.     p = (positive)? 1.0 - p : p;
  1037.     if (p <= 0.0 || df <= 0)
  1038. !     t = HUGE_VAL;
  1039.     else if (p == 0.5)
  1040.       t = 0.0;
  1041.     else if (df == 1)
  1042. ***************
  1043. *** 78,85 ****
  1044.   SampleStatistic::reset()
  1045.   {
  1046.       n = 0; x = x2 = 0.0;
  1047. !     maxValue = -HUGE;
  1048. !     minValue = HUGE;
  1049.   }
  1050.   
  1051.   void
  1052. --- 87,94 ----
  1053.   SampleStatistic::reset()
  1054.   {
  1055.       n = 0; x = x2 = 0.0;
  1056. !     maxValue = -HUGE_VAL;
  1057. !     minValue = HUGE_VAL;
  1058.   }
  1059.   
  1060.   void
  1061. ***************
  1062. *** 128,136 ****
  1063.   SampleStatistic::confidence(int interval)
  1064.   {
  1065.     int df = n - 1;
  1066. !   if (df <= 0) return HUGE;
  1067.     double t = tval(double(100 + interval) * 0.005, df);
  1068. !   if (t == HUGE)
  1069.       return t;
  1070.     else
  1071.       return (t * stdDev()) / sqrt(double(n));
  1072. --- 137,145 ----
  1073.   SampleStatistic::confidence(int interval)
  1074.   {
  1075.     int df = n - 1;
  1076. !   if (df <= 0) return HUGE_VAL;
  1077.     double t = tval(double(100 + interval) * 0.005, df);
  1078. !   if (t == HUGE_VAL)
  1079.       return t;
  1080.     else
  1081.       return (t * stdDev()) / sqrt(double(n));
  1082. ***************
  1083. *** 140,148 ****
  1084.   SampleStatistic::confidence(double p_value)
  1085.   {
  1086.     int df = n - 1;
  1087. !   if (df <= 0) return HUGE;
  1088.     double t = tval((1.0 + p_value) * 0.5, df);
  1089. !   if (t == HUGE)
  1090.       return t;
  1091.     else
  1092.       return (t * stdDev()) / sqrt(double(n));
  1093. --- 149,157 ----
  1094.   SampleStatistic::confidence(double p_value)
  1095.   {
  1096.     int df = n - 1;
  1097. !   if (df <= 0) return HUGE_VAL;
  1098.     double t = tval((1.0 + p_value) * 0.5, df);
  1099. !   if (t == HUGE_VAL)
  1100.       return t;
  1101.     else
  1102.       return (t * stdDev()) / sqrt(double(n));
  1103.