delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/02/24/18:30:57

Date: Mon, 24 Feb 92 15:35:38 -0700
From: gershon%gr AT cs DOT utah DOT edu (Elber Gershon)
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: DJGPP minor problems
Status: O

hi,
	Below are some minor problems (and some fixes) I found in DJGPP.
Since I just tried to subscribe to this list please CC me directly on
any reply. Several problems were already reported to DJ directly (who
kindly point me to this list).

*  emu387 has a bug when comparing two negative numbers. Basically there are
   compared as two positive and obviously return the opposite result. The
   fix is trivial in compare.cc to add the following two lines just before
   the diff sign tests, for the return statements:

  if (a.sign) // The two numbers are negative.
    diff = -diff;

*  MouseWarp does not update last_event as it should and therefore does
   not function. below is the modified MouseWarp from mouse.c

   void MouseWarp(int x, int y)
   {
     REGISTERS r;
     r.ax = 4;
     r.cx = last_event.x = x;
     r.dx = last_event.y = y;
     int33(&r);
   }

*  Since no driver for ATI version 1 existed, I modified the version 2
   provided. The modified version was mailed to DJ.

*  CPP is defining 'unix'. Although, in general, this should not impose any
   problem, any attempt to port a unix program that is using this constant
   may cause problems. DJGPP is not running on unix system. Also how about
   defining a constant for DJGPP (__DJGPP__!?).

*  MouseGetEvent will always "eat" characters even if no M_KEYPRESS event
   was specified. This is not the intuitive behaviour. If no M_KEYPRESS
   event was requested then keyboard buffer should not be tempered with.
   The fix is trivial in mouse.c:
       instead of "if (kbhit())", do "if (flags & M_KEYPRESS && kbhit())"

*  The line drawing in the graphics package can be optimized significatly
   by unfolding the dot plotting into the line drawing and updating the
   frame buffer pointer directly (no multiplication with 0xd0000000 is
   required any more). Clipping should be done in advance instead
   of at the dot plotting level.
     I tried to unfold the dot plotting into the line drawing without
   clipping and found a speedup factor of 2 to 3.
     Before I dive further, are you aware of anyone else trying to do the
   same thing?

*  The small program below generates a bogus warning about ':' WITHIN a
   comments. I have no idea why. The warning is:

       bug.c:23:Rest of line ignored. 1st junk character valued 58 (:).

   A script of the environment set and compilation follows.

These are minor things! I am VERY happy with the quality of this compiler.
In fact for a reason I do not understand, its generated code is much smaller
than BC++!!!

Thanks for such a fine compiler.

Gershon
-----------------------------------------------------------------------------
/* GNUPLOT - standard.c */
/*
 * Copyright (C) 1986, 1987, 1990, 1991   Thomas Williams, Colin Kelley
 *
 * Permission to use, copy, and distribute this software and its
 * documentation for any purpose with or without fee is hereby granted, 
 * provided that the above copyright notice appear in all copies and 
 * that both that copyright notice and this permission notice appear 
 * in supporting documentation.
 *
 * Permission to modify the software is granted, but not the right to
 * distribute the modified code.  Modifications are to be distributed 
 * as patches to released version.
 *  
 * This software is provided "as is" without express or implied warranty.
 * 
 *
 * AUTHORS
 * 
 *   Original Software:
 *     Thomas Williams,  Colin Kelley.
 * 
 *   Gnuplot 2.0 additions:
 *       Russell Lang, Dave Kotz, John Campbell.
 *
 *   Gnuplot 3.0 additions:
 *       Gershon Elber and many others.
 * 
 * Send your comments or suggestions to 
 *  pixar!info-gnuplot AT sun DOT com.
 * This is a mailing list; to join it send a note to 
 *  pixar!info-gnuplot-request AT sun DOT com.  
 * Send bug reports to
 *  pixar!bug-gnuplot AT sun DOT com.
 */

/* jzero for x in [0,8]
 * Index 5849, 19.22 digits precision
 */
double pjzero[] = {
	 0.4933787251794133561816813446e+21,
	-0.11791576291076105360384408e+21,
	 0.6382059341072356562289432465e+19,
	-0.1367620353088171386865416609e+18,
	 0.1434354939140346111664316553e+16,
	-0.8085222034853793871199468171e+13,
	 0.2507158285536881945555156435e+11,
	-0.4050412371833132706360663322e+8,
	 0.2685786856980014981415848441e+5
};

double qjzero[] = {
	0.4933787251794133562113278438e+21,
	0.5428918384092285160200195092e+19,
	0.3024635616709462698627330784e+17,
	0.1127756739679798507056031594e+15,
	0.3123043114941213172572469442e+12,
	0.669998767298223967181402866e+9,
	0.1114636098462985378182402543e+7,
	0.1363063652328970604442810507e+4,
	0.1e+1
};
-----------------------------------------------------------------------------
Script V1.1 session started Sat Feb 22 09:02:08 1992


Microsoft(R) MS-DOS(R) Version 5.00
             (C)Copyright Microsoft Corp 1981-1991.

C:\TEMP > djgcc

C:\TEMP > 
C:\TEMP > path d:\;c:\bat;c:\tools\djgpp\bin;c:\bc\bin;c:\util;c:\unix;c:\windows;c:\cards;c:\graphics\bin;c:\msdos5;c:\gif

C:\TEMP > 
C:\TEMP > set GCCBIN=c:\tools\djgpp\bin

C:\TEMP > set GCCINC=c:/tools/djgpp/include

C:\TEMP > set GCCLIB=c:/tools/djgpp/lib

C:\TEMP > set GCCTMP=c:/temp

C:\TEMP > set GO32TMP=c:/temp

C:\TEMP > set GO32=emu c:/tools/djgpp/emu387/emu387 ansi driver c:/tools/djgpp/drivers/ati.grd gw 640 gh 480

C:\TEMP > set GRMODE=

C:\TEMP > 
C:\TEMP > 
C:\TEMP > c:\msdos5\mem/c

Conventional Memory :

  Name                Size in Decimal       Size in Hex
-------------      ---------------------   -------------
  MSDOS              16464      ( 16.1K)       4050
  HIMEM               1184      (  1.2K)        4A0
  TDH386              8656      (  8.5K)       21D0
  MOUSE              15424      ( 15.1K)       3C40
  NANSI               2992      (  2.9K)        BB0
  RAMDRIVE            1184      (  1.2K)        4A0
  COMMAND             3968      (  3.9K)        F80
  CONV                3664      (  3.6K)        E50
  FASTBF26            1440      (  1.4K)        5A0
  CMDEDIT             9712      (  9.5K)       25F0
  FDREAD               192      (  0.2K)         C0
  SCRIPT             18432      ( 18.0K)       4800
  PUSHDIR              768      (  0.8K)        300
  COMMAND             4608      (  4.5K)       1200
  FREE                  64      (  0.1K)         40
  FREE                  32      (  0.0K)         20
  FREE                  32      (  0.0K)         20
  FREE              566096      (552.8K)      8A350

Total  FREE :       566224      (553.0K) 

Total bytes available to programs :                           566224   (553.0K)
Largest executable program size :                             565616   (552.4K)

   1441792 bytes total contiguous extended memory
         0 bytes available contiguous extended memory
   1171456 bytes available XMS memory
           MS-DOS resident in High Memory Area

C:\TEMP > 
C:\C\GNUPLOT > gcc -c bug.c
bug.c:23:Rest of line ignored. 1st junk character valued 58 (:).

C:\C\GNUPLOT > exit
Script completed Sat Feb 22 09:03:04 1992

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019