--- a/Rectangle.st Thu Jan 29 14:18:50 2004 +0100
+++ b/Rectangle.st Thu Jan 29 14:21:27 2004 +0100
@@ -146,30 +146,32 @@
OBJ t;
int spc;
- if (__CanDoQuickNew(OHDR_SIZE + 4*sizeof(OBJ))) { /* OBJECT ALLOCATION */
- if (self == Rectangle) {
- /*
- * short cut - rectangles are created so often ...
- */
- __qCheckedAlignedNew(newRect, OHDR_SIZE + 4*sizeof(OBJ));
+ if (__CanDoQuickNew(OHDR_SIZE + 4*sizeof(OBJ))) { /* OBJECT ALLOCATION */
+ if (self == Rectangle) {
+ /*
+ * short cut - rectangles are created so often ...
+ */
+ __qCheckedAlignedNew(newRect, OHDR_SIZE + 4*sizeof(OBJ));
+
+ __InstPtr(newRect)->o_class = Rectangle;
+ __qSTORE(newRect, Rectangle);
- __InstPtr(newRect)->o_class = Rectangle;
- __InstPtr(newRect)->i_instvars[0] = left;
- __InstPtr(newRect)->i_instvars[1] = top;
- __InstPtr(newRect)->i_instvars[2] = w;
- __InstPtr(newRect)->i_instvars[3] = h;
+ __InstPtr(newRect)->i_instvars[0] = left;
+ __InstPtr(newRect)->i_instvars[1] = top;
+ __InstPtr(newRect)->i_instvars[2] = w;
+ __InstPtr(newRect)->i_instvars[3] = h;
- if (! (__bothSmallInteger(left, top) &&
- __bothSmallInteger(w, h))) {
- spc = __qSpace(newRect);
- __STORE_SPC(newRect, left, spc);
- __STORE_SPC(newRect, top, spc);
- __STORE_SPC(newRect, w, spc);
- __STORE_SPC(newRect, h, spc);
- }
+ if (! (__bothSmallInteger(left, top) &&
+ __bothSmallInteger(w, h))) {
+ spc = __qSpace(newRect);
+ __STORE_SPC(newRect, left, spc);
+ __STORE_SPC(newRect, top, spc);
+ __STORE_SPC(newRect, w, spc);
+ __STORE_SPC(newRect, h, spc);
+ }
- RETURN ( newRect );
- }
+ RETURN ( newRect );
+ }
}
%}.
^ (self basicNew) left:left top:top width:w height:h
@@ -208,34 +210,35 @@
OBJ t;
int spc;
- if (__CanDoQuickNew(OHDR_SIZE + 4*sizeof(OBJ))) { /* OBJECT ALLOCATION */
+ if (__CanDoQuickNew(OHDR_SIZE + 4*sizeof(OBJ))) { /* OBJECT ALLOCATION */
/*
- * short cut - rectangles are created so often ...
- */
- if (self == Rectangle) {
- if (__isPoint(origin) && __isPoint(extent)) {
- __qCheckedAlignedNew(newRect, OHDR_SIZE + 4*sizeof(OBJ));
- __InstPtr(newRect)->o_class = Rectangle;
- spc = __qSpace(newRect);
+ * short cut - rectangles are created so often ...
+ */
+ if (self == Rectangle) {
+ if (__isPoint(origin) && __isPoint(extent)) {
+ __qCheckedAlignedNew(newRect, OHDR_SIZE + 4*sizeof(OBJ));
+ __InstPtr(newRect)->o_class = Rectangle;
+ __qSTORE(newRect, Rectangle);
+ spc = __qSpace(newRect);
- t = __PointInstPtr(origin)->p_x;
- __InstPtr(newRect)->i_instvars[0] = t;
- __STORE_SPC(newRect, t, spc);
+ t = __PointInstPtr(origin)->p_x;
+ __InstPtr(newRect)->i_instvars[0] = t;
+ __STORE_SPC(newRect, t, spc);
- t = __PointInstPtr(origin)->p_y;
- __InstPtr(newRect)->i_instvars[1] = t;
- __STORE_SPC(newRect, t, spc);
+ t = __PointInstPtr(origin)->p_y;
+ __InstPtr(newRect)->i_instvars[1] = t;
+ __STORE_SPC(newRect, t, spc);
- t = __PointInstPtr(extent)->p_x;
- __InstPtr(newRect)->i_instvars[2] = t;
- __STORE_SPC(newRect, t, spc);
+ t = __PointInstPtr(extent)->p_x;
+ __InstPtr(newRect)->i_instvars[2] = t;
+ __STORE_SPC(newRect, t, spc);
- t = __PointInstPtr(extent)->p_y;
- __InstPtr(newRect)->i_instvars[3] = t;
- __STORE_SPC(newRect, t, spc);
- RETURN ( newRect );
- }
- }
+ t = __PointInstPtr(extent)->p_y;
+ __InstPtr(newRect)->i_instvars[3] = t;
+ __STORE_SPC(newRect, t, spc);
+ RETURN ( newRect );
+ }
+ }
}
%}.
^ (self basicNew) origin:origin extent:extent
@@ -1774,5 +1777,5 @@
!Rectangle class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Rectangle.st,v 1.77 2003-08-29 17:32:04 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Rectangle.st,v 1.78 2004-01-29 13:20:00 stefan Exp $'
! !