home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / ENTERPRS / CPM / UTILS / A / AZTECLIB.PAT < prev    next >
Text File  |  2000-06-30  |  3KB  |  125 lines

  1. Here is a set of patches I've made to the CP/M Aztec Vers. 1.06D
  2. C library which I consider to be bug fixes.  They have been tested
  3. to my satisfaction; I use them myself.  Of course, if you apply
  4. these "changes" to some other version of an Aztec C library,
  5. you're on your own.  The code fragments shown are bracketed vertically
  6. by ********'s.  Lines which were deleted begin with '-' and lines
  7. which were modified or added begin with '+'.
  8.         Howard Johnson, 11 Dec '85
  9.  
  10. This modification of FSUBS.ASM fixes an obscure bug which is manifest
  11. on overflow when converting a floating point number to a long integer.
  12.  
  13. ********    FSUBS.ASM, starting near line 1261
  14.   ltoobig:
  15.       xchg
  16.       mov    a,c
  17.       ora    a
  18.       jm    bigneg
  19. +     mvi    m,0ffH        ; was 07fH
  20.       inx    h
  21.       mvi    m,0ffH
  22.       inx    h
  23.       mvi    m,0ffH
  24.       inx    h
  25. +     mvi    m,07fH        ; was 0ffH
  26.       jmp    oflow
  27.   bigneg:
  28. +     mvi    m,0        ; was 080H
  29.       inx    h
  30.       mvi    m,0
  31.       inx    h
  32.       mvi    m,0
  33.       inx    h
  34. +     mvi    m,080H        ; was 0
  35.       jmp    oflow
  36. ********
  37.  
  38. This modification of FTOA.ASM was made so floating point numbers
  39. get printed the same way they would be printed under UNIX.
  40. N.B.:  These changes are rather subtle.
  41.  
  42. ********    FTOA.ASM, starting near line 168
  43.       jm    chkm4
  44.       mov    a,c
  45.       cmp    l
  46. +     mvi    a,2        ;%g -> %e
  47. +     jnc    setformat
  48. +     mvi    a,3        ;exp < maxdig, so use %g -> %f
  49.       jmp    setformat
  50.   ;
  51.   chkm4:
  52. ********    FTOA.ASM, starting near line 215
  53.       call    .utod        ;and repair if necessary
  54.       inx    b
  55.       lda    fflag
  56. +     ani    1        ; was ora a
  57.       jz    rndok
  58.       lhld    ndig
  59.       inx    h
  60.       shld    ndig
  61.   rndok:
  62.       mov    h,b
  63.       mov    l,c
  64.       shld    exp
  65.       lda    fflag
  66. +     ani    1        ; was ora a
  67.       jz    unpack
  68.       mov    a,b
  69.       ora    a
  70. ********    FTOA.ASM, starting near line 312
  71.   ;
  72.   unpdone:
  73.       lda    fflag
  74. +     ani    2        ; originally %g ?
  75. +     jz    nochop
  76. +     mvi    a,'0'
  77. +     lhld    chrptr
  78. + chopdig:
  79. +     dcx    h
  80. +     cmp    m
  81. +     jz    chopdig
  82. +     mvi    a,'.'
  83. +     cmp    m
  84. +     jz    chopdun
  85. +     inx    h
  86. + chopdun:
  87. +     shld    chrptr
  88. + nochop:
  89. +     lda    fflag
  90. +     ani    1        ;%f or %g -> %f ?
  91.       jnz    alldone
  92.   ;
  93.       lhld    chrptr
  94. ********
  95.  
  96. This modification to SCAN.C changes the %[ conversion of scanf() to work
  97. the way it does under UNIX.  It no longer skips over blank characters
  98. before reading characters from the specified set.
  99. N.B.:  The skip-over-blanks peculiarity is documented in Aztec scanf()
  100. manuals.  Changing "%[a-z]" to " %[a-z]" will fix existing Aztec C programs
  101. broken by this modification.
  102.  
  103. ********    SCAN.C, starting near line 113
  104.                   for (cp = tlist ; (c = *fmt++) != ']' ; )
  105.                       *cp++ = c;
  106.                   *cp = 0;
  107. +                 goto charstring; /* instead of goto string */
  108.               case 's':
  109.                   lflag = 1;
  110.                   tlist[0] = ' ';
  111. ********
  112.  
  113. This modification to IOCTL.C initializes the internal tty structure to
  114. values a program calling ioctl(fd, TIOCGETP, &tty) might expect to see.
  115.  
  116. ********    IOCTL.C, starting near line 9
  117.   extern int (*Rd_tab[])();
  118.   extern int (*Wrt_tab[])();
  119.   
  120. + struct sgttyb Tty_ctl = { '\b', '\030', CRMOD|ECHO };
  121.   extern char _Eol;
  122.   extern int tty_rd();
  123.   static int raw_rd(), raw_wr();
  124. ********
  125.