🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #300

gcc bugs

#300
From: Kent S. Gordon
Date: Thu, 06 Aug 1992 10:59
1773 lines
51273 bytes
I have installed gcc-2.1 on several different machines.
On all the machines gcc was installed at /usr/gnu/bin with
the support files in /usr/gnu/lib instead of /usr/local/bin
and /usr/local/lib.  This was done by changing exec_prefix to /usr/gnu
in Makefile.in.
I have successfully installed gcc on :
	DECstation 5000/120 running Ultrix 4.2 (no problems)
	Mips Magnum running RiscOS 4.52 configured as sysv(no problems)
	Mips Magnum running RiscOS 4.52 configured as bsd43 (see below)
	Sun Sparcstation 2 running SunOs 4.1.1 ( no problems)
	IBM RS/6000 model 550 running AIX 3.1.5 (no problems)

The installation went smoothly except for mips as bsd43.
Mips had a bug in their headers /bsd43/usr/include/stddef.h had size_t
defined as a unsigned long and /bsd43/usr/include/sys/types.h it is
declared as a long.  I changed the sys/types.h to be unsigned long as
this is what Mips uses under sysv.
mips.c did not check for NO_STAB_H (Mips does not have a stab.h)so
I changed config/mips.c to fixes this. The diff -c follows
*** config/mips.c	Sat Jul 18 16:40:46 1992
--- config/mips.c.orig	Sat Mar 21 17:33:19 1992
***************
*** 50,56 ****
  #define X_OK 1
  #endif
  
! #if defined (USG) || defined (NO_STAB_H)
  #include "gstab.h"  /* If doing DBX on sysV, use our own stab.h.  */
  #else
  #include <stab.h>  /* On BSD, use the system's stab.h.  */
--- 50,56 ----
  #define X_OK 1
  #endif
  
! #ifdef USG
  #include "gstab.h"  /* If doing DBX on sysV, use our own stab.h.  */
  #else
  #include <stab.h>  /* On BSD, use the system's stab.h.  */

When makeing the stage1 and stage2 compiler, I would hang when
compiling enquire.c. if a ctrl-D was sent from the terminal the
compile would stop with a core in ld. If collect2 was compiled with
cc then the install worked.
The follows is the output from running the installed gcc using a
collect2 compiled with gcc.
gcc -v enquire.c < /dev/null
*** config/mips.c	Sat Jul 18 16:40:46 1992
--- config/mips.c.orig	Sat Mar 21 17:33:19 1992
***************
*** 50,56 ****
  #define X_OK 1
  #endif
  
! #if defined (USG) || defined (NO_STAB_H)
  #include "gstab.h"  /* If doing DBX on sysV, use our own stab.h.  */
  #else
  #include <stab.h>  /* On BSD, use the system's stab.h.  */
--- 50,56 ----
  #define X_OK 1
  #endif
  
! #ifdef USG
  #include "gstab.h"  /* If doing DBX on sysV, use our own stab.h.  */
  #else
  #include <stab.h>  /* On BSD, use the system's stab.h.  */

When makeing the stage1 and stage2 compiler, I would hang when
compiling enquire.c. if a ctrl-D was sent from the terminal the
compile would stop with a core in ld. If collect2 was compiled with
cc then the install worked.
The follows is the output from running the installed gcc using a
collect2 compiled with gcc.
gcc -v enquire.c < /dev/null
*** config/mips.c	Sat Jul 18 16:40:46 1992
--- config/mips.c.orig	Sat Mar 21 17:33:19 1992
***************
*** 50,56 ****
  #define X_OK 1
  #endif
  
! #if defined (USG) || defined (NO_STAB_H)
  #include "gstab.h"  /* If doing DBX on sysV, use our own stab.h.  */
  #else
  #include <stab.h>  /* On BSD, use the system's stab.h.  */
--- 50,56 ----
  #define X_OK 1
  #endif
  
! #ifdef USG
  #include "gstab.h"  /* If doing DBX on sysV, use our own stab.h.  */
  #else
  #include <stab.h>  /* On BSD, use the system's stab.h.  */

When makeing the stage1 and stage2 compiler, I would hang when
compiling enquire.c. if a ctrl-D was sent from the terminal the
compile would stop with a core in ld. If collect2 was compiled with
cc then the install worked.
The follows is the output from running the installed gcc using a
collect2 compiled with gcc.
gcc -v enquire.c < /dev/null
*** config/mips.c	Sat Jul 18 16:40:46 1992
--- config/mips.c.orig	Sat Mar 21 17:33:19 1992
***************
*** 50,56 ****
  #define X_OK 1
  #endif
  
! #if defined (USG) || defined (NO_STAB_H)
  #include "gstab.h"  /* If doing DBX on sysV, use our own stab.h.  */
  #else
  #include <stab.h>  /* On BSD, use the system's stab.h.  */
--- 50,56 ----
  #define X_OK 1
  #endif
  
! #ifdef USG
  #include "gstab.h"  /* If doing DBX on sysV, use our own stab.h.  */
  #else
  #include <stab.h>  /* On BSD, use the system's stab.h.  */

When makeing the stage1 and stage2 compiler, I would hang when
compiling enquire.c. if a ctrl-D was sent from the terminal the
compile would stop with a core in ld. If collect2 was compiled with
cc then the install worked.
The follows is the output from running the installed gcc using a
collect2 compiled with gcc.
gcc -v enquire.c < /dev/null
Reading specs from /usr/gnu/lib/gcc-lib/mips-magnum-bsd43/2.1/specs
gcc version 2.1
 /usr/gnu/lib/gcc-lib/mips-magnum-bsd43/2.1/cpp -lang-c -v -undef -D__GNUC__=2 -Dmips -Dunix -Dhost_mips -DMIPSEB -DR3000 -DSYSTYPE_BSD43 -D__mips__ -D__unix__ -D__host_mips__ -D__MIPSEB__ -D__R3000__ -D__SYSTYPE_BSD43__ -D__mips -D__unix -D__host_mips -D__MIPSEB -D__R3000 -D__SYSTYPE_BSD43 -D__LANGUAGE_C -D_LANGUAGE_C -DLANGUAGE_C enquire.c /usr/tmp/cc009634.i
GNU CPP version 2.1 [AL 1.1, MM 14] RISC-OS BSD Mips
 /usr/gnu/lib/gcc-lib/mips-magnum-bsd43/2.1/cc1 /usr/tmp/cc009634.i -quiet -dumpbase enquire.c -version -o /usr/tmp/cc009634.s
GNU C version 2.1 [AL 1.1, MM 14] RISC-OS BSD Mips compiled by GNU C version 2.1.
 as -nocpp -EB -v -o enquire.o /usr/tmp/cc009634.s
/usr/lib/cmplrs/cc/as0 -v -G 8 -EB -g0 -O1 /usr/tmp/cc009634.s -o /usr/tmp/ctmaa09637 -t /usr/tmp/ctmsta09637 
as0: overflow setmode farewell croak xmalloc maximum_int main eek_a_bug describe i_define u_define f_define floor_log ceil_log exponent f_rep bitpattern endian missing fmissing false type_of ftype_of typerr ftyperr promotions check_defines cprop basic sprop usprop fStore fSum fDiff fMul fDiv fSelf fCheck fprop efprop iprop uiprop dStore dSum dDiff dMul dDiv dSelf dCheck dprop edprop lprop ulprop ldStore ldSum ldDiff ldMul ldDiv ldSelf ldCheck ldprop eldprop 
3.20u 0.18s 0:04.8 70%
/usr/lib/cmplrs/cc/as1 -v -G 8 -p0 -EB -g0 -O1 /usr/tmp/ctmaa09637 -o enquire.o -t /usr/tmp/ctmsta09637 
as1: overflow setmode farewell croak xmalloc maximum_int main eek_a_bug describe i_define u_define f_define floor_log ceil_log exponent f_rep bitpattern endian missing fmissing false type_of ftype_of typerr ftyperr promotions check_defines cprop basic sprop usprop fStore fSum fDiff fMul fDiv fSelf fCheck fprop efprop iprop uiprop dStore dSum dDiff dMul dDiv dSelf dCheck dprop edprop lprop ulprop ldStore ldSum ldDiff ldMul ldDiv ldSelf ldCheck ldprop eldprop 
2.95u 0.63s 0:06.5 55%
 /usr/gnu/lib/gcc-lib/mips-magnum-bsd43/2.1/mips-tfile -v -o enquire.o /usr/tmp/cc009634.s
