Update Xregion to latest upstream
diff --git a/common/Xregion/Xregion.h b/common/Xregion/Xregion.h
index a9c977d..cf10f86 100644
--- a/common/Xregion/Xregion.h
+++ b/common/Xregion/Xregion.h
@@ -1,4 +1,3 @@
-/* $Xorg: region.h,v 1.4 2001/02/09 02:03:40 xorgcvs Exp $ */
 /************************************************************************
 
 Copyright 1987, 1998  The Open Group
@@ -28,13 +27,13 @@
 
                         All Rights Reserved
 
-Permission to use, copy, modify, and distribute this software and its 
-documentation for any purpose and without fee is hereby granted, 
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
 provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in 
+both that copyright notice and this permission notice appear in
 supporting documentation, and that the name of Digital not be
 used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.  
+software without specific, written prior permission.
 
 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
@@ -69,7 +68,7 @@
 #endif
 
 
-/* 
+/*
  *   clip region
  */
 
@@ -80,13 +79,13 @@
     BOX extents;
 } REGION;
 
-/* Xutil.h contains the declaration: 
- * typedef struct _XRegion *Region; 
- */   
+/* Xutil.h contains the declaration:
+ * typedef struct _XRegion *Region;
+ */
 
 /*  1 if two BOXs overlap.
  *  0 if two BOXs do not overlap.
- *  Remember, x2 and y2 are not in the region 
+ *  Remember, x2 and y2 are not in the region
  */
 #define EXTENTCHECK(r1, r2) \
 	((r1)->x2 > (r2)->x1 && \
@@ -113,10 +112,11 @@
  */
 #define MEMCHECK(reg, rect, firstrect){\
         if ((reg)->numRects >= ((reg)->size - 1)){\
-          (firstrect) = (BOX *) Xrealloc \
-          ((char *)(firstrect), (unsigned) (2 * (sizeof(BOX)) * ((reg)->size)));\
-          if ((firstrect) == 0)\
+          BoxPtr tmpRect = Xrealloc ((firstrect), \
+                                     (2 * (sizeof(BOX)) * ((reg)->size))); \
+          if (tmpRect == NULL) \
             return(0);\
+          (firstrect) = tmpRect; \
           (reg)->size *= 2;\
           (rect) = &(firstrect)[(reg)->numRects];\
          }\