Index: base/Headers/gnustep/base/NSGeometry.h
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/base/Headers/gnustep/base/NSGeometry.h,v
retrieving revision 1.19
diff -u -r1.19 NSGeometry.h
--- base/Headers/gnustep/base/NSGeometry.h	9 Nov 2002 06:45:31 -0000	1.19
+++ base/Headers/gnustep/base/NSGeometry.h	15 Nov 2002 08:19:37 -0000
@@ -110,11 +110,7 @@
 GS_GEOM_SCOPE NSPoint
 NSMakePoint(float x, float y)
 {
-  NSPoint point;
-
-  point.x = x;
-  point.y = y;
-  return point;
+  return (NSPoint){x, y};
 }
 
 /* Returns an NSSize having width WIDTH and height HEIGHT. */
@@ -124,11 +120,7 @@
 GS_GEOM_SCOPE NSSize
 NSMakeSize(float w, float h)
 {
-  NSSize size;
-
-  size.width = w;
-  size.height = h;
-  return size;
+  return (NSSize){w, h};
 }
 
 /* Returns an NSRect having point of origin (X, Y) and size {W, H}. */
@@ -138,13 +130,7 @@
 GS_GEOM_SCOPE NSRect
 NSMakeRect(float x, float y, float w, float h)
 {
-  NSRect rect;
-
-  rect.origin.x = x;
-  rect.origin.y = y;
-  rect.size.width = w;
-  rect.size.height = h;
-  return rect;
+  return (NSRect){{x, y}, {w, h}};
 }
 
 /** Get a Rectangle's Coordinates... **/
@@ -237,7 +223,7 @@
 GS_GEOM_SCOPE BOOL
 NSIsEmptyRect(NSRect aRect)
 {
-  return ((NSWidth(aRect) > 0) && (NSHeight(aRect) > 0)) ? NO : YES;
+  return ((aRect.size.width > 0) && (aRect.size.height > 0)) ? NO : YES;
 }
 
 /** Modify a Copy of a Rectangle... **/
@@ -250,11 +236,7 @@
 GS_GEOM_SCOPE NSRect
 NSOffsetRect(NSRect aRect, float dx, float dy)
 {
-  NSRect rect = aRect;
-
-  rect.origin.x += dx;
-  rect.origin.y += dy;
-  return rect;
+  return (NSRect){{aRect.origin.x + dx, aRect.origin.y + dy}, aRect.size};
 }
 
 /* Returns the rectangle obtained by moving each of ARECT's
@@ -266,12 +248,8 @@
 GS_GEOM_SCOPE NSRect
 NSInsetRect(NSRect aRect, float dX, float dY)
 {
-  NSRect rect;
-
-  rect = NSOffsetRect(aRect, dX, dY);
-  rect.size.width -= (2 * dX);
-  rect.size.height -= (2 * dY);
-  return rect;
+  return (NSRect){{aRect.origin.x + dX, aRect.origin.y + dY},
+	  {aRect.size.width - 2*dX, aRect.size.height - 2*dY}};
 }
 
 /* Divides ARECT into two rectangles (namely SLICE and REMAINDER) by
@@ -303,12 +281,13 @@
 NSUnionRect(NSRect aRect, NSRect bRect)
 {
   NSRect rect;
+  BOOL empty[2] = {NSIsEmptyRect(aRect), NSIsEmptyRect(bRect)};
 
-  if (NSIsEmptyRect(aRect) && NSIsEmptyRect(bRect))
-    return NSMakeRect(0.0,0.0,0.0,0.0);
-  else if (NSIsEmptyRect(aRect))
+  if (empty[0] && empty[1])
+	return NSMakeRect(0.0,0.0,0.0,0.0);
+  else if (empty[0])
     return bRect;
-  else if (NSIsEmptyRect(bRect))
+  else if (empty[1])
     return aRect;
 
   rect = NSMakeRect(MIN(NSMinX(aRect), NSMinX(bRect)),
@@ -406,31 +385,31 @@
 
 /* Returns 'YES' iff APOINT is inside ARECT. */ 
 GS_GEOM_SCOPE BOOL
+NSPointInRect(NSPoint aPoint, NSRect aRect) GS_GEOM_ATTR;
+
+GS_GEOM_SCOPE BOOL
+NSPointInRect(NSPoint aPoint, NSRect aRect)
+{
+  return ((aPoint.x >= NSMinX(aRect))
+          && (aPoint.y >= NSMinY(aRect))
+		  && (aPoint.x < NSMaxX(aRect))
+		  && (aPoint.y < NSMaxY(aRect))) ? YES : NO;
+}
+
+/* Just like 'NSPointInRect(aPoint, aRect)' but supports flipped Y axis coordinates. */
+GS_GEOM_SCOPE BOOL
 NSMouseInRect(NSPoint aPoint, NSRect aRect, BOOL flipped) GS_GEOM_ATTR;
 
 GS_GEOM_SCOPE BOOL
 NSMouseInRect(NSPoint aPoint, NSRect aRect, BOOL flipped)
 {
   if (flipped)
-    return ((aPoint.x >= NSMinX(aRect))
-            && (aPoint.y >= NSMinY(aRect))
-            && (aPoint.x < NSMaxX(aRect))
-            && (aPoint.y < NSMaxY(aRect))) ? YES : NO;
+    return NSPointInRect(aPoint, aRect);
   else
     return ((aPoint.x >= NSMinX(aRect))
             && (aPoint.y > NSMinY(aRect))
             && (aPoint.x < NSMaxX(aRect))
             && (aPoint.y <= NSMaxY(aRect))) ? YES : NO;
-}
-
-/* Just like 'NSMouseInRect(aPoint, aRect, YES)'. */
-GS_GEOM_SCOPE BOOL
-NSPointInRect(NSPoint aPoint, NSRect aRect) GS_GEOM_ATTR;
-
-GS_GEOM_SCOPE BOOL
-NSPointInRect(NSPoint aPoint, NSRect aRect)
-{
-  return NSMouseInRect(aPoint, aRect, YES);
 }
 
 /* Returns 'YES' iff ARECT totally encloses BRECT.  NOTE: For