mips-tfile version 2.1 [AL 1.1, MM 14] RISC-OS BSD Mips
 /usr/gnu/lib/gcc-lib/mips-magnum-bsd43/2.1/ld -EB -systype /bsd43/ /usr/lib/cmplrs/cc/crt1.o /usr/lib/cmplrs/cc/crtn.o -L/usr/gnu/lib/gcc-lib/mips-magnum-bsd43/2.1/ -L/usr/lib/cmplrs/cc/ -L/usr/lib/cmplrs/cc/ -L/usr/gnu/lib/ enquire.o -lgcc -lc -lgcc
gcc: Internal compiler error: program ld got fatal signal 11
running ld under dbx located the core at collect2.c line 1202 due to
ldptr.pchdr being null (I had to send ctrl-D or dbx hung ).

By using the ld produced by using cc, I have been sucessfully using
gcc on the mips under bsd43.

I have used gcc to compile X11R5 under each of the above
configurations.
I found the following bug while using gnugo.
When the following is compiled on the Mips and Decstation with
-O2 it cores on entering loop.
#include <stdio.h>


int uk = 0;

main()
  {
   int i;
   printf("10");
   printf("    %i \n",uk);
   for (i = 10; i < 15; i++)
     {
      printf("2");
      printf("\n");
     }
exit(0);
 }

The following bug was found compiling gnuplot3.0.
It happens on the dec,mips,sun, and ibm.
The compile reports Internal compiler error: program cc1 got fatal
signal 11 ( or 6 on IBM).

main()
{
double l10;
int z;

/* gcc compile error*/
	z = (l10 ) ? (int)l10 : ((int)l10 - 1);
	/* ok */
	z = (l10  ) ? (int)l10 : ((int)l10 - 1.0);
	z = (l10  ) ? l10 : ((int)l10 - 1);
	z = (l10  ) ? (int)l10 :(int) (l10 - 1);
	z = ((int)l10  ) ? (int)l10 : ((int)l10 - 1);
	z = (int)((l10  ) ? l10 : (l10 - 1));
}


This bug only exists on the ibm.
This is from the X11R5 distribution.
gcc -c x.c compiles OK
gcc -O -c x.c or
gcc -O2 -c x.c gives

