Patches to X11R4 for AIX 2.2.1 on the IBM RT

Michael Francis Brantley brantley at rio-grande.rice.edu
Tue Apr 16 12:45:03 AEST 1991


The file AIXRT-RICE-fix is a set of patches that when applied to the MIT
release 4 of X11 (pl18) should enable you to build most of the distribution 
including the server on an IBM RT running AIX 2.2.1.  The server portion of 
the code has been fixed to run only on the Megapel display, and any efforts 
to fix the other displays would be greatly appreciated.

The bulk of the fixes included herein are the result of efforts by Todd
Inglett of IBM.  He is responsible for most of the real server hacking,
and as such deserves most of the credit.  Todd's problems began when he 
updated his O.S. to AIX 2.2.1 update level 1773, and found that his server 
no longer worked.  This was the point at which I joined the game, with the
help of senior Mark Kilgard, and I have left comments throughout the code 
documenting any changes that were made.

We've been running this server for several weeks pointing RT xdm sessions at 
Sun compute servers.  The configuration appears to be quite stable and has 
performed very well.  In our university environment, the porting of X11R4
to the RT's has saved them from extinction in a world where AIX 2.2.1 is
shunned simply because it is not SUNOS.  Thanks to xdm these machines now
make quite beefy little X-terminals.  Granted, it's a waste of computing
power, but not nearly as much of a waste as when they sat idle ...

These patches to X11R4 on AIX 2.2.1 on the IBM RT are meant to be applied
after having applied the official patches "fix-1" thru "fix-18" to the 
MIT release of the X11R4 server.  The summary of the build goes something
like this:

	< "ftp" yourself a copy of the files tape-1.01 thru tape-1.24 >
	< "ftp" yourself a copy of the files fix-1 thru fix-18 >
	% cat tape-1.?? | uncompress | tar xvf -
	% foreach i (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18)
	? patch -p0 < fix-$i
	? end
	... lots of output ...
	% patch -p0 < RICE-AIXRT-fix

Then, to build the full release of the X11R4 distribution,

	% cd mit
	% \rm -rf X11
	% make World BOOTSTRAPCFLAGS=-Daix >&! make.world &
	< ... and if you're both brave and foolish ... >
	% make install

Sit back, relax, it'll take about 8 hours.  You have to remove the mit/X11
directory because AIX's version of "rm" can't cope with "rm -r -f X11", which
is something it tries to do fairly early in the make process.

Please contact me with any problems you might have.  We would also like to 
hear about the successes, as we have put some time into getting this going.

Michael Brantley
Office of Networking and Computing Systems
Rice University, Houston, Texas
(brantley at rice.edu)


+-+-+ Cut Here -+-+-+-+-+ RICE-AIXRT-fix Apr 10, 1991 -+-+-+-+-+ Cut Here +-+-+

