[comp.windows.x] Possible bug in server code?

steveg@umd5.umd.edu (Steve Green) (01/07/90)

in server/ddx/mi/mispritest.h

		      . should this not be y1??
#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; } }

keith@EXPO.LCS.MIT.EDU (Keith Packard) (01/07/90)

> in server/ddx/mi/mispritest.h
> 
> 		      . should this not be y1??
> #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; } }

Yes it should.  Fortunately, if you examine the code which uses this macro,
the local variables holding the arguments are named (strangely enough)
x1,y1,x2,y2.  Furthermore, if you examine the preprocessor output, the code
ends up correct in spite of the apparent bug.  CPP strangeness!

Keith Packard
MIT X Consortium