x.c: In function `InteriorBundleLUT_inq_entry_address':
x.c:1552: internal error--insn does not satisfy its constraints:
(insn 638 433 435 (parallel[ 
           (set (reg:TI 31)
               (reg:TI 14))
           (clobber (scratch:SI))
       ] ) 188 {movti+1} (nil)
   (nil))
gcc: Internal compiler error: program cc1 got fatal signal 6

x.c is at the end of this mail
In compiling X11R5 under the ibm with gcc, two other items also
emerged.
There is no way to send ld it -b binder flags as gcc assumes that is a
cross-compilation and gcc compiled object can not be relinked using ld
as ld goes into a infinite loop, so parts of the server must be
compiled with cc instead of gcc. 
	
	Kent S. Gordon

/*renamed x.c*/
/*this is a preprocessed  mit/extensions/server/PEX/ddpex/mi/shared/miIntLUT.c
with line number command and blanks removed and some  functions removed*/
typedef unsigned long XID;
typedef XID Window;
typedef XID Drawable;
typedef XID Font;
typedef XID Pixmap;
typedef XID Cursor;
typedef XID Colormap;
typedef XID GContext;
typedef XID KeySym;
typedef unsigned long Mask;
typedef unsigned long Atom;
typedef unsigned long VisualID;
typedef unsigned long Time;
typedef unsigned char KeyCode;
typedef struct _Drawable *DrawablePtr;	
typedef struct _Pixmap *PixmapPtr;
typedef union _PixUnion {
    PixmapPtr		pixmap;
    unsigned long	pixel;
} PixUnion;
typedef struct _PixmapFormat *PixmapFormatPtr;
typedef struct _Visual *VisualPtr;
typedef struct _Depth  *DepthPtr;
typedef struct _Screen *ScreenPtr;
extern unsigned long globalSerialNumber;
extern unsigned long serverGeneration;
typedef long int ptrdiff_t;
typedef long unsigned int size_t;
typedef short unsigned int wchar_t;
typedef unsigned char *pointer;
typedef int Bool;
typedef unsigned long PIXEL;
typedef unsigned long ATOM;
typedef pointer	FID;
typedef struct _FontPathRec *FontPathPtr;
typedef struct _NewClientRec *NewClientPtr;
extern void	*memchr(const void *s, int c, size_t n);
extern void	*memcpy(void *s1, const void *s2, size_t n);
extern void	*memset(void *s, int c, size_t n);
extern size_t 	strcspn(const char *s1, const char *s2);
extern size_t	strlen(const char *s);
extern size_t	strspn(const char *s1, const char *s2);
extern void 	*memmove(void *s1, const void *s2, size_t n);
extern char 	*strcpy(char *s1, const char *s2);
extern char 	*strncpy(char *s1, const char *s2, size_t n);
extern char 	*strcat(char *s1, const char *s2);
extern char	*strncat(char *s1, const char *s2, size_t n);
extern int 	memcmp(const void *s1, const void *s2,size_t n);
extern int	strcmp(const char *s1, const char *s2);
extern int	strcoll(const char *s1, const char *s2);
extern int	strncmp(const char *s1,const char *s2,size_t n);
extern size_t 	strxfrm(char *s1, const char *s2, size_t n);
extern int	strncollen(const char *, const int );
extern char	*strchr(const char *s, int c);
extern char	*strpbrk(const char *s1, const char *s2);
extern char	*strrchr(const char *s, int c);
extern char	*strstr(const char *s1, const char *s2);
extern char 	*strtok(char *s1, const char *s2);
extern char 	*strerror(int errnum);
extern void	*memccpy(void *target, const void *source, int c, size_t n);
extern char     *index(const char *s, int c);
extern char     *rindex(const char *s, int c);
int		ReadRequestFromClient();
Bool		CloseDownConnection();
FontPathPtr	ExpandFontNamePattern();
FID		FiOpenForRead();
void		CreateWellKnownSockets();
int		SetDefaultFontPath();
void		FreeFontRecord();
int		SetFontPath();
void		ErrorF();
void		Error();
void		FatalError();
void		ProcessCommandLine();
void		Xfree();
void		FlushAllOutput();
void		FlushIfCriticalOutputPending();
unsigned long	*Xalloc();
unsigned long	*Xrealloc();
long		GetTimeInMillis();
extern void SwapLongs();
extern void SwapShorts();
typedef struct _DDXPoint *DDXPointPtr;
typedef struct _Box *BoxPtr;
extern unsigned long globalSerialNumber;
typedef struct _DDXPoint {
    short x, y;
} DDXPointRec;
typedef struct _Box {
    short x1, y1, x2, y2;
} BoxRec;
typedef union _DevUnion {
    pointer		ptr;
    long		val;
    unsigned long	uval;
} DevUnion;
typedef struct _Drawable {
    unsigned char	type;	 
    unsigned char	class;	 
    unsigned char	depth;
    unsigned char	bitsPerPixel;
    unsigned long	id;	 
    short		x;	 
    short		y;	 
    unsigned short	width;
    unsigned short	height;
    ScreenPtr		pScreen;
    unsigned long	serialNumber;
} DrawableRec;
typedef struct _Pixmap {
    DrawableRec		drawable;
    int			refcnt;
    int			devKind;
    DevUnion		devPrivate;
} PixmapRec;
typedef char    ddCHAR;
typedef short   ddSHORT;
typedef long    ddLONG;
typedef float   ddFLOAT;
typedef unsigned char   ddUCHAR;
typedef unsigned short  ddUSHORT;
typedef unsigned long   ddULONG;
typedef unsigned char    *ddPointer;
typedef unsigned char   ddBYTE;
typedef unsigned char   ddBOOL;
typedef struct {
	XID	id;
	ddPointer	deviceData;
} ddWKSResource;
typedef struct {
	XID	id;
	ddUSHORT	lutType;
	ddPointer	deviceData;
} ddLUTResource;
typedef ddWKSResource ddStructResource;
typedef ddWKSResource ddNSResource;
typedef ddWKSResource ddFontResource;
typedef ddWKSResource ddPMResource;
typedef ddWKSResource		*diWKSHandle;
typedef ddLUTResource		*diLUTHandle;
typedef ddStructResource	*diStructHandle;
typedef ddNSResource		*diNSHandle;
typedef ddFontResource		*diFontHandle;
typedef ddPMResource		*diPMHandle;
typedef ddPointer		diResourceHandle;
typedef ddULONG		ddBitmask;
typedef	ddUSHORT	ddBitmaskShort;
typedef	ddSHORT		ddEnumTypeIndex;
typedef	XID		ddResourceId;
typedef	ddBYTE		ddSwitch;
typedef	ddUSHORT	ddTableIndex;
typedef struct {
    ddFLOAT	x;
    ddFLOAT	y;
} ddVector2D;
typedef struct {
    ddFLOAT	x;
    ddFLOAT	y;
    ddFLOAT	z;
} ddVector3D;
typedef struct {
    ddFLOAT	x;
    ddFLOAT	y;
} ddCoord2D;
typedef struct {
    ddLONG	x;
    ddLONG	y;
} ddCoord2DL;
typedef struct {
    ddSHORT	x;
    ddSHORT	y;
} ddCoord2DS;
typedef struct {
    ddFLOAT	x;
    ddFLOAT	y;
    ddFLOAT	z;
} ddCoord3D;
typedef struct {
    ddLONG	x;
    ddLONG	y;
    ddLONG	z;
} ddCoord3DL;
typedef struct {
    ddSHORT	x;
    ddSHORT	y;
    ddSHORT	z;
} ddCoord3DS;
typedef struct {
    ddFLOAT	x;
    ddFLOAT	y;
    ddFLOAT	z;
    ddFLOAT	w;
} ddCoord4D;
typedef struct {
	ddSHORT		x;
	ddSHORT 	y;
	ddFLOAT 	z;
} ddDeviceCoord;
typedef struct {
	ddSHORT		xmin;
	ddSHORT		xmax;
	ddSHORT		ymin;
	ddSHORT		ymax;
} ddDeviceRect;
typedef struct {
        ddFLOAT         xmin;
        ddFLOAT         ymin;
        ddFLOAT         zmin;
        ddFLOAT         wmin;
        ddFLOAT         xmax;
        ddFLOAT         ymax;
        ddFLOAT         zmax;
        ddFLOAT         wmax;
} ddListBounds;
typedef struct {
    ddSHORT		approxMethod;
    ddUSHORT		unused;
    ddFLOAT		tolerance;
} ddCurveApprox;
typedef struct {
    ddSHORT		approxMethod;
    ddUSHORT		unused;
    ddFLOAT		uTolerance;
    ddFLOAT		vTolerance;
} ddSurfaceApprox;
typedef struct {
    ddUSHORT		vertical;
    ddUSHORT		horizontal;
} ddTextAlignmentData;
typedef struct {
    ddDeviceCoord	minval;
    ddDeviceCoord	maxval;
    ddUCHAR		useDrawable;
    ddBYTE		pad[3];
} ddViewport;
typedef struct {
    ddCoord3D	minval;
    ddCoord3D	maxval;
} ddNpcSubvolume;
typedef struct {
	ddUSHORT	clipFlags;
	ddUSHORT	unused;
	ddNpcSubvolume	clipLimits;
	ddFLOAT		orientation[4][4];
	ddFLOAT		mapping[4][4];
} ddViewEntry;
typedef struct {
	ddUSHORT	definableEntries;
	ddUSHORT	numPredefined;
	ddUSHORT	predefinedMin;
	ddUSHORT	predefinedMax;
} ddTableInfo;
typedef struct {
        diStructHandle    structure;	 
        ddULONG         offset;		 
} ddElementRef;
typedef struct {
        ddCoord4D       orig_point;	 
        ddCoord4D       point;
        ddVector3D      orig_vector;	 	
        ddVector3D      vector;		 
	ddFLOAT		dist;		 
} ddHalfSpace; 				
typedef struct {
        diStructHandle    structure;	 
        ddULONG         offset;		 
        ddULONG         pickid;
} ddPickPath;
typedef struct {
	ddUSHORT	elementType;
	ddUSHORT	length;
} ddElementInfo;
typedef struct {
    ddFLOAT	red;
    ddFLOAT	green;
    ddFLOAT	blue;
} ddRgbFloatColour;
typedef struct {
    ddFLOAT	hue;
    ddFLOAT	saturation;
    ddFLOAT	value;
} ddHsvColour;
typedef struct {
    ddFLOAT	hue;
    ddFLOAT	lightness;
    ddFLOAT	saturation;
} ddHlsColour;
typedef struct {
    ddFLOAT	x;
    ddFLOAT	y;
    ddFLOAT	z;
} ddCieColour;
typedef struct {
    ddUCHAR	red;
    ddUCHAR	green;
    ddUCHAR	blue;
    ddUCHAR	pad;
} ddRgb8Colour;
typedef struct {
    ddUSHORT	red;
    ddUSHORT	green;
    ddUSHORT	blue;
    ddUSHORT	pad;
} ddRgb16Colour;
typedef struct {
    ddUSHORT		index;
    ddUSHORT		pad;
} ddIndexedColour;
typedef struct {
    ddSHORT       colourType;
    ddSHORT       unused;
    union {
	ddIndexedColour        indexed;
	ddRgb8Colour           rgb8;
	ddRgb16Colour          rgb16;
	ddRgbFloatColour           rgbFloat;
	ddCieColour            cieFloat;
	ddHlsColour            hlsFloat;
	ddHsvColour            hsvFloat;
    }  colour;
} ddColourSpecifier;
typedef union {
	ddRgb8Colour           rgb8;
	ddRgb16Colour          rgb16;
	ddRgbFloatColour           rgbFloat;
	ddCieColour            cieFloat;
	ddHlsColour            hlsFloat;
	ddHsvColour            hsvFloat;
}  ddDirectColour;
typedef struct {
    ddFLOAT		ambient;
    ddFLOAT		diffuse;
    ddFLOAT		specular;
    ddFLOAT		specularConc;
    ddFLOAT		transmission;   
    ddColourSpecifier  specularColour;	    
} ddReflectionAttr;
typedef int ddpex4rtn;
typedef int ddpex43rtn;
typedef int ddpex3rtn;
typedef int ddpex2rtn;
typedef int ddpex1rtn;
typedef struct {
    ddULONG	bufSize;	 
    ddULONG	dataSize;	 
    ddPointer   pBuf;		 
    ddPointer   pHead;		 
} ddBuffer, *ddBufferPtr;
typedef enum {
        DD_ELEMENT_REF=0,
        DD_HALF_SPACE=1,
        DD_PICK_PATH=2,
        DD_RENDERER=3,
        DD_WKS=4,
        DD_NS=5,
	DD_STRUCT=6,
        DD_DEVICE_RECT=7,
	DD_NAME=8,
	DD_INDEX=9,
        DD_NUM_TYPES=10
} ddListType;
typedef struct {
        ddListType      type;
        ddLONG     numObj;
        ddLONG     misc;
        ddLONG     maxObj;
        ddPointer  pList;
} listofObj;
typedef	struct {
	ddUSHORT	placementType;
	ddUSHORT	numUcurves;
	ddUSHORT	numVcurves;
} ddPSC_IsoparametricCurves;
typedef	struct {
	ddCoord3D	origin;
	ddVector3D	direction;
	ddUSHORT	numberIntersections;
	ddCoord3D	*pPoints;
} ddPSC_LevelCurves;
typedef struct {
	ddEnumTypeIndex		type;
	union {
		char				none;
		char				impDep;
		ddPSC_IsoparametricCurves	isoCurves;	
		ddPSC_LevelCurves		mcLevelCurves;	
		ddPSC_LevelCurves		wcLevelCurves;
	} data;
} ddPSurfaceChars;
typedef struct {
	ddEnumTypeIndex		markerType;
	ddFLOAT			markerScale;
	ddColourSpecifier	markerColour;
	ddUSHORT		markerIndex;
	ddUSHORT		textFont;
	ddUSHORT		textPrecision;
	ddFLOAT			charExpansion;
	ddFLOAT			charSpacing;
	ddColourSpecifier	textColour;
	ddFLOAT			charHeight;
	ddVector2D		charUp;
	ddUSHORT		textPath;
	ddTextAlignmentData	textAlignment;
	ddFLOAT			atextHeight;
	ddVector2D		atextUp;
	ddUSHORT		atextPath;
	ddTextAlignmentData	atextAlignment;
	ddEnumTypeIndex		atextStyle;
	ddUSHORT		textIndex;
	ddEnumTypeIndex		lineType;
	ddFLOAT			lineWidth;
	ddColourSpecifier	lineColour;
	ddCurveApprox		curveApprox;
	ddEnumTypeIndex		lineInterp;
	ddUSHORT		lineIndex;
	ddEnumTypeIndex		intStyle;
	ddSHORT			intStyleIndex;
	ddColourSpecifier	surfaceColour;
	ddReflectionAttr	reflAttr;
	ddEnumTypeIndex		reflModel;
	ddEnumTypeIndex		surfInterp;
	ddEnumTypeIndex		bfIntStyle;
	ddSHORT			bfIntStyleIndex;
	ddColourSpecifier	bfSurfColour;
	ddReflectionAttr	bfReflAttr;
	ddEnumTypeIndex		bfReflModel;
	ddEnumTypeIndex		bfSurfInterp;
	ddSurfaceApprox		surfApprox;
	ddUSHORT		cullMode;
	ddBOOL			distFlag;
	ddCoord2D		patternSize;
	ddCoord3D		patternRefPt;
	ddVector3D		patternRefV1;
	ddVector3D		patternRefV2;
	ddUSHORT		intIndex;
	ddUSHORT		edges;
	ddEnumTypeIndex		edgeType;
	ddFLOAT			edgeWidth;
	ddColourSpecifier	edgeColour;
	ddUSHORT		edgeIndex;
	ddFLOAT			localMat[4][4];
	ddFLOAT			globalMat[4][4];
	ddUSHORT		modelClip;
	listofObj		*modelClipVolume;
	ddUSHORT		viewIndex;
	listofObj		*lightState;
	ddUSHORT		depthCueIndex;
	ddUSHORT		colourApproxIndex;
	ddSHORT			rdrColourModel;
	ddPSurfaceChars		psc;
	ddULONG			asfs;
	ddULONG			pickId;
	ddULONG			hlhsrType;
	diNSHandle		pCurrentNS;	 
} ddPCAttr;
typedef struct {
	ddULONG			PCid;
	listofObj		*rendRefs;
	ddPCAttr		*pPCAttr;
} ddPCStr, *ddPCPtr;
typedef	ddpex2rtn	(*ocTableType)();
typedef struct {
	ddBYTE		type;	 
	ddBYTE		class;	
	ddBYTE		depth;	
	ddBYTE		bitsPerPixel;	
	ddBYTE		rootDepth;
	ddULONG		rootVisual;
} ddDrawableInfo;
typedef enum {
	DD_HIGH_INCL_NS=0,
	DD_HIGH_EXCL_NS=1,
	DD_INVIS_INCL_NS=2,
	DD_INVIS_EXCL_NS=3,
	DD_MAX_FILTERS=4
} ddNSFilters; 
typedef struct {
	ddULONG 		rendId;		 
	ddPCPtr			pPC;		 
	ddDrawableInfo		drawExample;	 
	DrawablePtr		pDrawable;	 
	ddULONG			drawableId;	 
	listofObj		*curPath;	 
	ddUSHORT		state;		 
	diLUTHandle		lut[	12 +1]; 
	diNSHandle		ns[DD_MAX_FILTERS]; 
	ddSHORT			hlhsrMode;	 
	ddNpcSubvolume		npcSubvolume;
	ddViewport		viewport;
	listofObj		*clipList;	  
	ddBitmask		tablesMask;	 
	ddBitmask		namesetsMask;	 
	ddBitmask		attrsMask;	 
	ddBitmask		tablesChanges;	 
	ddBitmask		namesetsChanges; 
	ddBitmask		attrsChanges;	 
	ocTableType		executeOCs[		103 +1 ];	
	ddBOOL			immediateMode;
	ddUSHORT		render_mode;
	ddPointer		pDDContext;	 
} ddRendererStr, *ddRendererPtr;
typedef enum { 
	WORKSTATION_RESOURCE=0,
	STRUCTURE_RESOURCE=1,
	PARENT_STRUCTURE_RESOURCE=2,
	CHILD_STRUCTURE_RESOURCE=3,
	SEARCH_CONTEXT_RESOURCE=4,
	PICK_RESOURCE=5,
	LOOKUP_TABLE_RESOURCE=6,
	NAME_SET_RESOURCE=7,
	FONT_RESOURCE=8,
	RENDERER_RESOURCE=9,
	PIPELINE_CONTEXT_RESOURCE=10
} ddResourceType;
typedef enum {
	ADD=0,
	REMOVE=1
} ddAction;
typedef enum {
	X_WINDOW_RESOURCE=0,
	X_DRAWABLE_RESOURCE=1,
	X_FONT_RESOURCE=2,
	X_PIXMAP_RESOURCE=3,
	X_CURSOR_RESOURCE=4,
	X_COLORMAP_RESOURCE=5,
	X_GCONTEXT_RESOURCE=6,
	X_KEYSYM=7
} ddXResourceType;
typedef struct _Region *RegionPtr;
typedef struct _GCInterest *GCInterestPtr;
typedef struct _GC    *GCPtr;
extern void  ValidateGC();
extern int ChangeGC();
extern GCPtr CreateGC();
extern int CopyGC();
extern int FreeGC();
extern void SetGCMask();
extern GCPtr GetScratchGC();
extern void  FreeScratchGC();
typedef unsigned long	Pixel;
typedef struct _CMEntry *EntryPtr;
typedef struct _ColormapRec *ColormapPtr;
extern int CreateColormap();
extern int FindColor();
extern int FreeColormap();
extern int TellLostMap();
extern int TellGainedMap();
extern int IsMapInstalled();
extern void UninstallColormap();
typedef struct _PixmapFormat {
    unsigned char	depth;
    unsigned char	bitsPerPixel;
    unsigned char	scanlinePad;
    } PixmapFormatRec;
typedef struct _Visual {
    unsigned long	vid;
    short		class;
    short		bitsPerRGBValue;
    short		ColormapEntries;
    short		nplanes; 
    unsigned long	redMask, greenMask, blueMask;
    int			offsetRed, offsetGreen, offsetBlue;
  } VisualRec;
typedef struct _Depth {
    unsigned char	depth;
    short		numVids;
    unsigned long	*vids;     
  } DepthRec;
typedef struct _Screen {
    int			myNum;	 
    ATOM		id;
    short		width, height;
    short		mmWidth, mmHeight;
    short		numDepths;
    unsigned char      	rootDepth;
    DepthPtr       	allowedDepths;
    unsigned long      	rootVisual;
    unsigned long	defColormap;
    short		minInstalledCmaps, maxInstalledCmaps;
    char                backingStoreSupport, saveUnderSupport;
    unsigned long	whitePixel, blackPixel;
    unsigned long	rgf;	 
    GCPtr		GCperDepth[8 +1];
    PixmapPtr		PixmapPerDepth[1];
    pointer		devPrivate;
    short       	numVisuals;
    VisualPtr		visuals;
    int			WindowPrivateLen;
    unsigned		*WindowPrivateSizes;
    unsigned		totalWindowSize;
    int			GCPrivateLen;
    unsigned		*GCPrivateSizes;
    unsigned		totalGCSize;
    Bool (* CloseScreen)();		 
    void (* QueryBestSize)();		 
    Bool (* SaveScreen)();		 
    void (* GetImage)();		 
    void (* GetSpans)();		 
    void (* PointerNonInterestBox)();	 
    void (* SourceValidate)();		 
    Bool (* CreateWindow)();		 
    Bool (* DestroyWindow)();		 
    Bool (* PositionWindow)();		 
    Bool (* ChangeWindowAttributes)();	 
    Bool (* RealizeWindow)();		 
    Bool (* UnrealizeWindow)();		 
    int  (* ValidateTree)();		 
    void (* PostValidateTree)();	 
    void (* WindowExposures)();        
    void (* PaintWindowBackground)();	 
    void (* PaintWindowBorder)();	 
    void (* CopyWindow)();		 
    void (* ClearToBackground)();	 
    void (* ClipNotify)();               
    PixmapPtr (* CreatePixmap)(); 	 
    Bool (* DestroyPixmap)();		 
    void (* SaveDoomedAreas)();		 
    RegionPtr (* RestoreAreas)();	 
    void (* ExposeCopy)();		 
    RegionPtr (* TranslateBackingStore)(); 
    RegionPtr (* ClearBackingStore)();	 
    void (* DrawGuarantee)();		 
    Bool (* RealizeFont)();		 
    Bool (* UnrealizeFont)();		 
    void (* ConstrainCursor)();   	 
    void (* CursorLimits)();		 
    Bool (* DisplayCursor)();		 
    Bool (* RealizeCursor)();		 
    Bool (* UnrealizeCursor)();		 
    void (* RecolorCursor)();		 
    Bool (* SetCursorPosition)();	 
    Bool (* CreateGC)();		 
    Bool (* CreateColormap)();		 
    void (* DestroyColormap)();		 
    void (* InstallColormap)();		 
    void (* UninstallColormap)();	 
    int (* ListInstalledColormaps) (); 	 
    void (* StoreColors)();		 
    void (* ResolveColor)();		 
    RegionPtr (* RegionCreate)(); 	 
    void (* RegionInit)();		 
    Bool (* RegionCopy)();		 
    void (* RegionDestroy)();		 
    void (* RegionUninit)();		 
    Bool (* Intersect)();		 
    Bool (* Union)();			 
    Bool (* Subtract)();		 
    Bool (* Inverse)();			 
    void (* RegionReset)();		 
    void (* TranslateRegion)();		 
    int (* RectIn)();			 
    Bool (* PointInRegion)();		 
    Bool (* RegionNotEmpty)();      	 
    void (* RegionEmpty)();        	 
    BoxPtr (* RegionExtents)(); 	 
    Bool (* RegionAppend)();		 
    Bool (* RegionValidate)();		 
    RegionPtr (* BitmapToRegion)();	 
    RegionPtr (* RectsToRegion)();	 
    void (* SendGraphicsExpose)();	 
    void (* BlockHandler)();		 
    void (* WakeupHandler)();		 
    pointer blockData;
    pointer wakeupData;
    DevUnion	*devPrivates;
} ScreenRec;
typedef struct _ScreenInfo {
    int		imageByteOrder;
    int		bitmapScanlineUnit;
    int		bitmapScanlinePad;
    int		bitmapBitOrder;
    int		numPixmapFormats;
    PixmapFormatRec
		formats[8 ];
    int		arraySize;
    int		numScreens;
    ScreenPtr	screens[3 ];
} ScreenInfo;
extern ScreenInfo screenInfo;
extern int AllocateWindowPrivateIndex(), AllocateGCPrivateIndex();
extern Bool AllocateWindowPrivate(), AllocateGCPrivate();
typedef void	(*destroyTableType)();
extern int PexErrorBase;
typedef struct {
	ddEnumTypeIndex index;
	char            *name;
} miEnumType;
typedef enum {
	VIEW_REP_DYNAMIC=0,
	MARKER_BUNDLE_DYNAMIC=1,
	TEXT_BUNDLE_DYNAMIC=2,
	LINE_BUNDLE_DYNAMIC=3,
	INTERIOR_BUNDLE_DYNAMIC=4,
	EDGE_BUNDLE_DYNAMIC=5,
	COLOUR_TABLE_DYNAMIC=6,
	PATTERN_TABLE_DYNAMIC=7,
	WKS_TRANSFORM_DYNAMIC=8,
	HIGH_FILTER_DYNAMIC=9,
	INVIS_FILTER_DYNAMIC=10,
	HLHSR_MODE_DYNAMIC=11,
	STR_MODIFY_DYNAMIC=12,
	POST_STR_DYNAMIC=13,
	UNPOST_STR_DYNAMIC=14,
	DELETE_STR_DYNAMIC=15,
	REF_MODIFY_DYNAMIC=16,
	BUFFER_MODIFY_DYNAMIC=17,
	LIGHT_TABLE_DYNAMIC=18,
	DEPTH_CUE_DYNAMIC=19,
	COLOUR_APPROX_TABLE_DYNAMIC=20,
	MAX_DYNAMIC = 21
} ddDynamic;
typedef struct {
    ddEnumTypeIndex	lineType;
    ddEnumTypeIndex	polylineInterp;
    ddCurveApprox	curveApprox;
    ddFLOAT		lineWidth;	 
    ddColourSpecifier	lineColour;	    
} ddLineBundleEntry;
typedef struct {
    ddEnumTypeIndex	markerType;
    ddSHORT		unused;
    ddFLOAT		markerScale;	 
    ddColourSpecifier	markerColour;	    
} ddMarkerBundleEntry;
typedef struct {
    ddUSHORT		textFontIndex;
    ddUSHORT		textPrecision;
    ddFLOAT		charExpansion;
    ddFLOAT		charSpacing;
    ddColourSpecifier	textColour;	    
} ddTextBundleEntry;
typedef struct {
    ddEnumTypeIndex    interiorStyle;
    ddSHORT	    interiorStyleIndex;
    ddEnumTypeIndex    reflectionModel;
    ddEnumTypeIndex    surfaceInterp;
    ddEnumTypeIndex    bfInteriorStyle;
    ddSHORT	    bfInteriorStyleIndex;
    ddEnumTypeIndex    bfReflectionModel;
    ddEnumTypeIndex    bfSurfaceInterp;
    ddSurfaceApprox	surfaceApprox;
    ddColourSpecifier	surfaceColour; 
    ddReflectionAttr	reflectionAttr; 
    ddColourSpecifier	bfSurfaceColour;
    ddReflectionAttr	bfReflectionAttr;
} ddInteriorBundleEntry;
typedef struct {
    ddSwitch		edges;
    ddUCHAR		unused;
    ddEnumTypeIndex	edgeType;
    ddFLOAT		edgeWidth;	 
    ddColourSpecifier	edgeColour;	    
} ddEdgeBundleEntry;
typedef struct {
    ddSHORT		colourType; 
    ddUSHORT		numx;
    ddUSHORT		numy;
    ddUSHORT		unused;
    union {
	ddIndexedColour	*indexed;
	ddRgb8Colour	*rgb8;
	ddRgb16Colour	*rgb16;
	ddRgbFloatColour	*rgbFloat;
	ddHsvColour	*hsvFloat;
	ddHlsColour	*hlsFloat;
	ddCieColour	*cieFloat;
   }			colours;
} ddPatternEntry;
typedef struct {
    ddULONG		numFonts;
    diFontHandle        fonts[   16 ];     
} ddTextFontEntry;
typedef struct {
    ddEnumTypeIndex	lightType;
    ddSHORT		unused;
    ddVector3D		direction;
    ddCoord3D		point;
    ddFLOAT		concentration;
    ddFLOAT		spreadAngle;
    ddFLOAT		attenuation1;
    ddFLOAT		attenuation2;
    ddColourSpecifier	lightColour;	    
} ddLightEntry;
typedef struct {
    ddUCHAR		mode;
    ddUCHAR		unused;
    ddUSHORT		unused2;
    ddFLOAT		frontPlane;
    ddFLOAT		backPlane;
    ddFLOAT		frontScaling;
    ddFLOAT		backScaling;
    ddColourSpecifier	depthCueColour;	    
} ddDepthCueEntry;
typedef struct {
    ddEnumTypeIndex	approxType;
    ddEnumTypeIndex	approxModel;
    ddUSHORT	max1;
    ddUSHORT	max2;
    ddUSHORT	max3;
    ddUCHAR	dither;
    ddUCHAR	unused;
    ddULONG	mult1;
    ddULONG	mult2;
    ddULONG	mult3;
    ddFLOAT	weight1;
    ddFLOAT	weight2;
    ddFLOAT	weight3;
    ddULONG	basePixel;
} ddColourApproxEntry;
typedef struct {
        ddUSHORT                status;
	ddTableIndex            index;
} miTableEntry;
typedef struct _miLineBundleEntry {
	miTableEntry		entry_info;
	ddLineBundleEntry	entry;		 
	ddLineBundleEntry	real_entry;	 
} miLineBundleEntry;
typedef struct _miMarkerBundleEntry {
	miTableEntry		entry_info;
	ddMarkerBundleEntry	entry;		 
	ddMarkerBundleEntry	real_entry;	 
} miMarkerBundleEntry;
typedef struct _miTextBundleEntry {
	miTableEntry		entry_info;
	ddTextBundleEntry	entry;		 
	ddTextBundleEntry	real_entry;	 
} miTextBundleEntry;
typedef struct _miInteriorBundleEntry {
	miTableEntry		entry_info;
	ddInteriorBundleEntry	entry;		 
	ddInteriorBundleEntry	real_entry;	 
} miInteriorBundleEntry;
typedef struct _miEdgeBundleEntry {
	miTableEntry		entry_info;
	ddEdgeBundleEntry	entry;		 
	ddEdgeBundleEntry	real_entry;	 
} miEdgeBundleEntry;
typedef struct _miPatternEntry {
	miTableEntry		entry_info;
	ddPatternEntry		entry;		 
} miPatternEntry;
typedef struct _miTextFontEntry {
	miTableEntry		entry_info;
	ddTextFontEntry		entry;		 
} miTextFontEntry;
typedef struct _miColourEntry {
	miTableEntry		entry_info;
	ddColourSpecifier	entry;		 
} miColourEntry;
typedef struct _miViewEntry {
	miTableEntry		entry_info;
	ddViewEntry		entry;		 
	ddFLOAT			vom[4][4];	 
	ddFLOAT			vom_inv[4][4];	 
	ddBOOL			inv_flag;	 
} miViewEntry;
typedef struct _miLightEntry {
	miTableEntry		entry_info;
	ddLightEntry		entry;		 
    	double			cosSpreadAngle;	 
} miLightEntry;
typedef struct _miDepthCueEntry {
	miTableEntry		entry_info;
	ddDepthCueEntry		entry;		 
} miDepthCueEntry;
typedef struct _miColourApproxEntry {
	miTableEntry		entry_info;
	ddColourApproxEntry	entry;		 
} miColourApproxEntry;
typedef	ddpex43rtn		(*miOpsTableType)();
typedef struct _miLUTHeader {
	ddDrawableInfo		drawExample;
	ddSHORT			drawType;
	ddUSHORT		startIndex;
	ddUSHORT		defaultIndex;
	ddUSHORT		numDefined;
	ddTableInfo		tableInfo;
	listofObj		*wksRefList;
	listofObj		*rendRefList;
	ddBOOL			freeFlag;
	union {		
		miLineBundleEntry	*line;
		miMarkerBundleEntry	*marker;
		miTextBundleEntry	*text;
		miInteriorBundleEntry	*interior;
		miEdgeBundleEntry	*edge;
		miPatternEntry		*pattern;
		miTextFontEntry		*font;
		miColourEntry		*colour;
		miViewEntry		*view;
		miLightEntry		*light;
		miDepthCueEntry		*depthCue;
		miColourApproxEntry 	*colourApprox;
	 } plut;
	miOpsTableType		ops[(	13   - 	 4   + 1 + 6 ) ];
} miLUTHeader;
typedef struct {
	DrawablePtr     pDrawable;
	Drawable		drawableId;
	diLUTHandle     pMarkerLUT;         
	diLUTHandle     pTextLUT;
	diLUTHandle     pLineLUT;
	diLUTHandle     pIntLUT;
	diLUTHandle     pEdgeLUT;
	diLUTHandle     pColourLUT;
	diLUTHandle     pDepthCueLUT;
	diLUTHandle     pLightLUT;
	diLUTHandle     pColourAppLUT;
	diLUTHandle     pPatternLUT;
	diLUTHandle     pFontLUT;
	diNSHandle      pHighInclSet;
	diNSHandle      pHighExclSet;
	diNSHandle      pInvisInclSet;
	diNSHandle      pInvisExclSet;
	ddEnumTypeIndex	bufferMode;
} ddWksInit;
typedef struct {
	ddBYTE	viewRep;
	ddBYTE	markerBundle;
	ddBYTE	textBundle;
	ddBYTE	lineBundle;
	ddBYTE	interiorBundle;
	ddBYTE	edgeBundle;
	ddBYTE	colourTable;
	ddBYTE	patternTable;
	ddBYTE	wksTransform;
	ddBYTE	highlightFilter;
	ddBYTE	invisFilter;
	ddBYTE	hlhsrMode;
	ddBYTE	strModify;
	ddBYTE	postStr;
	ddBYTE	unpostStr;
	ddBYTE	deleteStr;
	ddBYTE	refModify;
	ddBYTE	bufferModify;
	ddBYTE	lightTable;
	ddBYTE	depthCueTable;
	ddBYTE	colourApproxTable;
} ddWksDynamics;
typedef struct {
	diNSHandle	incl;
	diNSHandle	excl;
} ddNSPair;
typedef struct {
	ddULONG		numPairs;
	ddULONG		maxPairs;
	ddNSPair 	*pPairs;
} listofNSPair;
typedef struct {
	ddULONG		    id;
	ddUSHORT            status;
	ddCoord3D	    position;		 
	ddFLOAT		    distance;		 	
	ddUSHORT	    ceiling;		 
	ddBOOL		    modelClipFlag;	 
	listofObj	    *startPath;		 
	listofNSPair	    normal;
	listofNSPair	    inverted;
} ddSCStr;
typedef struct {
	ddTableIndex	index;
	ddUSHORT	unused;
	ddViewEntry	view;
} ddViewRep;
typedef struct {
	ddUSHORT	whence;
	ddUSHORT	unused;
	ddLONG		offset;
} ddElementPos;
typedef struct {
	ddElementPos	position1;
	ddElementPos	position2;
} ddElementRange;
typedef struct {
        ddSHORT		x;
        ddSHORT		y;
} ddDeviceCoord2D;
typedef struct {
	ddDeviceCoord2D	position;
	ddFLOAT         distance;
} ddPC_DC_HitBox;
typedef  ddNpcSubvolume ddPC_NPC_HitVolume;
typedef ddULONG	ddNamePiece;
typedef ddNamePiece	*ddNamePtr;
typedef struct _miNSHeader {
	listofObj		*wksRefList;
	listofObj		*rendRefList;
	ddULONG			refCount;	 
	ddULONG			nameCount;
	ddNamePiece		names[ ((255  - 0  +1)  / (sizeof(ddNamePiece) * 8) )  ];
	ddBOOL			freeFlag; 
} miNSHeader;
typedef struct {
    ddEnumTypeIndex	    type;	 
    ddUSHORT                status;	 
    listofObj  		    *path;	 
    ddUSHORT                pathOrder;
    diNSHandle              inclusion;
    diNSHandle              exclusion;
    union {
    	char    dc_data_rec;	  
    	char    npc_data_rec; 	 
    }	data_rec;	 
    ddEnumTypeIndex         pet;
    ddViewport              echoVolume;
    ddUSHORT                echoSwitch;
    ddPointer		    devPriv;
} miPickDevice;
typedef struct {
	diWKSHandle	    pWks;	
	ddEnumTypeIndex	    type;	 
	ddUSHORT	    status;	 
	listofObj	   *path;	 
	ddUSHORT            pathOrder;
    diNSHandle              incl_handle;
    diNSHandle              excl_handle;
	union {
		char    dc_data_rec; 
		char    npc_data_rec; 
	}	data_rec;
	union {
		ddPC_DC_HitBox		dc_hit_box;
		ddPC_NPC_HitVolume	npc_hit_volume;
	} input_rec;
    ddPointer		    devPriv;
} miPickMeasureStr;
typedef struct _ddOrdStruct {
	diStructHandle	pstruct;
	ddFLOAT	priority;
	struct _ddOrdStruct	*next;
} ddOrdStruct;
typedef struct {
	ddULONG		numStructs;
	ddOrdStruct	*postruct;	 
} listofOrdStruct;
typedef struct _ddOrdView {
	short		defined;
	ddUSHORT	first_view;	 
	ddUSHORT	last_view;	 
	struct _ddOrdView *higher;	 
	struct _ddOrdView *lower;	 
} ddOrdView;
typedef struct {
	ddULONG		defined_views;	 
	ddOrdView	*highest;	 
	ddOrdView	*lowest;	 
	ddOrdView	*free;		 
	ddOrdView	entries[( 6	 * 2 + 3) ];
} listofOrdView;
typedef struct _miWks {
	ddEnumTypeIndex		displayUpdate;
	ddBYTE			visualState;
	ddBYTE			displaySurface;
	ddBYTE			viewUpdate;
	listofOrdView	views;
	diLUTHandle		reqViewTable;
	ddULONG			deltaviewMask;
	ddBYTE			wksUpdate;
	ddBYTE			wksMask;
	ddNpcSubvolume		reqNpcSubvolume;
	ddViewport		reqviewport;
	ddBYTE			hlhsrUpdate;
	ddEnumTypeIndex		reqhlhsrMode;
	ddRendererPtr		pRend;
	ddBYTE			bufferUpdate;
	ddUSHORT	    	curBufferMode;
	ddUSHORT	    	reqBufferMode;
	listofOrdStruct		postedStructs;
	ddBYTE			dynamics[MAX_DYNAMIC];
	ddBOOL			freeFlag;
	ddLONG			refCount;
	miPickDevice		devices[2  ];
	listofObj		*pwksList;
} miWksStr, *miWksPtr;
typedef int ErrorCode;
typedef long           INT32;
typedef short          INT16;
typedef signed char    INT8;
typedef unsigned long CARD32;
typedef unsigned short CARD16;
typedef unsigned char  CARD8;
typedef unsigned long		BITS32;
typedef unsigned short		BITS16;
typedef unsigned char		BYTE;
typedef unsigned char            BOOL;
typedef float PEXFLOAT;
typedef CARD32  pexAsfAttribute;
typedef CARD8	pexAsfValue;
typedef CARD32	pexBitmask;
typedef CARD16	pexBitmaskShort;
typedef CARD16  pexCoordType; 	 
typedef CARD16	pexComposition;
typedef CARD16	pexCullMode;
typedef BYTE 	pexDynamicType;
typedef INT16	pexEnumTypeIndex;
typedef XID 	pexLookupTable;
typedef CARD32 	pexName;
typedef XID 	pexNameSet;
typedef XID	pexPC;
typedef XID	pexFont;
typedef PEXFLOAT	pexMatrix[4][4];
typedef PEXFLOAT 	pexMatrix3X3[3][3];
typedef XID	pexPhigsWks;
typedef XID	pexPickMeasure;
typedef XID	pexRenderer;
typedef XID	pexSC;
typedef XID	pexStructure;
typedef CARD8	pexSwitch;
typedef CARD16	pexTableIndex;
typedef CARD16	pexTableType;	 
typedef CARD16	pexTextHAlignment;
typedef CARD16	pexTextVAlignment;
typedef CARD16	pexTypeOrTableIndex;
typedef pexEnumTypeIndex	pexColourType; 	 
typedef struct {
    CARD16	length  ;
} pexString;
typedef struct {
    pexStructure	sid  ;
    PEXFLOAT		priority;
} pexStructureInfo;
typedef struct {
    PEXFLOAT	x;
    PEXFLOAT	y;
} pexVector2D;
typedef struct {
    PEXFLOAT	x;
    PEXFLOAT	y;
    PEXFLOAT	z;
} pexVector3D;
typedef struct {
    PEXFLOAT	x;
    PEXFLOAT	y;
} pexCoord2D;
typedef struct {
    PEXFLOAT	x;
    PEXFLOAT	y;
    PEXFLOAT	z;
} pexCoord3D;
typedef struct {
    PEXFLOAT	x;
    PEXFLOAT	y;
    PEXFLOAT	z;
    PEXFLOAT	w;
} pexCoord4D;
typedef struct {
    PEXFLOAT	red;
    PEXFLOAT	green;
    PEXFLOAT	blue;
} pexRgbFloatColour;
typedef struct {
    PEXFLOAT	hue;
    PEXFLOAT	saturation;
    PEXFLOAT	value;
} pexHsvColour;
typedef struct {
    PEXFLOAT	hue;
    PEXFLOAT	lightness;
    PEXFLOAT	saturation;
} pexHlsColour;
typedef struct {
    PEXFLOAT	x;
    PEXFLOAT	y;
    PEXFLOAT	z;
} pexCieColour;
typedef struct {
    CARD8	red;
    CARD8	green;
    CARD8	blue;
    CARD8	pad;
} pexRgb8Colour;
typedef struct {
    CARD16	red  ;
    CARD16	green  ;
    CARD16	blue  ;
    CARD16	pad  ;
} pexRgb16Colour;
typedef struct {
    pexTableIndex	index  ;
    CARD16		pad  ;
} pexIndexedColour;
typedef struct {
    union {
	pexIndexedColour	indexed;
	pexRgb8Colour		rgb8;
	pexRgb16Colour		rgb16;
	pexRgbFloatColour	rgbFloat;
	pexHsvColour		hsvFloat;
	pexHlsColour		hlsFloat;
	pexCieColour		cieFloat;
    } format;
} pexColour;
typedef struct {
    PEXFLOAT   first;
    PEXFLOAT   second;
    PEXFLOAT   third;
} pexFloatColour;
typedef struct {
    pexColourType	colourType  ;	 
    CARD16		unused  ;
} pexColourSpecifier;
typedef struct {
    pexEnumTypeIndex	approxMethod  ;
    CARD16		unused  ;
    PEXFLOAT		tolerance;
} pexCurveApprox;
typedef struct {
    INT16	x  ;
    INT16 	y  ;
    PEXFLOAT 	z;
} pexDeviceCoord;
typedef struct {
    INT16	x  ;
    INT16 	y  ;
} pexDeviceCoord2D;
typedef struct {
    INT16	xmin  ;
    INT16	ymin  ;
    INT16	xmax  ;
    INT16	ymax  ;
} pexDeviceRect;
typedef struct {
    CARD16	elementType  ;
    CARD16	length  ;
} pexElementInfo;
typedef struct {
    CARD16	whence  ;
    CARD16	unused  ;
    INT32	offset  ;
} pexElementPos;
typedef struct {
    pexElementPos	position1;
    pexElementPos	position2;
} pexElementRange;
typedef struct {
    pexStructure	structure  ;
    CARD32		offset  ;
} pexElementRef;
typedef struct {
	pexCoord2D lowerLeft;
	pexCoord2D upperRight;
	pexCoord2D concatpoint;
} pexExtentInfo;
typedef struct {
    pexEnumTypeIndex	index  ;
    pexString		descriptor;
} pexEnumTypeDesc;
typedef struct {
    pexCoord3D	point;
    pexVector3D	vector;
} pexHalfSpace;
typedef struct {
    pexNameSet	incl;
    pexNameSet	excl;
} pexNameSetPair;
typedef struct {
    pexCoord2D	point;
    pexVector2D	vector;
} pexHalfSpace2D;
typedef struct {
    CARD16	composition  ;
    CARD16	unused  ;
    pexMatrix	matrix;
} pexLocalTransform3DData;
typedef struct {
    CARD16		composition  ;
    CARD16		unused  ;
    pexMatrix3X3	matrix;
} pexLocalTransform2DData;
typedef struct {
    pexCoord3D	minval;
    pexCoord3D	maxval;
} pexNpcSubvolume;
typedef struct {
    pexStructure	sid  ;
    CARD32		offset  ;
    CARD32		pickid  ;
} pexPickPath;
typedef struct {
    pexTextVAlignment		vertical  ;
    pexTextHAlignment		horizontal  ;
} pexTextAlignmentData;
typedef struct {
    pexSwitch		visibility;
    CARD8		unused;
    CARD16		order  ;
    pexCoordType	type  ;
    INT16		approxMethod  ;
    PEXFLOAT		tolerance;
    PEXFLOAT		tMin;
    PEXFLOAT		tMax;
    CARD32		numKnots  ;
    CARD32		numCoord  ;
} pexTrimCurve;
typedef struct {
    PEXFLOAT		ambient;
    PEXFLOAT		diffuse;
    PEXFLOAT		specular;
    PEXFLOAT		specularConc;
    PEXFLOAT		transmission;   
    pexColourSpecifier  specularColour;
} pexReflectionAttr;
typedef struct {
    pexEnumTypeIndex	approxMethod  ;
    CARD16		unused  ;
    PEXFLOAT		uTolerance;
    PEXFLOAT		vTolerance;
} pexSurfaceApprox;
typedef struct {
    pexCoord3D	point;
} pexVertex;
typedef struct {
    pexDeviceCoord	minval;
    pexDeviceCoord	maxval;
    pexSwitch		useDrawable;
    BYTE		pad[3];
} pexViewport;
typedef struct {
    CARD16		clipFlags  ;
    CARD16		unused  ;
    pexNpcSubvolume	clipLimits;
    pexMatrix		orientation;
    pexMatrix		mapping;
} pexViewEntry;
typedef struct {
    pexTableIndex	index  ;
    CARD16		unused  ;
    pexViewEntry	view;
} pexViewRep;
typedef struct {
    CARD16	definableEntries  ;
    CARD16	numPredefined  ;
    CARD16	predefinedMin  ;
    CARD16	predefinedMax  ;
} pexTableInfo;
typedef struct {
    pexEnumTypeIndex	lineType  ;
    pexEnumTypeIndex	polylineInterp  ;
    pexCurveApprox	curveApprox;
    PEXFLOAT		lineWidth;
    pexColourSpecifier	lineColour;
} pexLineBundleEntry;
typedef struct {
    pexEnumTypeIndex	markerType  ;
    INT16		unused  ;
    PEXFLOAT		markerScale;
    pexColourSpecifier	markerColour;
} pexMarkerBundleEntry;
typedef struct {
    CARD16		textFontIndex  ;
    CARD16		textPrecision  ;
    PEXFLOAT		charExpansion;
    PEXFLOAT		charSpacing;
    pexColourSpecifier	textColour;
} pexTextBundleEntry;
typedef struct {
    pexEnumTypeIndex    interiorStyle  ;
    INT16		interiorStyleIndex  ;
    pexEnumTypeIndex    reflectionModel  ;
    pexEnumTypeIndex    surfaceInterp  ;
    pexEnumTypeIndex    bfInteriorStyle  ;
    INT16		bfInteriorStyleIndex  ;
    pexEnumTypeIndex    bfReflectionModel  ;
    pexEnumTypeIndex    bfSurfaceInterp  ;
    pexSurfaceApprox    surfaceApprox;
} pexInteriorBundleEntry;
typedef struct {
    pexSwitch		edges;
    CARD8		unused;
    pexEnumTypeIndex	edgeType  ;
    PEXFLOAT		edgeWidth;
    pexColourSpecifier	edgeColour;
} pexEdgeBundleEntry;
typedef struct {
    pexColourType	colourType  ; 
    CARD16		numx  ;
    CARD16		numy  ;
    CARD16		unused  ;
} pexPatternEntry;
typedef struct {
    CARD32	numFonts  ;
} pexTextFontEntry;
typedef struct {
    pexEnumTypeIndex	lightType  ;
    INT16		unused  ;
    pexVector3D		direction;
    pexCoord3D		point;
    PEXFLOAT		concentration;
    PEXFLOAT		spreadAngle;
    PEXFLOAT		attenuation1;
    PEXFLOAT		attenuation2;
    pexColourSpecifier	lightColour;
} pexLightEntry;
typedef struct {
    pexSwitch		mode;
    CARD8		unused;
    CARD16		unused2  ;
    PEXFLOAT		frontPlane;
    PEXFLOAT		backPlane;
    PEXFLOAT		frontScaling;
    PEXFLOAT		backScaling;
    pexColourSpecifier	depthCueColour;
} pexDepthCueEntry;
typedef struct {
    INT16	approxType;
    INT16	approxModel;
    CARD16	max1  ;
    CARD16	max2  ;
    CARD16	max3  ;
    CARD8	dither;
    CARD8	unused;
    CARD32	mult1  ;
    CARD32	mult2  ;
    CARD32	mult3  ;
    PEXFLOAT	weight1;
    PEXFLOAT	weight2;
    PEXFLOAT	weight3;
    CARD32	basePixel  ;
} pexColourApproxEntry;
typedef struct {
    Atom	name  ;
    CARD32	value  ;
} pexFontProp;
typedef struct {
    CARD32	firstGlyph  ;
    CARD32	lastGlyph  ;
    CARD32	defaultGlyph  ;
    pexSwitch	allExist;
    pexSwitch	strokeFont;
    CARD16	unused  ;
    CARD32	numProps  ;
} pexFontInfo;
typedef struct {
    INT16	characterSet  ;
    CARD8	characterSetWidth;
    CARD8	encodingState;
    CARD16	unused  ;
    CARD16	numChars;
} pexMonoEncoding;
typedef struct {
    CARD16	placementType  ;
    CARD16	unused  ;
    CARD16	numUcurves  ;
    CARD16	numVcurves  ;
} pexPSC_IsoparametricCurves;		 
typedef struct {
    pexCoord3D	    origin;
    pexVector3D	    direction;
    CARD16	    numberIntersections  ;
    CARD16	    pad  ;
} pexPSC_LevelCurves;			 
typedef struct {
    pexDeviceCoord2D	position;
    PEXFLOAT		distance;
} pexPD_DC_HitBox;				 
typedef pexNpcSubvolume pexPD_NPC_HitVolume;	 
typedef struct {
    CARD8	type;		     
    CARD8	errorCode;	     
    CARD16	sequenceNumber  ;
    CARD32	resourceId  ;	     
    CARD16	minorCode  ;
    CARD8	majorCode;
    CARD8	unused;
    CARD16	opcode  ;	     
    CARD16	numCommands  ;     
    BYTE	pad[16];
} pexOutputCommandError;
typedef struct {
    pexEnumTypeIndex    interiorStyle;
    INT16               interiorStyleIndex;
    pexEnumTypeIndex    reflectionModel;
    pexEnumTypeIndex    surfaceInterp;
    pexEnumTypeIndex    bfInteriorStyle;
    INT16               bfInteriorStyleIndex;
    pexEnumTypeIndex    bfReflectionModel;
    pexEnumTypeIndex    bfSurfaceInterp;
    pexSurfaceApprox    surfaceApprox;
    pexColourSpecifier  surfaceColour;
    pexIndexedColour	index1;
    pexReflectionAttr   reflectionAttr;
    pexIndexedColour	index2;
    pexColourSpecifier  bfSurfaceColour;
    pexIndexedColour	index3;
    pexReflectionAttr   bfReflectionAttr;
    pexIndexedColour	index4;
} bogus_pexInteriorBundleEntry;
extern	unsigned	colour_type_sizes[];	 
static	ddInteriorBundleEntry 	pdeInteriorBundleEntry[    1 ];
extern listofObj  *puCreateList();
extern void	puDeleteList();
extern short	puInList();
extern short	puAddToList();
extern short	puRemoveFromList();
extern short	puCopyList();
extern short	puMergeLists();
extern int	puBuffRealloc();
extern void	puInitList();
extern int	puCountList();
extern ddpex4rtn miDealWithDynamics();	 
extern  ddpex43rtn      FreeLUT();
extern  ddpex43rtn      InquireLUTPredEntries();
extern  ddpex43rtn      InquireLUTEntries();
static miInteriorBundleEntry 	def_entry;
ddpex43rtn
InteriorBundleLUT_inq_entry_address  (LUTtype, pLUT, index,  pStatus, ppEntry)
    ddUSHORT            LUTtype;   
    diLUTHandle         pLUT;	   
    ddTableIndex        index;	   
    ddUSHORT           *pStatus;   
    ddPointer         *ppEntry;   
{
    miLUTHeader		*pheader;
    miInteriorBundleEntry 	*pentry, *plast;
    pentry = ((void *)0) ;			
    if (!pLUT) 
    {
	(&def_entry)->entry = pdeInteriorBundleEntry[0 ] ;	(&def_entry)->real_entry = pdeInteriorBundleEntry[0 ]  ;
	*ppEntry = (ddPointer)&def_entry;		
    	return (	   0	);
    }
    pheader = ((miLUTHeader *)(pLUT)->deviceData) ;
    pentry = (pheader)->plut.interior  + (pheader)->startIndex  ;
    plast = pentry + (pheader)->tableInfo.definableEntries ;
    while ( (( pentry) < ( plast)) && ((index) != ( pentry)->entry_info.index) )	( pentry)++;	if (( pentry) == ( plast))	 pentry = ((void *)0) ;	else if ((index) != ( pentry)->entry_info.index)	 pentry = ((void *)0)  ;
    if ((pentry == ((void *)0) ) || (pentry->entry_info.status == 0 ))
    {
	*pStatus = 0 ;
    	pentry = (pheader)->plut.interior  + (pheader)->startIndex  ;
	while ( (( pentry) < ( plast)) && (((pheader)->defaultIndex ) != ( pentry)->entry_info.index) )	( pentry)++;	if (( pentry) == ( plast))	 pentry = ((void *)0) ;	else if (((pheader)->defaultIndex ) != ( pentry)->entry_info.index)	 pentry = ((void *)0)  ;
	if (pentry == ((void *)0) )
 	{
		(&def_entry)->entry = pdeInteriorBundleEntry[0 ] ;	(&def_entry)->real_entry = pdeInteriorBundleEntry[0 ]  ;
		*ppEntry = (ddPointer)&def_entry;
	}
	else if (pentry->entry_info.status == 0 )
		{
			(&def_entry)->entry = pdeInteriorBundleEntry[0 ] ;	(&def_entry)->real_entry = pdeInteriorBundleEntry[0 ]  ;
			*ppEntry = (ddPointer)&def_entry;
		}
		else		 
			*ppEntry = (ddPointer)pentry;
    } else	 
    {
	*pStatus = 1 ;
	*ppEntry = (ddPointer)pentry;
    }
    return (	   0	);
}
Technical Details
Message-ID: <9208062059.AA23338@blood>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!blood.UUCP!kgor

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!blood.UUCP!kgor
From: kgor@blood.UUCP (Kent S. Gordon)
Subject: gcc bugs
Message-ID: <9208062059.AA23338@blood>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Thu, 6 Aug 1992 10:59:49 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 1776