remove unnecessary alloca

This commit is contained in:
Mitchell Livingston 2009-09-17 04:52:17 +00:00
parent d72a583163
commit 9c886b5d3e
3 changed files with 5 additions and 2 deletions

View File

@ -201,6 +201,7 @@
rect.origin = NSMakePoint(j * (fWidth + BETWEEN) + BETWEEN + fExtraBorder,
[image size].width - (i + 1) * (fWidth + BETWEEN) - fExtraBorder);
#warning use NSRectFillListWithColors
[pieceColor set];
NSRectFill(rect);
}

View File

@ -682,7 +682,7 @@
const CGFloat totalRowHeight = [self rowHeight] + [self intercellSpacing].height;
NSRect * gridRects = (NSRect *)alloca(sizeof(NSRect) * (ceil(visibleRect.size.height / totalRowHeight) / 2));
NSRect gridRects[(NSInteger)(ceil(visibleRect.size.height / totalRowHeight) / 2)];
NSInteger rectNum = 0;
if (rows.length > 0)
@ -729,6 +729,7 @@
visibleRect.size.height = totalRowHeight;
if (start)
visibleRect.origin.y += totalRowHeight;
for (NSInteger i = start ? 1 : 0; i < numberBlankRows; i += 2)
{
gridRects[rectNum++] = visibleRect;

View File

@ -46,7 +46,7 @@
const CGFloat totalRowHeight = [self rowHeight] + [self intercellSpacing].height;
NSRect * gridRects = (NSRect *)alloca(sizeof(NSRect) * (ceil(visibleRect.size.height / totalRowHeight) / 2));
NSRect gridRects[(NSInteger)(ceil(visibleRect.size.height / totalRowHeight) / 2)];
NSInteger rectNum = 0;
if (rows.length > 0)
@ -93,6 +93,7 @@
visibleRect.size.height = totalRowHeight;
if (start)
visibleRect.origin.y += totalRowHeight;
for (NSInteger i = start ? 1 : 0; i < numberBlankRows; i += 2)
{
gridRects[rectNum++] = visibleRect;