home *** CD-ROM | disk | FTP | other *** search
- Make sure you have already applied either 'ps.diff.v1' or my
- original posting to comp.sources.bugs.
-
- To apply this, you need the 'patch' program which is available from
- the comp.sources.unix archives.
-
- Change directories to the top-level postscript directory (the one with
- the file "MANIFEST" in it) and apply this patch with the command:
-
- patch -p0 <ps.diff.v2
-
- _.John G. Myers
- jm36+@andrew.cmu.edu
-
- *** /usr/tmp/ps/CHANGES.JGM Thu Jul 28 13:53:12 1988
- --- ./CHANGES.JGM Thu Jul 28 14:58:10 1988
- ***************
- *** 1,6 ****
- ! Here is a patch that makes several bug fixes and enhancements to the Postscript
- interpreter recently posted. The changes are:
-
-
- Bugs fixed:
-
- --- 1,7 ----
- ! These patches make several bug fixes and enhancements to the Postscript
- interpreter recently posted. The changes are:
-
- + Version 1:
-
- Bugs fixed:
-
- ***************
- *** 41,46 ****
- --- 42,64 ----
- <string> getenv <false>
- if it does not.
-
- + Version 2:
- +
- + Bugs fixed:
- +
- + Fixed operators kshow, translate, scale, rotate, reversepath
- +
- + Casted NULL to appropriate type when it was passed as a parameter.
- +
- + Removed unused variables.
- +
- + Enhancements made:
- +
- + Each driver must now define the character pointer "DriverType". The
- + value of this variable is placed in the string produced by the
- + "version" operator.
- +
- + Added operators letter, note, and legal.
-
- John G. Myers
- jm36@andrew.cmu.edu
- diff -cr ./doc/hard-interface /cmu/math/jm36/src/ps/doc/hard-interface
- *** ./doc/hard-interface Fri Apr 1 22:41:07 1988
- --- /cmu/math/jm36/src/ps/doc/hard-interface Mon Mar 28 20:25:28 1988
- ***************
- *** 15,20 ****
- --- 15,29 ----
- * may be expected to be NULL.
- */
-
- + /* Begin jgm */
- + /*
- + * DriverType contains a pointer to a string naming the device that this
- + * is a driver for. The given string will show up in the "version"
- + * operator.
- + */
- + char *DriverType = "";
- + /* End jgm */
- +
- /************************* CREATION OF WINDOWS AND BITMAPS *******************/
-
- struct hardware *InitHardware () {}
- diff -cr ./doc/hard-interface.c /cmu/math/jm36/src/ps/doc/hard-interface.c
- *** ./doc/hard-interface.c Fri Apr 1 22:42:05 1988
- --- /cmu/math/jm36/src/ps/doc/hard-interface.c Mon Mar 28 20:24:19 1988
- ***************
- *** 17,22 ****
- --- 17,31 ----
- * of access that PostScript is interested in. Any Hardware parameter may be expected to be NULL.
- */
-
- + /* Begin jgm */
- + /*
- + * DriverType contains a pointer to a string naming the device that this
- + * is a driver for. The given string will show up in the "version"
- + * operator.
- + */
- + char *DriverType = "";
- + /* End jgm */
- +
- /*********************************** CREATION OF WINDOWS AND BITMAPS *******************/
-
- struct hardware *InitHardware () {}
- diff -cr ./postscript/psrc /cmu/math/jm36/src/ps/postscript/psrc
- *** ./postscript/psrc Fri Apr 1 22:48:12 1988
- --- /cmu/math/jm36/src/ps/postscript/psrc Wed Mar 23 23:05:53 1988
- ***************
- *** 125,130 ****
- --- 141,148 ----
- } def
-
- /kshow {
- + exch % jgm
- +
- showdict begin /p exch def
- dup length 0 ne {
- dup 0 get /last exch def
- ***************
- *** 132,137 ****
- --- 150,156 ----
- dup length 1 sub 1 exch getinterval {
- last exch dup /last exch def
- /p load exec
- + ( ) dup 0 last put show % jgm
- } forall
- } if
- end
- ***************
- *** 467,472 ****
- --- 493,526 ----
- [ 0 f f 0 0 0] w h [] framedevice
- end
- } def
- +
- + % Begin additions --jgm
- +
- + /letter {
- + 5 dict begin
- + /m [1.13889 0 0 -1.13889 0 0] def
- + /f m 0 get def
- + /h 11 72 mul f mul cvi def
- + /w 8.5 72 mul f mul 8 div cvi def
- + m 5 h put
- + m w h [] framedevice
- + end
- + } def
- +
- + /note { letter } def
- +
- + /legal {
- + 5 dict begin
- + /m [1.13889 0 0 -1.13889 0 0] def
- + /f m 0 get def
- + /h 14 72 mul f mul cvi def
- + /w 8.5 72 mul f mul 8 div cvi def
- + m 5 h put
- + m w h [] framedevice
- + end
- + } def
- +
- + % End additions --jgm
-
- /ascii-set ( !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~) def
-
- diff -cr ./source/X.c /cmu/math/jm36/src/ps/source/X.c
- *** ./source/X.c Fri Apr 1 22:44:35 1988
- --- /cmu/math/jm36/src/ps/source/X.c Fri Mar 11 23:39:36 1988
- ***************
- *** 17,22 ****
- --- 17,24 ----
- #define TRANSFER_SIZE 256
- #define XMAX 65535
-
- + char *DriverType = "X10"; /* jgm */
- +
- static int transfer [TRANSFER_SIZE + 1];
-
- static unsigned char reverse [0x100];
- diff -cr ./source/array.c /cmu/math/jm36/src/ps/source/array.c
- *** ./source/array.c Fri Apr 1 22:48:17 1988
- --- /cmu/math/jm36/src/ps/source/array.c Sun Mar 6 17:16:25 1988
- ***************
- *** 85,94 ****
- --- 85,96 ----
- return res;
- }
-
- + #ifdef notdef /* jgm */
- static Object *Body (item) Object item;
- {
- return item.u.Array;
- }
- + #endif /* jgm */
-
- #define Body(a) ((a).u.Array)
-
- diff -cr ./source/config.c /cmu/math/jm36/src/ps/source/config.c
- *** ./source/config.c Fri Apr 1 22:48:20 1988
- --- /cmu/math/jm36/src/ps/source/config.c Sat Mar 12 00:08:51 1988
- ***************
- *** 20,30 ****
- Type Real, Name, Operator, String, Poly, Float, FontID;
-
- extern Object Absent, Nil, SysDict;
-
- ! char default_library[] = "/usr/ral/lib/postscript";
-
- Init ()
- {
- Nil = MakeObject ((Type) 0);
- Null = Nil.type = MakeType (SizeNull);
- EmptyDict (Null); /* needed because of this recursion */
- --- 20,33 ----
- Type Real, Name, Operator, String, Poly, Float, FontID;
-
- extern Object Absent, Nil, SysDict;
- + extern char *DriverType;
-
- ! char default_library[] = "/usr/ral/lib/postscript";
-
- Init ()
- {
- + char versionbuf[1024]; /* --jgm */
- +
- Nil = MakeObject ((Type) 0);
- Null = Nil.type = MakeType (SizeNull);
- EmptyDict (Null); /* needed because of this recursion */
- ***************
- *** 87,91 ****
- Install ("polytype", DictFrom (Poly));
- Install ("fonttype", DictFrom (FontID));
-
- ! Install ("version", StringFrom ("Version 1.4 with mods by jgm")); /* jgm */
- }
- --- 90,98 ----
- Install ("polytype", DictFrom (Poly));
- Install ("fonttype", DictFrom (FontID));
-
- ! /* Begin jgm */
- ! strcpy(versionbuf, DriverType);
- ! strcat(versionbuf, " version 1.4 with jgm mods v2");
- ! Install ("version", StringFrom (versionbuf));
- ! /* End jgm */
- }
- diff -cr ./source/device.c /cmu/math/jm36/src/ps/source/device.c
- *** ./source/device.c Fri Apr 1 22:41:29 1988
- --- /cmu/math/jm36/src/ps/source/device.c Sun Mar 6 17:29:48 1988
- ***************
- *** 200,206 ****
- UnlinkDevice (d);
- }
- else
- ! */BitBlt (NULL, res->dev, NewDevicePoint (0, 0), NewDevicePoint (0, 0), ex, ROP_FALSE);
-
- return res;
- }
- --- 200,206 ----
- UnlinkDevice (d);
- }
- else
- ! */BitBlt ((struct hardware *)NULL, res->dev, NewDevicePoint (0, 0), NewDevicePoint (0, 0), ex, ROP_FALSE); /* cast NULL --jgm */
-
- return res;
- }
- diff -cr ./source/file.c /cmu/math/jm36/src/ps/source/file.c
- *** ./source/file.c Fri Apr 1 22:45:31 1988
- --- /cmu/math/jm36/src/ps/source/file.c Sun Mar 6 17:16:15 1988
- ***************
- *** 168,184 ****
- --- 168,188 ----
-
- #define Getc(a) getc(a)
-
- + #ifdef notdef /* jgm */
- static int Getchar ()
- {
- return Getc (stdin);
- }
- + #endif /* jgm */
-
- #define Getchar getchar
-
- + #ifdef notdef /* jgm */
- static int Status (file) Object file;
- {
- return Body (file)->available;
- }
- + #endif /* jgm */
-
- #define Status(f) (Body(f)->available)
-
- ***************
- *** 306,312 ****
- Cbreak (FALSE);
- }
-
- ! static cbreak = FALSE, echoing = TRUE;
-
- /*ARGSUSED*/
- Cbreak (cond) int cond;
- --- 310,316 ----
- Cbreak (FALSE);
- }
-
- ! static /* cbreak = FALSE, (removed --jgm) */ echoing = TRUE;
-
- /*ARGSUSED*/
- Cbreak (cond) int cond;
- diff -cr ./source/fill.c /cmu/math/jm36/src/ps/source/fill.c
- *** ./source/fill.c Fri Apr 1 22:44:44 1988
- --- /cmu/math/jm36/src/ps/source/fill.c Sun Mar 6 17:46:45 1988
- ***************
- *** 149,155 ****
- UnlinkDevice (gstate->clipdevice);
- gstate->clipdevice = NULL;
-
- ! SetClipHardware (gstate->device->dev, NULL);
-
- return TRUE;
- }
- --- 149,155 ----
- UnlinkDevice (gstate->clipdevice);
- gstate->clipdevice = NULL;
-
- ! SetClipHardware (gstate->device->dev, (struct hardware *)NULL); /* cast NULL --jgm */
-
- return TRUE;
- }
- ***************
- *** 226,232 ****
- static int FillIt (path_a, rule_a, path_b, rule_b, emitfn)
- Path path_a, path_b; int (*rule_a)(), (*rule_b)(); void (*emitfn)();
- {
- ! Path new;
- static int edgecmp ();
- static void Trapezoids (), BuildEdgeList ();
-
- --- 226,232 ----
- static int FillIt (path_a, rule_a, path_b, rule_b, emitfn)
- Path path_a, path_b; int (*rule_a)(), (*rule_b)(); void (*emitfn)();
- {
- ! /* Path new; (unused --jgm) */
- static int edgecmp ();
- static void Trapezoids (), BuildEdgeList ();
-
- ***************
- *** 288,298 ****
- {
- struct edge *up_edge;
- int i, count_a = 0, count_b = 0;
- ! static void RemoveEdges ();
-
- for (i = 0; i < ninteresting; i++)
- {
- ! static void Emit ();
- int d_a = 0, d_b = 0;
-
- if (interesting[i]->clip)
- --- 288,298 ----
- {
- struct edge *up_edge;
- int i, count_a = 0, count_b = 0;
- ! /* static void RemoveEdges (); (unused --jgm) */
-
- for (i = 0; i < ninteresting; i++)
- {
- ! /* static void Emit (); (unused --jgm) */
- int d_a = 0, d_b = 0;
-
- if (interesting[i]->clip)
- diff -cr ./source/font.c /cmu/math/jm36/src/ps/source/font.c
- *** ./source/font.c Fri Apr 1 22:45:11 1988
- --- /cmu/math/jm36/src/ps/source/font.c Sun Mar 6 17:11:46 1988
- ***************
- *** 535,541 ****
- for (;;)
- {
- int code = *++s;
- ! HardPoint offset, cp;
-
- offset = Adjust (DExtToInt (last_width), code);
- loc.hx += offset.hx;
- --- 535,541 ----
- for (;;)
- {
- int code = *++s;
- ! HardPoint offset/* , cp (unused --jgm) */;
-
- offset = Adjust (DExtToInt (last_width), code);
- loc.hx += offset.hx;
- diff -cr ./source/gsave.c /cmu/math/jm36/src/ps/source/gsave.c
- *** ./source/gsave.c Fri Apr 1 22:39:48 1988
- --- /cmu/math/jm36/src/ps/source/gsave.c Sun Mar 6 17:34:40 1988
- ***************
- *** 75,81 ****
- SetScreen (gstate->screen.frequency, gstate->screen.rotation, gstate->screen.thresh);
- if (tflag)
- SetTransfer (gstate->transfer.tran);
- ! SetClipHardware (gstate->device->dev, (gstate->clipdevice ? gstate->clipdevice->dev : NULL));
- }
-
- return TRUE;
- --- 75,81 ----
- SetScreen (gstate->screen.frequency, gstate->screen.rotation, gstate->screen.thresh);
- if (tflag)
- SetTransfer (gstate->transfer.tran);
- ! SetClipHardware (gstate->device->dev, (gstate->clipdevice ? gstate->clipdevice->dev : (struct hardware *)NULL)); /* Cast NULL --jgm */
- }
-
- return TRUE;
- diff -cr ./source/image.c /cmu/math/jm36/src/ps/source/image.c
- *** ./source/image.c Fri Apr 1 22:48:26 1988
- --- /cmu/math/jm36/src/ps/source/image.c Sun Mar 6 17:34:36 1988
- ***************
- *** 250,256 ****
- FillMask (mask, i, dep);
-
- BitBlt (from, mask, NewDevicePoint (0, 0), NewDevicePoint (0, 0), HardwareExtent (from), ROP_NXOR);
- ! BitBlt (NULL, temp, NewDevicePoint (0, 0), NewDevicePoint (0, 0), HardwareExtent (temp), ROP_TRUE);
- for (j = 0; j < dep; j++)
- BitBlt (mask, temp, NewDevicePoint (j, 0), NewDevicePoint (0, 0), HardwareExtent (mask), ROP_AND);
- for (j = 0; j < w; j++)
- --- 250,256 ----
- FillMask (mask, i, dep);
-
- BitBlt (from, mask, NewDevicePoint (0, 0), NewDevicePoint (0, 0), HardwareExtent (from), ROP_NXOR);
- ! BitBlt ((struct hardware *)NULL, temp, NewDevicePoint (0, 0), NewDevicePoint (0, 0), HardwareExtent (temp), ROP_TRUE); /* cast NULL --jgm */
- for (j = 0; j < dep; j++)
- BitBlt (mask, temp, NewDevicePoint (j, 0), NewDevicePoint (0, 0), HardwareExtent (mask), ROP_AND);
- for (j = 0; j < w; j++)
- diff -cr ./source/matrix.c /cmu/math/jm36/src/ps/source/matrix.c
- *** ./source/matrix.c Fri Apr 1 22:43:11 1988
- --- /cmu/math/jm36/src/ps/source/matrix.c Wed Mar 23 22:40:28 1988
- ***************
- *** 126,131 ****
- --- 126,132 ----
- static int PTranslate ()
- {
- Object tx, ty, mat;
- + Matrix m;
- float x, y;
-
- if (!OpCheck (2, 1))
- ***************
- *** 136,141 ****
- --- 137,144 ----
- return Push (OpStack, mat), Error (PInvAccess);
- else if (lengthArray (mat) != 6)
- return Push (OpStack, mat), Error (PRangeCheck);
- + else if (!ExtractMatrix (&m, mat)) /* --jgm */
- + return Push (OpStack, mat), Error (PTypeCheck); /* --jgm */
- else
- {
- ty = Pop (OpStack);
- ***************
- *** 153,159 ****
- else
- return Push (OpStack, tx), Push (OpStack, ty), Push (OpStack, mat), Error (PTypeCheck);
-
- ! VOID AssignMatrix (mat, NewMatrix (1.0, 0.0, 0.0, 1.0, x, y));
-
- return Push (OpStack, mat);
- }
- --- 156,164 ----
- else
- return Push (OpStack, tx), Push (OpStack, ty), Push (OpStack, mat), Error (PTypeCheck);
-
- ! /* VOID AssignMatrix (mat, NewMatrix (1.0, 0.0, 0.0, 1.0, x, y)); WRONG --jgm */
- ! VOID AssignMatrix (mat, Translate(m, x, y)); /* --jgm */
- !
-
- return Push (OpStack, mat);
- }
- ***************
- *** 178,184 ****
- static int PScale ()
- {
- Object tx, ty, mat;
- ! float x, y;
-
- if (!OpCheck (2, 1))
- return FALSE;
- --- 183,190 ----
- static int PScale ()
- {
- Object tx, ty, mat;
- ! Matrix m; /* --jgm */
- ! float x, y;
-
- if (!OpCheck (2, 1))
- return FALSE;
- ***************
- *** 188,193 ****
- --- 194,201 ----
- return Push (OpStack, mat), Error (PInvAccess);
- else if (lengthArray (mat) != 6)
- return Push (OpStack, mat), Error (PRangeCheck);
- + else if (!ExtractMatrix (&m, mat)) /* --jgm */
- + return Push (OpStack, mat), Error (PTypeCheck); /* --jgm */
- else
- {
- ty = Pop (OpStack);
- ***************
- *** 205,211 ****
- else
- return Push (OpStack, tx), Push (OpStack, ty), Push (OpStack, mat), Error (PTypeCheck);
-
- ! VOID AssignMatrix (mat, NewMatrix (x, 0.0, 0.0, y, 0.0, 0.0));
-
- return Push (OpStack, mat);
- }
- --- 213,220 ----
- else
- return Push (OpStack, tx), Push (OpStack, ty), Push (OpStack, mat), Error (PTypeCheck);
-
- ! /* VOID AssignMatrix (mat, NewMatrix (x, 0.0, 0.0, y, 0.0, 0.0)); WRONG --jgm */
- ! VOID AssignMatrix (mat, Scale(m, x, y)); /* --jgm */
-
- return Push (OpStack, mat);
- }
- ***************
- *** 249,256 ****
- a = BodyReal (ang);
- else
- return Push (OpStack, ang), Push (OpStack, mat), Error (PTypeCheck);
- !
- ! VOID AssignMatrix (mat, NewMatrix (cos(a), sin(a), -sin(a), -cos(a), 0.0, 0.0));
-
- return Push (OpStack, mat);
- }
- --- 258,265 ----
- a = BodyReal (ang);
- else
- return Push (OpStack, ang), Push (OpStack, mat), Error (PTypeCheck);
- ! a = Rad(a); /* jgm */
- ! VOID AssignMatrix (mat, NewMatrix (cos(a), sin(a), -sin(a), cos(a), 0.0, 0.0)); /* last "-cos" changed to "cos" --jgm */
-
- return Push (OpStack, mat);
- }
- diff -cr ./source/name.c /cmu/math/jm36/src/ps/source/name.c
- *** ./source/name.c Fri Apr 1 22:39:54 1988
- --- /cmu/math/jm36/src/ps/source/name.c Sun Mar 6 17:16:20 1988
- ***************
- *** 107,113 ****
-
- static int HashName (s, length) unsigned char *s; int length;
- {
- ! int i, res = 0;
-
- while (length--)
- res += *s++;
- --- 107,113 ----
-
- static int HashName (s, length) unsigned char *s; int length;
- {
- ! int /* i, (unused --jgm) */ res = 0;
-
- while (length--)
- res += *s++;
- diff -cr ./source/operator.c /cmu/math/jm36/src/ps/source/operator.c
- *** ./source/operator.c Fri Apr 1 22:41:54 1988
- --- /cmu/math/jm36/src/ps/source/operator.c Sun Mar 6 17:16:23 1988
- ***************
- *** 69,75 ****
- {
- Object res;
- struct op_struct *op;
- ! int i;
- res = Cvx (MakeObject (Operator));
- res.u.Operator = op = (struct op_struct *) Malloc (sizeof (struct op_struct));
-
- --- 69,75 ----
- {
- Object res;
- struct op_struct *op;
- ! /* int i; (unused --jgm) */
- res = Cvx (MakeObject (Operator));
- res.u.Operator = op = (struct op_struct *) Malloc (sizeof (struct op_struct));
-
- ***************
- *** 130,139 ****
- --- 130,141 ----
- TypeInstall (type, name, res);
- }
-
- + #ifdef notdef /* jgm */
- static struct op_struct *Body (item) Object item;
- {
- return item.u.Operator;
- }
- + #endif /* jgm */
-
- #define Body(op) ((op).u.Operator)
-
- diff -cr ./source/path.c /cmu/math/jm36/src/ps/source/path.c
- *** ./source/path.c Fri Apr 1 22:43:14 1988
- --- /cmu/math/jm36/src/ps/source/path.c Sat Mar 19 17:00:52 1988
- ***************
- *** 194,200 ****
-
- if ((res = ReversePath (gstate->path)) == NULL)
- return Error (PLimitCheck);
- ! SetPath (&gstate->path, res);
- return TRUE;
- }
-
- --- 194,201 ----
-
- if ((res = ReversePath (gstate->path)) == NULL)
- return Error (PLimitCheck);
- ! /* SetPath (&gstate->path, res); --jgm */
- ! gstate->path = res; /* Don't free gstate->path twice. --jgm */
- return TRUE;
- }
-
- diff -cr ./source/pixrect.c /cmu/math/jm36/src/ps/source/pixrect.c
- *** ./source/pixrect.c Fri Apr 1 22:40:34 1988
- --- /cmu/math/jm36/src/ps/source/pixrect.c Fri Mar 11 23:35:16 1988
- ***************
- *** 15,20 ****
- --- 15,22 ----
- #include "canon.h"
- #include <pixrect/pixrect_hs.h>
-
- + char *DriverType = "Sun pixrect"; /* jgm */
- +
- int rop_map [] =
- {
- PIX_SRC & PIX_NOT (PIX_SRC),
- diff -cr ./source/state.c /cmu/math/jm36/src/ps/source/state.c
- *** ./source/state.c Fri Apr 1 22:43:34 1988
- --- /cmu/math/jm36/src/ps/source/state.c Sun Mar 6 17:33:19 1988
- ***************
- *** 114,120 ****
-
- int ErasePage ()
- {
- ! Paint (NULL, gstate->device->dev,
- NewDevicePoint (0, 0), NewDevicePoint (0, 0),
- HardwareExtent (gstate->device->dev),
- White);
- --- 114,120 ----
-
- int ErasePage ()
- {
- ! Paint ((struct hardware *)NULL, gstate->device->dev, /* cast NULL --jgm */
- NewDevicePoint (0, 0), NewDevicePoint (0, 0),
- HardwareExtent (gstate->device->dev),
- White);
- diff -cr ./source/ww.c /cmu/math/jm36/src/ps/source/ww.c
- *** ./source/ww.c Fri Apr 1 22:41:00 1988
- --- /cmu/math/jm36/src/ps/source/ww.c Fri Mar 11 23:39:23 1988
- ***************
- *** 14,19 ****
- --- 14,21 ----
- #include "canon.h"
- #include "wwinfo.h"
-
- + char *DriverType = "ww"; /* jgm */
- +
- static void xxrasterop ();
-
- static struct hardware *NewHardware ();
-