*** mit.pl18.clean/lib/Xaw/Mailbox.c	Wed Nov 29 14:01:42 1989
--- mit/lib/Xaw/Mailbox.c	Sun Mar 24 18:35:56 1991
***************
*** 430,436 ****
      long mailboxsize = 0;
  
      if (w->mailbox.check_command != NULL) {
! 	switch (system(w->mailbox.check_command)) {
  	  case 0:
  	    mailboxsize = w->mailbox.last_size + 1;
  	    break;
--- 430,436 ----
      long mailboxsize = 0;
  
      if (w->mailbox.check_command != NULL) {
! 	switch ((system(w->mailbox.check_command) >> 8) & 0xff) {
  	  case 0:
  	    mailboxsize = w->mailbox.last_size + 1;
  	    break;
*** mit.pl18.clean/server/dix/devices.c	Tue Mar 26 17:54:55 1991
--- mit/server/dix/devices.c	Tue Mar 26 17:37:32 1991
***************
*** 1076,1082 ****
      int newpercent;
      REQUEST(xBellReq);
      REQUEST_SIZE_MATCH(xBellReq);
!     if (stuff->percent < -100 || stuff->percent > 100)
      {
  	client->errorValue = stuff->percent;
  	return BadValue;
--- 1076,1082 ----
      int newpercent;
      REQUEST(xBellReq);
      REQUEST_SIZE_MATCH(xBellReq);
!     if ((int)stuff->percent < -100 || (int)stuff->percent > 100)
      {
  	client->errorValue = stuff->percent;
  	return BadValue;
*** mit.pl18.clean/server/ddx/mi/mispritest.h	Tue Oct  3 18:46:28 1989
--- mit/server/ddx/mi/mispritest.h	Sun Mar 24 18:35:56 1991
***************
*** 92,98 ****
   */
  #define SPN_OVERLAP(pCbox,y,x,w) BOX_OVERLAP((pCbox),(x),(y),(x)+(w),(y))
  
! #define LINE_SORT(x1,y2,x2,y2) \
  { int _t; \
    if (x1 > x2) { _t = x1; x1 = x2; x2 = _t; } \
    if (y1 > y2) { _t = y1; y1 = y2; y2 = _t; } }
--- 92,98 ----
   */
  #define SPN_OVERLAP(pCbox,y,x,w) BOX_OVERLAP((pCbox),(x),(y),(x)+(w),(y))
  
! #define LINE_SORT(x1,y1,x2,y2) \
  { int _t; \
    if (x1 > x2) { _t = x1; x1 = x2; x2 = _t; } \
    if (y1 > y2) { _t = y1; y1 = y2; y2 = _t; } }
*** mit.pl18.clean/server/ddx/mi/miwideline.h	Tue Nov 21 18:04:49 1989
--- mit/server/ddx/mi/miwideline.h	Sun Mar 24 18:35:56 1991
***************
*** 113,119 ****
  #ifdef NOINLINEICEIL
  #define ICEIL(x) ((int)ceil(x))
  #else
! #ifdef __GNUC__
  static inline int ICEIL(x)
      double x;
  {
--- 113,122 ----
  #ifdef NOINLINEICEIL
  #define ICEIL(x) ((int)ceil(x))
  #else
! #if defined(__GNUC__) || defined(__HIGHC__)
! #ifdef __HIGHC__
! #define inline _Inline
! #endif
  static inline int ICEIL(x)
      double x;
  {
*** mit.pl18.clean/server/ddx/mi/miregion.c	Sun Sep 24 14:40:06 1989
--- mit/server/ddx/mi/miregion.c	Sun Mar 24 18:35:58 1991
***************
*** 33,40 ****
--- 33,44 ----
  #if defined (__GNUC__) && defined (__STDC__) && !defined (__STRICT_ANSI) && !defined (NO_INLINES)
  #define INLINE	inline
  #else
+ #if defined (__HIGHC__) && defined (__STDC__) && !defined (__STRICT_ANSI) && !defined (NO_INLINES)
+ #define INLINE _Inline
+ #else
  #define INLINE
  #endif
+ #endif
  
  /*
   * hack until callers of these functions can deal with out-of-memory
***************
*** 43,54 ****
  extern Bool Must_have_memory;
  
  #ifdef DEBUG
  #define assert(expr) {if (!(expr)) \
  		FatalError("Assertion failed file %s, line %d: expr\n", \
  			__FILE__, __LINE__); }
  #else
  #define assert(expr)
! #endif
  
  #define good(reg) assert(miValidRegion(reg))
  
--- 47,62 ----
  extern Bool Must_have_memory;
  
  #ifdef DEBUG
+ #ifdef AIX
+ #define assert(expr)
+ #else
  #define assert(expr) {if (!(expr)) \
  		FatalError("Assertion failed file %s, line %d: expr\n", \
  			__FILE__, __LINE__); }
+ #endif /* AIX */
  #else
  #define assert(expr)
! #endif /* DEBUG */
  
  #define good(reg) assert(miValidRegion(reg))
  
*** mit.pl18.clean/server/ddx/mi/miarc.c	Tue Mar 26 17:54:57 1991
--- mit/server/ddx/mi/miarc.c	Sun Mar 24 18:36:01 1991
***************
*** 140,145 ****
--- 140,150 ----
  
  #if defined (__GNUC__) && defined (__STDC__) && !defined (__STRICT_ANSI__)
  #define USE_INLINE
+ #else
+ #if defined (__HIGHC__) && defined (__STDC__) && !defined (__STRICT_ANSI__)
+ #define USE_INLINE
+ #define inline _Inline
+ #endif
  #endif
  
  #ifdef USE_INLINE
*** mit.pl18.clean/server/ddx/mi/mifpoly.h	Fri Jul 28 11:05:51 1989
--- mit/server/ddx/mi/mifpoly.h	Sun Mar 24 18:36:01 1991
***************
*** 44,50 ****
  #ifdef NOINLINEICEIL
  #define ICEIL(x) ((int)ceil(x))
  #else
! #ifdef __GNUC__
  static inline int ICEIL(x)
      double x;
  {
--- 44,53 ----
  #ifdef NOINLINEICEIL
  #define ICEIL(x) ((int)ceil(x))
  #else
! #if defined(__GNUC__) || defined(__HIGHC__)
! #ifdef __HIGHC__
! #define inline _Inline
! #endif
  static inline int ICEIL(x)
      double x;
  {
*** mit.pl18.clean/server/ddx/mfb/mfbzerarc.c	Fri Nov 24 14:54:23 1989
--- mit/server/ddx/mfb/mfbzerarc.c	Sun Mar 24 18:36:02 1991
***************
*** 209,214 ****
--- 209,215 ----
  {
      register xArc *arc;
      register int i;
+     register int rop;
      BoxRec box;
      RegionPtr cclip;
  
***************
*** 215,223 ****
      if (!pGC->planemask & 1)
  	return;
      cclip = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip;
      for (arc = parcs, i = narcs; --i >= 0; arc++)
      {
! 	if (miCanZeroArc(arc))
  	{
  	    box.x1 = arc->x + pDraw->x;
  	    box.y1 = arc->y + pDraw->y;
--- 216,225 ----
      if (!pGC->planemask & 1)
  	return;
      cclip = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip;
+     rop = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->rop;
      for (arc = parcs, i = narcs; --i >= 0; arc++)
      {
! 	if (miCanZeroArc(arc) && (rop == RROP_WHITE || rop == RROP_BLACK))
  	{
  	    box.x1 = arc->x + pDraw->x;
  	    box.y1 = arc->y + pDraw->y;
*** mit.pl18.clean/server/ddx/ibm/AIX/Imakefile	Tue Nov 14 08:59:16 1989
--- mit/server/ddx/ibm/AIX/Imakefile	Sun Mar 24 18:36:02 1991
***************
*** 1,12 ****
  #include <Server.tmpl>
  
! #ifdef RtAIX
  OSDEP_SRC = aixRTOS.c
  OSDEP_OBJ = aixRTOS.o
  #else
  OSDEP_SRC = aixPS2OS.s
  OSDEP_OBJ = aixPS2OS.o
! #endif /* OPERATING_SYSTEM == "AIXrt" */
  
  SRCS =		aixCursor.c	\
  		aixEvents.c	\
--- 1,12 ----
  #include <Server.tmpl>
  
! #if AIXrt
  OSDEP_SRC = aixRTOS.c
  OSDEP_OBJ = aixRTOS.o
  #else
  OSDEP_SRC = aixPS2OS.s
  OSDEP_OBJ = aixPS2OS.o
! #endif /* "AIXrt" */
  
  SRCS =		aixCursor.c	\
  		aixEvents.c	\
*** mit.pl18.clean/server/ddx/ibm/AIX/aixCursor.c	Tue Nov  7 21:20:26 1989
--- mit/server/ddx/ibm/AIX/aixCursor.c	Sun Mar 24 18:36:02 1991
***************
*** 74,79 ****
--- 74,97 ----
  /***============================================================***/
  
  void
+ AIXPointerNonInterestBox( pScr, pBox )
+ ScreenPtr	pScr ;
+ BoxPtr		pBox ;
+ {
+ 
+     TRACE( ( "AIXPointerNonInterestBox(pScr=0x%x,pBox=0x%x)\n", pScr, pBox ) ) ;
+ /* Not implemented yet?
+     BSDXaddr->mbox.top =	pBox->y1 - ibmScreenMinY(ibmCurrentScreen) ;
+     BSDXaddr->mbox.bottom =	pBox->y2 - ibmScreenMinY(ibmCurrentScreen) ;
+     BSDXaddr->mbox.left =	pBox->x1 - ibmScreenMinX(ibmCurrentScreen) ;
+     BSDXaddr->mbox.right =	pBox->x2 - ibmScreenMinX(ibmCurrentScreen) ;
+ */
+     return ;
+ }
+ 
+ /***============================================================***/
+ 
+ void
  AIXConstrainCursor( pScr, pBox )
  register ScreenPtr      pScr ;
  register BoxPtr         pBox ;
***************
*** 109,115 ****
  	motion.u.keyButtonPointer.time=	lastEventTime;
  	motion.u.u.type=			MotionNotify;
  	mouse= LookupPointerDevice();
! 	(*mouse->processInputProc)(&motion,mouse);
      }
      AIXCurrentX= x;
      AIXCurrentY= y;
--- 127,133 ----
  	motion.u.keyButtonPointer.time=	lastEventTime;
  	motion.u.u.type=			MotionNotify;
  	mouse= LookupPointerDevice();
! 	(*mouse->processInputProc)(&motion,mouse,1);
      }
      AIXCurrentX= x;
      AIXCurrentY= y;
*** mit.pl18.clean/server/ddx/ibm/AIX/aixEvents.c	Tue Nov  7 21:20:30 1989
--- mit/server/ddx/ibm/AIX/aixEvents.c	Sun Mar 24 18:36:03 1991
***************
*** 173,179 ****
  	     */
  	    OS_TellCursorPosition(x,y);
  	}
- #if !defined(AIXrt) || defined(MULTIPLE_HEADS)
  	if ( oldScr != ibmCurrentScreen ) {
  	    (*ibmHideCursor( oldScr ) )( oldScr ) ;
  	    NewCurrentScreen( screenInfo->ibm_Screen, x, y ) ;
--- 173,178 ----
***************
*** 186,192 ****
  			screenInfo->ibm_Screen,
  			ibmCurrentCursor( oldScr ) ) ;
  	}
- #endif /* MULTIPLE HEADS */
  
  	(* screenInfo->ibm_CursorShow )( x, y ) ;
  
--- 185,190 ----
*** mit.pl18.clean/server/ddx/ibm/AIX/aixInit.c	Tue Nov  7 21:20:32 1989
--- mit/server/ddx/ibm/AIX/aixInit.c	Sun Mar 24 18:36:04 1991
***************
*** 176,182 ****
--- 176,186 ----
  
  #include <sys/socket.h>
  #include <sys/un.h>
+ #ifdef AIXrt
+ #include <netinet/in.h>
+ #else
  #include <sys/in.h>
+ #endif
  #include <errno.h>
  #include <sys/wait.h>
  
*** mit.pl18.clean/server/ddx/ibm/AIX/hftUtils.c	Tue Nov  7 21:20:48 1989
--- mit/server/ddx/ibm/AIX/hftUtils.c	Sun Mar 24 18:36:04 1991
***************
*** 686,691 ****
--- 686,697 ----
  	/* 10/9/88 (ef) -- need to close stdout so that "unix:0" (or	*/
  	/*	some other number) is flushed to xinit. sigh.		*/
  	/* close(1) ; no nore sigh ... */
+ 
+ 	/* Actually, we still need to close stdout because the later    */
+ 	/*      write to hftQFD in hftQueue.c won't otherwise work with */
+ 	/*      some update levels of AIX 2.2.1.  Sigh once more ...    */
+ 	close(1);
+ 	/* Michael Brantley, ONCS, Rice University, Houston, Texas      */
      }
      return(hftQFD);
  }
*** mit.pl18.clean/server/ddx/ibm/common/ibmMalloc.c	Tue Nov  7 21:21:22 1989
--- mit/server/ddx/ibm/common/ibmMalloc.c	Sun Mar 24 18:36:05 1991
***************
*** 990,996 ****
  	    sprintf(buf, "Malloc abort.  Attempt to allocate %d bytes caused data segment to exceed its maximum of %d bytes.\n",
  			nbytes, rlp.rlim_max);
  #else
! 	if ((int) (oldBrk = (char *) sbrk(0))+segbytes > maxBrk )
  	    sprintf(buf, "Malloc abort.  Attempt to allocate %d bytes caused data segment to exceed its maximum of %d bytes.\n",
  			nbytes, maxBrk - oldBrk );
  #endif
--- 990,996 ----
  	    sprintf(buf, "Malloc abort.  Attempt to allocate %d bytes caused data segment to exceed its maximum of %d bytes.\n",
  			nbytes, rlp.rlim_max);
  #else
! 	if ((int) (oldBrk = (char *) sbrk(0))+(char *)segbytes > maxBrk )
  	    sprintf(buf, "Malloc abort.  Attempt to allocate %d bytes caused data segment to exceed its maximum of %d bytes.\n",
  			nbytes, maxBrk - oldBrk );
  #endif
*** mit.pl18.clean/server/ddx/ibm/common/ibmColor.c	Tue Nov  7 21:20:59 1989
--- mit/server/ddx/ibm/common/ibmColor.c	Sun Mar 24 18:36:06 1991
***************
*** 238,249 ****
  	for ( i = pVisual->ColormapEntries ; i-- ; ) {
  		pent = &(cmap->red[i]) ;
  	    	if ( pent->refcnt != 0 ) {
! 			delta = ABS( ( (signed long int) pent->co.local.red )
! 				     - r )
! 			      + ABS( ( (signed long int) pent->co.local.green )
! 				     - g )
! 			      + ABS( ( (signed long int) pent->co.local.blue )
! 				     - b ) ;
  			if ( !delta )
  				return i ;
  			else if ( delta < bestdiff ) {
--- 238,252 ----
  	for ( i = pVisual->ColormapEntries ; i-- ; ) {
  		pent = &(cmap->red[i]) ;
  	    	if ( pent->refcnt != 0 ) {
! 			delta = ABS( (signed long int) 
! 			  (( (signed long int) pent->co.local.red ) - r )
! 				   )
! 			      + ABS( (signed long int)
! 			  (( (signed long int) pent->co.local.green ) - g )
! 				   )
! 			      + ABS( (signed long int)
! 			  (( (signed long int) pent->co.local.blue ) - b )
! 				   );
  			if ( !delta )
  				return i ;
  			else if ( delta < bestdiff ) {
***************
*** 258,264 ****
      case DirectColor:
  	/* red */
  	for ( i = pVisual->ColormapEntries ; i-- ; ) {
! 	    delta = ABS( cmap->red[i].co.local.red - r ) ;
  	    if ( delta < bestdiff ) {
  		bestdiff = delta ;
  		best = i ;
--- 261,267 ----
      case DirectColor:
  	/* red */
  	for ( i = pVisual->ColormapEntries ; i-- ; ) {
! 	    delta = ABS( (signed long int)cmap->red[i].co.local.red - r ) ;
  	    if ( delta < bestdiff ) {
  		bestdiff = delta ;
  		best = i ;
***************
*** 270,276 ****
  	best = 0 ;
  	bestdiff = (unsigned long int) ~ 0 ;
  	for ( i = pVisual->ColormapEntries ; i-- ; ) {
! 	    delta = ABS( cmap->green[i].co.local.green - g ) ;
  	    if ( delta < bestdiff ) {
  		bestdiff = delta ;
  		best = i ;
--- 273,279 ----
  	best = 0 ;
  	bestdiff = (unsigned long int) ~ 0 ;
  	for ( i = pVisual->ColormapEntries ; i-- ; ) {
! 	    delta = ABS( (signed long int)cmap->green[i].co.local.green - g ) ;
  	    if ( delta < bestdiff ) {
  		bestdiff = delta ;
  		best = i ;
***************
*** 282,288 ****
  	best = 0 ;
  	bestdiff = (unsigned long int) ~ 0 ;
  	for ( i = pVisual->ColormapEntries ; i-- ; ) {
! 	    delta = ABS( cmap->blue[i].co.local.blue - b ) ;
  	    if ( delta < bestdiff ) {
  		bestdiff = delta ;
  		best = i ;
--- 285,291 ----
  	best = 0 ;
  	bestdiff = (unsigned long int) ~ 0 ;
  	for ( i = pVisual->ColormapEntries ; i-- ; ) {
! 	    delta = ABS( (signed long int)cmap->blue[i].co.local.blue - b ) ;
  	    if ( delta < bestdiff ) {
  		bestdiff = delta ;
  		best = i ;
*** mit.pl18.clean/server/ddx/ibm/apa16/apa16OSD.c	Wed Nov 29 13:36:56 1989
--- mit/server/ddx/ibm/apa16/apa16OSD.c	Sun Mar 24 18:36:06 1991
***************
*** 72,77 ****
--- 72,78 ----
  
  #include <sys/hft.h>
  #include "hftUtils.h"
+ #include "ibmXhftMap.h"
  #include "OSio.h"
  
  /***==================================================================***/
***************
*** 83,89 ****
  
      TRACE(("apa16Probe()\n")) ;
  
!     if ( ( fd = hftProbe( HFT_APA16_ID ) ) < 0 ) {
  	ibmInfoMsg(
  		"Didn't find a 6155 Extended Monochrome Graphics Adapter\n" ) ;
  	return -1 ;
--- 84,90 ----
  
      TRACE(("apa16Probe()\n")) ;
  
!     if ( ( fd = hftProbe(APA16xHFTid) ) < 0 ) {
  	ibmInfoMsg(
  		"Didn't find a 6155 Extended Monochrome Graphics Adapter\n" ) ;
  	return -1 ;
***************
*** 95,102 ****
      /*NOTREACHED*/
  }
  
- }
  #else
  	******** ERROR ******** Not BSDrt or AIXrt
! #endif /*RtAIX*/
! #endif /*RtAIX*/
--- 96,102 ----
      /*NOTREACHED*/
  }
  
  #else
  	******** ERROR ******** Not BSDrt or AIXrt
! #endif /*AIXrt*/
! #endif /*BSDrt*/
*** mit.pl18.clean/server/ddx/ibm/ppc/ppcGC.c	Tue Nov  7 21:25:06 1989
--- mit/server/ddx/ibm/ppc/ppcGC.c	Sun Mar 24 18:36:07 1991
***************
*** 107,113 ****
  ppcCreateGC( pGC )
  register GCPtr pGC ;
  {
! 	ppcScrnPriv *devScrnPriv = pGC->pScreen->devPrivate ;
  	ppcPrivGC *pPriv ;
  	GCOps *pOps ;
  
--- 107,113 ----
  ppcCreateGC( pGC )
  register GCPtr pGC ;
  {
! 	ppcScrnPriv *devScrnPriv = (ppcScrnPriv *)pGC->pScreen->devPrivate ;
  	ppcPrivGC *pPriv ;
  	GCOps *pOps ;
  
***************
*** 201,216 ****
--- 201,232 ----
  
  	case GCLineStyle:
  	case GCLineWidth:
+ #if defined(AIXrt) && !defined(__HIGHC__)
+ 	    if ( ! pGC->lineWidth )
+ 		pGC->ops->Polylines =  miZeroLine;
+ 	    else if ( pGC->lineStyle == LineSolid )
+ 		pGC->ops->Polylines = miWideLine;
+ 	    else
+ 		pGC->ops->Polylines = miWideDash;
+ #else
  	    pGC->ops->Polylines = ( ! pGC->lineWidth )
  		 ? miZeroLine
  		 : ( ( pGC->lineStyle == LineSolid )
  			 ? miWideLine : miWideDash ) ;
+ #endif
  	    changes &= ~( GCLineStyle | GCLineWidth ) ;
  	    break ;
  
  	case GCJoinStyle:
+ #if defined(AIXrt) && !defined(__HIGHC__)
+ 	    if (pGC->joinStyle == JoinMiter)
+ 		pGC->ops->LineHelper = miMiter;
+ 	    else
+ 		pGC->ops->LineHelper = miNotMiter;
+ #else
  	    pGC->ops->LineHelper = ( pGC->joinStyle == JoinMiter )
  			    ? miMiter : miNotMiter ;
+ #endif
  	    changes &= ~ index ; /* i.e. changes &= ~ GCJoinStyle */
  	    break ;
  
***************
*** 270,276 ****
      DrawablePtr		pDrawable ;
  {
      register ppcPrivGCPtr devPriv ;
!     ppcScrnPriv *devScrnPriv = pGC->pScreen->devPrivate ;
      WindowPtr pWin ;
      Mask bsChanges = 0 ;
  
--- 286,292 ----
      DrawablePtr		pDrawable ;
  {
      register ppcPrivGCPtr devPriv ;
!     ppcScrnPriv *devScrnPriv = (ppcScrnPriv *)pGC->pScreen->devPrivate ;
      WindowPtr pWin ;
      Mask bsChanges = 0 ;
  
***************
*** 313,335 ****
        || ( pDrawable->serialNumber !=
  		( pGC->serialNumber & DRAWABLE_SERIAL_BITS ) ) ) {
  
- 	/* if there is a client clip (always a region, for us) AND
- 		it has moved or is different OR
- 		the window has moved
- 	   we need to (re)translate it.
- 	*/
- 	if ( ( pGC->clientClipType == CT_REGION )
- 	  && ( ( changes & ( GCClipXOrigin | GCClipYOrigin | GCClipMask ) )
- 	    || ( ( pGC->lastWinOrg.x != pGC->lastWinOrg.x )
- 	      || ( pGC->lastWinOrg.y != pGC->lastWinOrg.y ) ) ) ) {
- 	    /* retranslate client clip */
- 
- 	    (* pGC->pScreen->TranslateRegion)(
- 			   pGC->clientClip,
- 			   pGC->lastWinOrg.x + pGC->clipOrg.x,
- 			   pGC->lastWinOrg.y + pGC->clipOrg.y ) ;
- 	}
- 
  	if ( pWin ) {
  	    int freeTmpClip, freeCompClip ;
  	    RegionPtr pregWin ; /* clip for this window, without
--- 329,334 ----
***************
*** 374,419 ****
  		   do the intersection into it.
  		*/
  
! 		if ( freeTmpClip == TRUE ) {
! 		    if ( freeCompClip == TRUE ) {
! 			(* pGC->pScreen->Intersect)(
! 			    devPriv->pCompositeClip,
! 			    pregWin,
! 			    pGC->clientClip ) ;
  			(* pGC->pScreen->RegionDestroy)( pregWin ) ;
  		    }
! 		    else if ( freeCompClip == FALSE ) {
! 			(* pGC->pScreen->Intersect)(
! 			   pregWin,
! 			   pregWin,
! 			   pGC->clientClip ) ;
  			devPriv->pCompositeClip = pregWin ;
  		    }
  		}
- 		else if ( freeTmpClip == FALSE) {
- 		    if ( freeCompClip == TRUE ) {
- 		    (* pGC->pScreen->Intersect)(
- 			devPriv->pCompositeClip,
- 			pregWin,
- 			pGC->clientClip ) ;
- 		    }
- 		    else if ( freeCompClip == FALSE ) {
- 			devPriv->pCompositeClip =
- 			    (* pGC->pScreen->RegionCreate)( NULL, 1 ) ;
- 			(* pGC->pScreen->Intersect)(
- 			    devPriv->pCompositeClip,
- 			    pregWin,
- 			    pGC->clientClip ) ;
- 		    }
- 		}
  		devPriv->freeCompClip = TRUE ;
- 		if ((pGC->clientClipType == CT_REGION)
- 		   &&(changes & (GCClipXOrigin | GCClipYOrigin | GCClipMask))) {
- 		/* retranslate client clip */
  			(* pGC->pScreen->TranslateRegion)(pGC->clientClip,
  				-(pDrawable->x + pGC->clipOrg.x),
  				-(pDrawable->y + pGC->clipOrg.y));
- 	         }
  	    }
  	} /* end of composite clip for a window */
  	else {
--- 373,404 ----
  		   do the intersection into it.
  		*/
  
! 		(*pGC->pScreen->TranslateRegion)(pGC->clientClip,
! 					    pDrawable->x + pGC->clipOrg.x,
! 					    pDrawable->y + pGC->clipOrg.y);
! 		if (freeCompClip)
! 		{
! 		    (*pGC->pScreen->Intersect)(devPriv->pCompositeClip,
! 					  pregWin, pGC->clientClip);
! 		    if (freeTmpClip)
  			(* pGC->pScreen->RegionDestroy)( pregWin ) ;
  		    }
! 		else if (freeTmpClip)
! 		{
! 		    (*pGC->pScreen->Intersect)(pregWin, pregWin, pGC->clientClip);
  			devPriv->pCompositeClip = pregWin ;
  		    }
+ 		else
+ 		{
+ 		    devPriv->pCompositeClip = (*pGC->pScreen->RegionCreate)(NullBox,
+ 								       0);
+ 		    (*pGC->pScreen->Intersect)(devPriv->pCompositeClip,
+ 					  pregWin, pGC->clientClip);
  		}
  		devPriv->freeCompClip = TRUE ;
  			(* pGC->pScreen->TranslateRegion)(pGC->clientClip,
  				-(pDrawable->x + pGC->clipOrg.x),
  				-(pDrawable->y + pGC->clipOrg.y));
  	    }
  	} /* end of composite clip for a window */
  	else {
*** mit.pl18.clean/server/ddx/ibm/ppc/ppcWindow.c	Tue Nov 21 12:18:34 1989
--- mit/server/ddx/ibm/ppc/ppcWindow.c	Sun Mar 24 18:36:08 1991
***************
*** 336,342 ****
  
      TRACE(("ppcCreateWindow(pWin= 0x%x)\n", pWin));
  
!     pPrivWin = pWin->devPrivates[mfbWindowPrivateIndex].ptr;
      pPrivWin->pRotatedBorder = NullPixmap;
      pPrivWin->pRotatedBackground = NullPixmap;
      pPrivWin->fastBackground = 0;
--- 336,342 ----
  
      TRACE(("ppcCreateWindow(pWin= 0x%x)\n", pWin));
  
!     pPrivWin = (mfbPrivWin*)pWin->devPrivates[mfbWindowPrivateIndex].ptr;
      pPrivWin->pRotatedBorder = NullPixmap;
      pPrivWin->pRotatedBackground = NullPixmap;
      pPrivWin->fastBackground = 0;
***************
*** 354,360 ****
  
      TRACE(("ppcCreateWindowForXYhardware (pWin= 0x%x)\n", pWin));
  
!     pPrivWin = pWin->devPrivates[mfbWindowPrivateIndex].ptr;
      pPrivWin->pRotatedBorder = NullPixmap;
      pPrivWin->pRotatedBackground = NullPixmap;
      pPrivWin->fastBackground = 0;
--- 354,360 ----
  
      TRACE(("ppcCreateWindowForXYhardware (pWin= 0x%x)\n", pWin));
  
!     pPrivWin = (mfbPrivWin*)pWin->devPrivates[mfbWindowPrivateIndex].ptr;
      pPrivWin->pRotatedBorder = NullPixmap;
      pPrivWin->pRotatedBackground = NullPixmap;
      pPrivWin->fastBackground = 0;
*** mit.pl18.clean/server/ddx/ibm/ppc/ppcIO.c	Wed Nov 29 17:01:51 1989
--- mit/server/ddx/ibm/ppc/ppcIO.c	Sun Mar 24 18:36:08 1991
***************
*** 90,95 ****
--- 90,98 ----
  
  #include "OScompiler.h"
  #include "ibmScreen.h"
+ #ifdef AIXrt
+ #include "OSio.h"
+ #endif
  #include "OScursor.h"
  
  #include "ppc.h"
***************
*** 169,174 ****
--- 172,181 ----
  		ppcInstallColormap( pColormap ) ;
  		ibmAllocBlackAndWhitePixels( pColormap ) ;
  	}
+ #ifdef AIXrt
+ 	pScreen->BlockHandler=	OS_BlockHandler;
+ 	pScreen->WakeupHandler=	OS_WakeupHandler;
+ #endif
  	miInitializeBackingStore (pScreen, &ppcBSFuncRec);
  	TRACE(("ppcCommonScreenInit returns\n"));
  	return ;
*** mit.pl18.clean/server/ddx/ibm/ppc/ppcGenFS.c	Tue Nov 14 13:41:11 1989
--- mit/server/ddx/ibm/ppc/ppcGenFS.c	Sun Mar 24 18:36:09 1991
***************
*** 43,49 ****
--- 43,63 ----
  #include "ibmTrace.h"
  extern int mfbGCPrivateIndex;
  
+ #if defined(AIXrt) && !defined(__HIGHC__)
+ /* AIX/RT cc does not like (b) ? x : y, where x,y are void functions */
  /* Declared in ppcPixmapFS.o */
+ int ppcSolidWindowFS() ;
+ int ppcStippleWindowFS() ;
+ int ppcOpStippleWindowFS() ;
+ int ppcTileWindowFS() ;
+  
+ /* Declared in ppcPixmapFS.o */
+ int ppcSolidPixmapFS() ;
+ int ppcStipplePixmapFS() ;
+ int ppcOpStipplePixmapFS() ;
+ int ppcTilePixmapFS() ;
+ #else
+ /* Declared in ppcPixmapFS.o */
  void ppcSolidWindowFS() ;
  void ppcStippleWindowFS() ;
  void ppcOpStippleWindowFS() ;
***************
*** 54,59 ****
--- 68,74 ----
  void ppcStipplePixmapFS() ;
  void ppcOpStipplePixmapFS() ;
  void ppcTilePixmapFS() ;
+ #endif
   
  void
  ppcTileGenFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
***************
*** 67,76 ****
--- 82,100 ----
      TRACE( ( "ppcTileFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n",
  	    pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ;
  
+ #ifdef AIX
+     if (pDrawable->type == DRAWABLE_PIXMAP)
+ 	 ( *ppcTilePixmapFS )( pDrawable, pGC, nInit, pptInit, 
+ 				pwidthInit, fSorted);
+     else
+ 	 ( *ppcTileWindowFS )( pDrawable, pGC, nInit, pptInit, 
+ 				pwidthInit, fSorted);
+ #else
      (* ( ( pDrawable->type == DRAWABLE_PIXMAP )
  	 ? ppcTilePixmapFS
  	 : ppcTileWindowFS ) )( pDrawable, pGC, nInit, pptInit,
  				pwidthInit, fSorted ) ;
+ #endif
  
      return ;
  }
***************
*** 86,95 ****
--- 110,128 ----
  {
      TRACE(("ppcOpStippleFS(pDrawable=0x%x, pGC=0x%x, nInit=%d, pptInit=0x%x, pwidthInit=0x%x, fSorted=%d)\n", pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)) ;
  
+ #ifdef AIX
+     if ( pDrawable->type == DRAWABLE_PIXMAP )
+ 	 ( *ppcOpStipplePixmapFS )( pDrawable, pGC, nInit, pptInit,
+ 				     pwidthInit, fSorted ) ;
+     else
+ 	 ( *ppcOpStippleWindowFS )( pDrawable, pGC, nInit, pptInit,
+ 				     pwidthInit, fSorted ) ;
+ #else
      (* ( ( pDrawable->type == DRAWABLE_PIXMAP )
  	 ? ppcOpStipplePixmapFS
  	 : ppcOpStippleWindowFS ) )( pDrawable, pGC, nInit, pptInit,
  				     pwidthInit, fSorted ) ;
+ #endif
  
      return ;
  }
***************
*** 106,115 ****
--- 139,157 ----
      TRACE( ( "ppcStippleFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n",
  	    pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ;
  
+ #ifdef AIX
+     if ( pDrawable->type == DRAWABLE_PIXMAP )
+ 	 ( *ppcStipplePixmapFS )( pDrawable, pGC, nInit, pptInit,
+ 				   pwidthInit, fSorted ) ;
+     else
+ 	 ( *ppcStippleWindowFS )( pDrawable, pGC, nInit, pptInit,
+ 				   pwidthInit, fSorted ) ;
+ #else
      (* ( ( pDrawable->type == DRAWABLE_PIXMAP )
  	 ? ppcStipplePixmapFS
  	 : ppcStippleWindowFS ) )( pDrawable, pGC, nInit, pptInit,
  				   pwidthInit, fSorted ) ;
+ #endif
  
      return ;
  }
***************
*** 126,135 ****
--- 168,186 ----
      TRACE( ( "ppcSolidFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n",
  	   pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ;
  
+ #ifdef AIX
+     if ( pDrawable->type == DRAWABLE_PIXMAP )
+ 	 ( *ppcSolidPixmapFS )( pDrawable, pGC, nInit, pptInit,
+ 				 pwidthInit, fSorted ) ;
+     else
+ 	 ( *ppcSolidWindowFS )( pDrawable, pGC, nInit, pptInit,
+ 				 pwidthInit, fSorted ) ;
+ #else
      (* ( ( pDrawable->type == DRAWABLE_PIXMAP )
  	 ? ppcSolidPixmapFS
  	 : ppcSolidWindowFS ) )( pDrawable, pGC, nInit, pptInit,
  				 pwidthInit, fSorted ) ;
+ #endif
  
      return ;
  }
*** mit.pl18.clean/server/ddx/ibm/ppc/ppcGetSp.c	Tue Nov 14 13:41:19 1989
--- mit/server/ddx/ibm/ppc/ppcGetSp.c	Sun Mar 24 18:36:09 1991
***************
*** 97,103 ****
  	}
  
      pixmapStride = PixmapBytePad( wMax, pDrawable->depth ) ;
!     pdst = pdstStart ;
  
      if ( pDrawable->type == DRAWABLE_WINDOW ) {
       	register void (* fnp)()
--- 97,103 ----
  	}
  
      pixmapStride = PixmapBytePad( wMax, pDrawable->depth ) ;
!     pdst = (unsigned char *)pdstStart ;
  
      if ( pDrawable->type == DRAWABLE_WINDOW ) {
       	register void (* fnp)()
*** mit.pl18.clean/server/ddx/ibm/mpel/mpelArc.c	Thu Nov  9 21:51:39 1989
--- mit/server/ddx/ibm/mpel/mpelArc.c	Sun Mar 24 18:36:09 1991
***************
*** 122,128 ****
  
      TRACE(("mpelPolyArc( pDraw=x%x, pGC=x%x, narcs=%d, parcs=x%x )\n",
  						pDraw, pGC, narcs, parcs)) ;
- 
      if ( !narcs )
  	return ;
  
--- 122,127 ----
***************
*** 154,160 ****
  	bbox.y2 = MAX( bbox.y2, parc->y + parc->height ) ;
  
  	/* Throw out multiples of 360 degrees. */
- 
  	if ( parc->angle1 < 0 ) {
  		while ( parc->angle1 < -FULLCIRCLE )
  			parc->angle1 += FULLCIRCLE ;
--- 153,158 ----
***************
*** 186,191 ****
--- 184,191 ----
  		tmp = parc->angle1 ;
  		parc->angle1 = parc->angle2 ;
  		parc->angle2 = tmp ;
+ 		if (parc->angle1 < 0)
+ 		    parc->angle1 += FULLCIRCLE;
  	}
  	/* make mpel numbers */
  	parc->width = parc->width / 2 ;
***************
*** 220,225 ****
--- 220,240 ----
  	scissor.lleft.y =	MPEL_HEIGHT - pbox->y2 ;
  	MPELSetScissor( &scissor ) ;
  	for ( arci = 0 ; arci < narcs ; arci++ ) {
+ 		if (pArc[arci].width == 0) {
+ 		    /* vertical line */
+ 		    mpelPoint p[2];
+ 		    p[0].x = p[1].x = pArc[arci].x;
+ 		    p[0].y = pArc[arci].y - pArc[arci].height;
+ 		    p[1].y = pArc[arci].y + pArc[arci].height;
+ 		    MPELPolyline(2, &p);
+ 		} else if (pArc[arci].height == 0) {
+ 		    /* horizontal line */
+ 		    mpelPoint p[2];
+ 		    p[0].y = p[1].y = pArc[arci].y;
+ 		    p[0].x = pArc[arci].x - pArc[arci].width;
+ 		    p[1].x = pArc[arci].x + pArc[arci].width;
+ 		    MPELPolyline(2, &p);
+ 		} else {
  		Arc.ellipse.center.x	= pArc[arci].x ;
  		Arc.ellipse.center.y	= pArc[arci].y ;
  		Arc.ellipse.majax	= pArc[arci].width ;
***************
*** 228,233 ****
--- 243,249 ----
  		Arc.start		= pArc[arci].angle1 ;
  		Arc.end			= pArc[arci].angle2 ;
  		MPELEllipticalArc( &Arc ) ;
+ 		}
  	}
      }
  
*** mit.pl18.clean/server/ddx/ibm/mpel/mpelCursor.c	Thu Nov  9 21:51:45 1989
--- mit/server/ddx/ibm/mpel/mpelCursor.c	Sun Mar 24 18:36:10 1991
***************
*** 168,176 ****
      cursorBlit.dest.uright.x = x + w - 1 ;
      cursorBlit.dest.uright.y = MPEL_HEIGHT - 1 - y ;
      cursorBlit.alu = GXcopy + 1 ;
-     cursorBlit.color = c_fg ;
      byteSize = ( w >> 3 ) * MIN( curCursor->bits->height, 32 ) ;
  
      MPELBLTImmedWColorExpansion( byteSize, &cursorBlit ) ;
      MPELSendData( byteSize, fSrc ) ;
  
--- 168,176 ----
      cursorBlit.dest.uright.x = x + w - 1 ;
      cursorBlit.dest.uright.y = MPEL_HEIGHT - 1 - y ;
      cursorBlit.alu = GXcopy + 1 ;
      byteSize = ( w >> 3 ) * MIN( curCursor->bits->height, 32 ) ;
  
+     cursorBlit.color = c_fg ;
      MPELBLTImmedWColorExpansion( byteSize, &cursorBlit ) ;
      MPELSendData( byteSize, fSrc ) ;
  
*** mit.pl18.clean/server/ddx/ibm/mpel/mpelOSD.c	Thu Nov  9 21:52:17 1989
--- mit/server/ddx/ibm/mpel/mpelOSD.c	Sun Mar 24 18:36:10 1991
***************
*** 77,82 ****
--- 77,83 ----
  #include "OSio.h"
  #include <sys/hft.h>
  #include "hftUtils.h"
+ #include "ibmXhftMap.h"
  extern int hftQFD ;
  #else
  #if defined(BSDrt)
***************
*** 102,108 ****
  
      TRACE( ( "mpelProbe()\n" ) ) ;
  
!     if ( ( fd = hftProbe( HFT_MEGAPEL_ID ) ) < 0 ) {
  	ibmInfoMsg( "Didn't find an IBM 5081 Graphics Adapter\n" ) ;
  	return -1 ;
      }
--- 103,109 ----
  
      TRACE( ( "mpelProbe()\n" ) ) ;
  
!     if ( ( fd = hftProbe( MEGAPELxHFTid ) ) < 0 ) {
  	ibmInfoMsg( "Didn't find an IBM 5081 Graphics Adapter\n" ) ;
  	return -1 ;
      }
*** mit.pl18.clean/server/ddx/ibm/mpel/mpelPoly.c	Thu Nov  9 21:52:21 1989
--- mit/server/ddx/ibm/mpel/mpelPoly.c	Sun Mar 24 18:36:11 1991
***************
*** 326,332 ****
      mpelSetPlaneMask( pm );
  
      {/* SET THE PATTERN IN MPEL PATTERN AREA */
!     register unsigned volatile char *data = MPEL_PAT1;
      register unsigned char *src;
      register int tile_row, iw;
      int pix, tlx, tly;
--- 326,332 ----
      mpelSetPlaneMask( pm );
  
      {/* SET THE PATTERN IN MPEL PATTERN AREA */
!     register unsigned volatile char *data = (char *) MPEL_PAT1;
      register unsigned char *src;
      register int tile_row, iw;
      int pix, tlx, tly;
*** mit.pl18.clean/server/ddx/ibm/mpel/mpelIO.c	Thu Nov  9 21:52:06 1989
--- mit/server/ddx/ibm/mpel/mpelIO.c	Sun Mar 24 18:36:11 1991
***************
*** 71,85 ****
  /* Global Variable */
  extern ScreenRec mpelScreenRec ;
  
  /***==================================================================***/
  
  /*ARGSUSED*/
  Bool
  mpelScreenInit( index, pScreen, argc, argv )
! register const int index ;
! register ScreenPtr const pScreen ;
! register int const argc ;		/* these two may NOT be changed */
! register char * const * const argv ;
  {
  	static int been_here = 0 ;
  
--- 71,89 ----
  /* Global Variable */
  extern ScreenRec mpelScreenRec ;
  
+ #ifdef AIXrt
+ extern void mpelDataInit();
+ #endif
+ 
  /***==================================================================***/
  
  /*ARGSUSED*/
  Bool
  mpelScreenInit( index, pScreen, argc, argv )
! register int index ;
! register ScreenPtr pScreen ;
! register int argc ;		/* these two may NOT be changed */
! register char **argv ;
  {
  	static int been_here = 0 ;
  
***************
*** 93,98 ****
--- 97,105 ----
  		/*NOTREACHED*/
  	    }
  	    mpelLoaduCode() ;
+ #if defined(AIXrt) && !defined(__HIGHC__)
+ 	    mpelDataInit();
+ #endif
  	    been_here = TRUE ;
  	}
  
*** mit.pl18.clean/server/ddx/ibm/mpel/mpelData.c	Tue Mar 26 17:55:33 1991
--- mit/server/ddx/ibm/mpel/mpelData.c	Sun Mar 24 18:36:12 1991
***************
*** 57,63 ****
  extern void ibmAbort();
  
  static PixmapPtr BogusPixmap = (PixmapPtr) 1 ;
! ScreenRec mpelScreenRec ; /* Forward Declaration */
  
  PixmapFormatRec	mpelFormats[]= { { 8, 8, 32 } } ;
  
--- 57,63 ----
  extern void ibmAbort();
  
  static PixmapPtr BogusPixmap = (PixmapPtr) 1 ;
! extern ScreenRec mpelScreenRec ; /* Forward Declaration */
  
  PixmapFormatRec	mpelFormats[]= { { 8, 8, 32 } } ;
  
***************
*** 147,153 ****
  	miMiter			/*  void (* LineHelper)() */
  };
  	
! 
  GC mpelPrototypeGC = {
  	&mpelScreenRec,	/*  ScreenPtr	pScreen	 */
  	MPELMAXPLANES,	/*  int         depth	 */
--- 147,156 ----
  	miMiter			/*  void (* LineHelper)() */
  };
  	
! #if defined(AIXrt) && !defined(__HIGHC__)
! /* AIX/RT's C compiler cannot initialize unions. */
! GC mpelPrototypeGC;
! #else
  GC mpelPrototypeGC = {
  	&mpelScreenRec,	/*  ScreenPtr	pScreen	 */
  	MPELMAXPLANES,	/*  int         depth	 */
***************
*** 186,191 ****
--- 189,195 ----
  	NULL			/*  devUnion	devPrivates	 */
  
  } ;
+ #endif
  
  ppcScrnPriv mpelScrnPriv = {
  	{
***************
*** 204,210 ****
--- 208,218 ----
  		},		/* DrawableRec drawable */
  		1,		/* int refcnt */
  		MPEL_WIDTH / 8,	/* int devKind */
+ #if defined(AIXrt) && !defined(__HIGHC__)
+ /* assume this field is zero since we can't initialize unions */
+ #else
  		{0}		/* DevUnion devPrivate */
+ #endif
  	},			/* PixmapRec	pixmap */
  	0,			/* void	(* devHardwareInitBB)() */
  	0,			/* void	(* devHardwareInitAB)() */
***************
*** 348,350 ****
--- 356,403 ----
  	(pointer) 0,		/* pointer wakeupData */
  	0			/* DevUnion devPrivate */
  } ;
+ 
+ 
+ #if defined(AIXrt) && !defined(__HIGHC__)
+ void
+ mpelDataInit()
+ {
+     mpelPrototypeGC.pScreen = &mpelScreenRec;
+     mpelPrototypeGC.depth = MPELMAXPLANES;
+     mpelPrototypeGC.alu	= GXcopy;
+     mpelPrototypeGC.lineWidth = 0;
+     mpelPrototypeGC.dashOffset = 0;
+     mpelPrototypeGC.numInDashList = 0;
+     mpelPrototypeGC.dash = 0;
+     mpelPrototypeGC.lineStyle = LineSolid;
+     mpelPrototypeGC.capStyle = CapButt;
+     mpelPrototypeGC.joinStyle = JoinMiter;
+     mpelPrototypeGC.fillStyle = FillSolid;
+     mpelPrototypeGC.fillRule = EvenOddRule;
+     mpelPrototypeGC.arcMode = ArcPieSlice;
+     mpelPrototypeGC.subWindowMode = ClipByChildren;
+     mpelPrototypeGC.graphicsExposures = TRUE;
+     mpelPrototypeGC.clientClipType = CT_NONE;
+     mpelPrototypeGC.miTranslate = 1;
+     mpelPrototypeGC.tileIsPixel = 1;
+     mpelPrototypeGC.unused = 0;
+     mpelPrototypeGC.planemask = MPEL_ALLPLANES;
+     mpelPrototypeGC.fgPixel = 0;
+     mpelPrototypeGC.bgPixel = 1;
+     mpelPrototypeGC.tile.pixmap = 0;
+     mpelPrototypeGC.stipple = 0;
+     mpelPrototypeGC.patOrg.x = 0;
+     mpelPrototypeGC.patOrg.y = 0;
+     mpelPrototypeGC.font = 0;
+     mpelPrototypeGC.clipOrg.x = 0;
+     mpelPrototypeGC.clipOrg.y = 0;
+     mpelPrototypeGC.lastWinOrg.x = 0;
+     mpelPrototypeGC.lastWinOrg.y = 0;
+     mpelPrototypeGC.clientClip = NULL;
+     mpelPrototypeGC.stateChanges = 0;
+     mpelPrototypeGC.serialNumber = 0;
+     mpelPrototypeGC.funcs = &mpelGCFuncs;
+     mpelPrototypeGC.ops = &mpelGCOps;
+     mpelPrototypeGC.devPrivates = NULL;
+ }
+ #endif
*** mit.pl18.clean/server/os/4.2bsd/connection.c	Mon Nov 13 10:53:50 1989
--- mit/server/os/4.2bsd/connection.c	Sun Mar 24 18:36:13 1991
***************
*** 439,444 ****
--- 439,445 ----
  {
      ResetOsBuffers();
  #ifdef UNIXCONN
+ #ifndef AIXrt
      if (unixDomainConnection != -1)
      {
  	/*
***************
*** 459,464 ****
--- 460,466 ----
  		WellKnownConnections |= (1L << unixDomainConnection);
  	}
      }
+ #endif /* AIXrt */
  #endif /* UNIXCONN */
      ResetAuthorization ();
      ResetHosts(display);
*** mit.pl18.clean/server/os/4.2bsd/access.c	Sun Nov 12 14:39:31 1989
--- mit/server/os/4.2bsd/access.c	Tue Mar 26 18:11:59 1991
***************
*** 285,291 ****
--- 285,308 ----
  	    if (family != AF_INET)
  		continue;
  
+ /*
+  * In AIX, the SIOCGIFCONF ioctl returns the localhost address (127.0.0.1)
+  *      before the interface address.  This caused the AIX 2.2.1 X server 
+  *      to make the XDM server try to open an XDM session on "localhost",
+  *      which obviously was not the intent.  The following check ensures
+  *      that only the internet address will be sent when an X server 
+  *      queries the XDM server.
+  */
+ #define IS_LOCALHOST(address)  (((char)address[0] == 0x7f) || \
+ 				((char)address[1] == 0x00) || \
+ 				((char)address[2] == 0x00) || \
+ 				((char)address[3] == 0x01)) ? 1 : 0
+ 	    if (IS_LOCALHOST((char *)addr))
+ 		continue;
+ /* Michael Brantley, Rice University, ONCS */
+ 
  	    XdmcpRegisterConnection (FamilyInternet, (char *)addr, len);
+ 
  	    broad_addr = ifr->ifr_addr;
  	    ((struct sockaddr_in *) &broad_addr)->sin_addr.s_addr =
  		htonl (INADDR_BROADCAST);
*** mit.pl18.clean/clients/xterm/Imakefile	Tue Mar 26 17:55:35 1991
--- mit/clients/xterm/Imakefile	Sun Mar 24 18:36:14 1991
***************
*** 63,68 ****
--- 63,77 ----
  #endif
  #endif
  
+ /* 
+  *	AIX is kind of forgotten in this world of terminfo schtuff ...
+  *	We'll add this here to avoid all confusion.
+  *	Michael Brantley, Rice University, ONCS 
+  */
+ #if defined(AIXArchitecture)
+ #define TermcapLibrary -lcurses
+ #endif
+ 
       TERMCAPLIB = TermcapLibrary
  
  AllTarget($(PROGRAMS))
*** mit.pl18.clean/clients/xauth/butil.c	Tue Jan  3 09:38:49 1989
--- mit/clients/xauth/butil.c	Sun Mar 24 18:36:15 1991
***************
*** 2,8 ****
--- 2,18 ----
   * This file is used by System V based systems.
   */
  
+ /*
+  * There is a problem with AIX's libc.a bcopy routine conflicting with this
+  *     one.  For this reason, we distinguish this one by renaming it ...
+  * Michael Brantley, Rice University, ONCS
+  */
+ 
+ #ifdef ibm
+ void ibm_bcopy (b1, b2, length)
+ #else
  void bcopy (b1, b2, length)
+ #endif
  register unsigned char *b1, *b2;
  register length;
  {
*** mit.pl18.clean/clients/xauth/gethost.c	Sun Dec 10 18:58:53 1989
--- mit/clients/xauth/gethost.c	Sun Mar 24 18:36:15 1991
***************
*** 143,149 ****
--- 143,153 ----
  	    return False;
  	}
   
+ #ifdef ibm
+ 	ibm_bcopy((char *)host_ptr->h_addr, (char *)&hostinetaddr,
+ #else
  	bcopy((char *)host_ptr->h_addr, (char *)&hostinetaddr,
+ #endif
  	      sizeof(inaddr.sin_addr));
      }
      *resultp = hostinetaddr;
***************
*** 164,170 ****
--- 168,178 ----
      } else {
  	if ((np = getnodebyname (name)) == NULL) return False;
  	dnaddr.a_len = np->n_length;
+ #ifdef ibm
+ 	ibm_bcopy (np->n_addr, dnaddr.a_addr, np->n_length);
+ #else
  	bcopy (np->n_addr, dnaddr.a_addr, np->n_length);
+ #endif
      }
      *resultp = dnaddr;
      return True;
***************
*** 242,248 ****
--- 250,260 ----
  
      retval = malloc (len);
      if (retval) {
+ #ifdef ibm
+ 	ibm_bcopy (src, retval, len);
+ #else
  	bcopy (src, retval, len);
+ #endif
  	*lenp = len;
      }
      return retval;
*** mit.pl18.clean/clients/xdm/cryptokey.c	Tue Mar 26 17:55:11 1991
--- mit/clients/xdm/cryptokey.c	Sun Mar 24 18:36:15 1991
***************
*** 48,54 ****
  # endif
  #endif
  
! #if !defined (DONT_USE_DES) && !defined (USE_CRYPT)
  # define USE_ENCRYPT
  #endif
  
--- 48,54 ----
  # endif
  #endif
  
! #if !defined (DONT_USE_DES) && !defined (USE_CRYPT) && !defined (ibm)
  # define USE_ENCRYPT
  #endif
  
*** mit.pl18.clean/clients/Imakefile	Fri Dec 15 09:53:04 1989
--- mit/clients/Imakefile	Sun Mar 24 18:36:16 1991
***************
*** 3,19 ****
  
  #ifndef CrayArchitecture
  #ifdef ATTArchitecture
! OTHERSUBDIRS = xhost
  #else
  OTHERSUBDIRS = xdm xhost
  #endif
  #endif
  
  SUBDIRS = \
  	appres bitmap listres oclock twm xauth xbiff xcalc xclipboard xclock \
  	xditview xdpyinfo xedit xfd xinit xkill xload xlogo \
  	xlsatoms xlsclients xlsfonts xlswins xmag xman xmh \
! 	xmodmap xpr xprop xrdb xrefresh xfontsel $(OTHERSUBDIRS) \
   	xset xsetroot xstdcmap xterm xwd xwininfo xwud
  
  MakeSubdirs($(SUBDIRS))
--- 3,23 ----
  
  #ifndef CrayArchitecture
  #ifdef ATTArchitecture
! OTHERSUBDIRS = xhost xpr
  #else
+ #ifdef AIXArchitecture
  OTHERSUBDIRS = xdm xhost
+ #else
+ OTHERSUBDIRS = xdm xhost xpr
  #endif
  #endif
+ #endif
  
  SUBDIRS = \
  	appres bitmap listres oclock twm xauth xbiff xcalc xclipboard xclock \
  	xditview xdpyinfo xedit xfd xinit xkill xload xlogo \
  	xlsatoms xlsclients xlsfonts xlswins xmag xman xmh \
! 	xmodmap xprop xrdb xrefresh xfontsel $(OTHERSUBDIRS) \
   	xset xsetroot xstdcmap xterm xwd xwininfo xwud
  
  MakeSubdirs($(SUBDIRS))
*** mit.pl18.clean/util/scripts/bsdinst.sh	Thu Oct 20 16:37:12 1988
--- mit/util/scripts/bsdinst.sh	Sun Mar 24 18:36:16 1991
***************
*** 9,14 ****
--- 9,15 ----
  dst=""
  src=""
  dostrip=""
+ perms=""
  
  while [ x$1 != x ]; do
      case $1 in 
***************
*** 15,25 ****
  	-c) shift
  	    continue;;
  
! 	-[mog]) flags="$flags $1 $2 "
  	    shift
  	    shift
  	    continue;;
  
  	-s) dostrip="strip"
  	    shift
  	    continue;;
--- 16,31 ----
  	-c) shift
  	    continue;;
  
! 	-m) perms="$2"
  	    shift
  	    shift
  	    continue;;
  
+ 	-[og]) flags="$flags $1 $2 "
+ 	    shift
+ 	    shift
+ 	    continue;;
+ 
  	-s) dostrip="strip"
  	    shift
  	    continue;;
***************
*** 86,91 ****
--- 92,98 ----
  
  rm -f $dst/$srcbase
  (cd $srcdir ; install -f $dst $flags $src)
+ (cd $dst ; chmod $perms $src)
  
  
  # and clean up
*** mit.pl18.clean/config/ibm.cf	Sun Dec 17 17:05:49 1989
--- mit/config/ibm.cf	Sun Mar 24 18:36:17 1991
***************
*** 2,7 ****
--- 2,17 ----
   * SET VERSION NUMBERS BEFORE MAKING MAKEFILES
   */
  
+ /* It pains me to do it, but the following lines will hack the makefiles
+ 	to work on an RT running AIX 2.2.1 */
+ #define AIXArchitecture
+ #define RtArchitecture
+ #undef USE_PCC
+ #undef PS2Architecture
+ #define LibraryCDebugFlags 
+ #define DefaultCDebugFlags 
+ /* Michael Brantley, Rice University */
+ 
  #ifdef AIXArchitecture
  #ifdef RtArchitecture
  #define OSMajorVersion         2	/* RT AIX v2.2 */
***************
*** 28,33 ****
--- 38,44 ----
  #define HasNdbm NO
  #ifdef RtArchitecture
  #define OSDefines -DAIX -DAIXrt -DNO_FUNCTION_PROTOTYPES -DIBM_OS_HAS_HFT
+ #define AIXrt	YES	/* We need this for the Imakefile in ddx/ibm/AIX */
  #else
  #define OSDefines -DAIX -DAIX386 -DNO_FUNCTION_PROTOTYPES -DIBM_OS_HAS_HFT
  #define LdCombineFlags -r /* PS/2 doesn't do ld -X */
***************
*** 39,46 ****
  #define ibmosdefs -DHCVERSION=HCRevision
  #else
  #ifdef RtArchitecture
! #define CcCmd cc -Nd4000 -Nn3000 -DBSD_INCLUDES
! #define ibmosdefs -DSYSV -Nd4000 -Nn3000
  #else
  #define CcCmd cc -DBSD_INCLUDES -D_BSD
  #define ibmosdefs -DSYSV
--- 50,58 ----
  #define ibmosdefs -DHCVERSION=HCRevision
  #else
  #ifdef RtArchitecture
! #define CcCmd cc -Nd8000 -Nn5000 -DBSD_INCLUDES
! #define ibmosdefs -DSYSV -Nd8000 -Nn5000 -Dibm032
! #define ServerCCOptions -a
  #else
  #define CcCmd cc -DBSD_INCLUDES -D_BSD
  #define ibmosdefs -DSYSV
***************
*** 69,76 ****
   * Also, be sure to remove .../server/ddx/ibm/common/ibmscreen.o
   */
  #define ibmInclude8514  NO /* YES */
! #define ibmIncludeAED   YES
! #define ibmIncludeAPA16 YES
  #define ibmIncludeAPA8c NO
  #define ibmIncludeEGA   NO /* YES */
  #define ibmIncludeMPEL  YES
--- 81,88 ----
   * Also, be sure to remove .../server/ddx/ibm/common/ibmscreen.o
   */
  #define ibmInclude8514  NO /* YES */
! #define ibmIncludeAED   NO
! #define ibmIncludeAPA16 NO
  #define ibmIncludeAPA8c NO
  #define ibmIncludeEGA   NO /* YES */
  #define ibmIncludeMPEL  YES
***************
*** 191,197 ****
--- 203,213 ----
   * define this as you like for server compilation 
   * affected: all makefiles in .../X11/server
   */
+ #ifdef RtArchitecture
+ #define ServerDefines  StandardDefines -DUNIXCPP -DNOSTDHDRS OSDefines ExtensionDefines -Dibm032 -DXDMCP
+ #else
  #define ServerDefines  StandardDefines -DUNIXCPP -DNOSTDHDRS OSDefines ExtensionDefines
+ #endif /* RtArchitecture */
  
  
  /* define this as you like for server font support */
***************
*** 203,210 ****
  
  /* define the following line for easily debuggable servers, the */
  /* second line for especially speedy servers.			*/
! /* #define ServerCDebugFlags	-O -DDEBUG -DTRACE_X */
  #define	ServerCDebugFlags -O ibmAthenaDefs
  
  /* define this as you like for normal library compilation */
  #define LibraryDefines -DUNIXCPP ibmlibdefs StandardDefines
--- 219,235 ----
  
  /* define the following line for easily debuggable servers, the */
  /* second line for especially speedy servers.			*/
! /* #define ServerCDebugFlags	-DDEBUG -DTRACE_X */
! /* The AIX 2.2.1 C compiler cannot optimize the server properly ... sigh. */
! #ifdef AIXArchitecture
! #ifndef HIGH_C
! #define	ServerCDebugFlags ibmAthenaDefs
! #else
  #define	ServerCDebugFlags -O ibmAthenaDefs
+ #endif
+ #else
+ #define	ServerCDebugFlags -O ibmAthenaDefs
+ #endif
  
  /* define this as you like for normal library compilation */
  #define LibraryDefines -DUNIXCPP ibmlibdefs StandardDefines
*** mit.pl18.clean/config/Makefile.ini	Mon Oct 16 16:46:24 1989
--- mit/config/Makefile.ini	Sun Mar 24 18:36:17 1991
***************
*** 7,13 ****
  # any machine-specific preprocessor symbols.
  #
  
! BOOTSTRAPCFLAGS = 
      CDEBUGFLAGS = -O
           CFLAGS = $(BOOTSTRAPCFLAGS) $(CDEBUGFLAGS)
            SHELL = /bin/sh
--- 7,13 ----
  # any machine-specific preprocessor symbols.
  #
  
! BOOTSTRAPCFLAGS = -Daix
      CDEBUGFLAGS = -O
           CFLAGS = $(BOOTSTRAPCFLAGS) $(CDEBUGFLAGS)
            SHELL = /bin/sh
*** mit.pl18.clean/clients/xditview/libXdvi/Imakefile	Sat Jul 22 18:44:21 1989
--- mit/clients/xditview/libXdvi/Imakefile	Sun Mar 24 22:57:01 1991
***************
*** 1,7 ****
--- 1,9 ----
         INCLUDES = -I. -I$(TOOLKITSRC) -I$(TOP) -I$(TOP)/X11
         LINTLIBS = $(LINTXLIB) $(LINTXTOOL)
  #ifdef RtArchitecture
+ #ifndef AIXArchitecture
               CC = pcc
+ #endif
  #endif
  
  SRCS = \
*** mit.pl18.clean/demos/xgc/Imakefile      Wed Mar 27 14:01:38 1991
--- mit/demos/xgc/Imakefile   Wed Mar 27 13:57:45 1991
***************
*** 1,3 ****
--- 1,6 ----
+ #ifdef AIXArchitecture
+ CCOPTIONS = -a
+ #endif
          DEFINES =
             SRCS = dashlist.c planemask.c getfile.c tests.c text.c \
                    choice.c main.c interpret.c record.c testfrac.c



More information about the Comp.unix.aix mailing list