[comp.windows.x] X11 fix #37, server/dix/dispatch.c, FlushClientCaches now does

RWS@ZERMATT.LCS.MIT.EDU (Robert Scheifler) (10/28/87)

    Date: Thu, 22 Oct 87 09:42:56 PDT
    From: deboor%dill.Berkeley.EDU@berkeley.edu (Adam R de Boor)

    SYNOPSIS:
	    in server/dix/dispatch.c, function FlushClientCaches, there is a
	    == where there should be a =, thus preventing caches from being
	    flushed correctly.
    DESCRIPTION:
	    From the name of the function, I assume FlushClientCaches is supposed
	    to remove all references to a resource id from every active client's
	    cache, but the statement
		    if (client == clients[i])
	    restricts FlushClientCaches' attention to only the client that
	    owns the resource.
    FIX:
	While we're noticing, eliminate use of a magic number.

	in server/dix/dispatch.c:

*** /tmp/,RCSt1006770	Wed Oct 28 14:06:22 1987
--- dispatch.c	Wed Oct 28 14:00:26 1987
***************
*** 1,4 ****
! /* $Header: dispatch.c,v 1.18 87/10/15 11:34:40 rws Exp $ */
  /************************************************************
  Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
--- 1,4 ----
! /* $Header: dispatch.c,v 1.19 87/10/28 13:58:51 rws Exp $ */
  /************************************************************
  Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
***************
*** 147,153 ****
          if ((pGC->depth != pDraw->depth) || (pGC->pScreen != pDraw->pScreen))\
  	{\
              client->errorValue = stuff->gc;\
! 	    client->lastGCID = -1;\
  	    return (BadMatch);\
           }\
      }\
--- 147,153 ----
          if ((pGC->depth != pDraw->depth) || (pGC->pScreen != pDraw->pScreen))\
  	{\
              client->errorValue = stuff->gc;\
! 	    client->lastGCID = INVALID;\
  	    return (BadMatch);\
           }\
      }\
***************
*** 195,206 ****
          return ;
      for (i=0; i<currentMaxClients; i++)
      {
!         if (client == clients[i])
  	{
              if (client->lastDrawableID == id)
                  client->lastDrawableID = INVALID;
              else if (client->lastGCID == id)
!                 client->lastGCID = -1;
  	}
      }
  }
--- 195,207 ----
          return ;
      for (i=0; i<currentMaxClients; i++)
      {
! 	client = clients[i];
!         if (client != NullClient)
  	{
              if (client->lastDrawableID == id)
                  client->lastDrawableID = INVALID;
              else if (client->lastGCID == id)
!                 client->lastGCID = INVALID;
  	}
      }
  }
***************
*** 3048,3054 ****
      client->lastDrawable = (DrawablePtr) NULL;
      client->lastDrawableID = INVALID;
      client->lastGC = (GCPtr) NULL;
!     client->lastGCID = -1;
      client->numSaved = 0;
      client->saveSet = (pointer *)NULL;
      client->noClientException = Success;
--- 3049,3055 ----
      client->lastDrawable = (DrawablePtr) NULL;
      client->lastDrawableID = INVALID;
      client->lastGC = (GCPtr) NULL;
!     client->lastGCID = INVALID;
      client->numSaved = 0;
      client->saveSet = (pointer *)NULL;
      client->noClientException = Success;