]> granicus.if.org Git - transmission/commitdiff
remove unnecessary alloca
authorMitchell Livingston <livings124@transmissionbt.com>
Thu, 17 Sep 2009 04:52:17 +0000 (04:52 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Thu, 17 Sep 2009 04:52:17 +0000 (04:52 +0000)
macosx/PiecesView.m
macosx/TorrentTableView.m
macosx/TrackerTableView.m

index 286be08c6f0152a28a7b05d5265ff91e821b90c4..f1c397af11c4132aa34bc8941802c98bfafd61c4 100644 (file)
                 rect.origin = NSMakePoint(j * (fWidth + BETWEEN) + BETWEEN + fExtraBorder,
                                         [image size].width - (i + 1) * (fWidth + BETWEEN) - fExtraBorder);
                 
+                #warning use NSRectFillListWithColors
                 [pieceColor set];
                 NSRectFill(rect);
             }
index c44097a5ed43aaa6fb9c57583512af34ff457346..a3fcf208d77f39a8d31e05dde62da10ed66fd864 100644 (file)
     
     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)
     visibleRect.size.height = totalRowHeight;
     if (start)
         visibleRect.origin.y += totalRowHeight;
+    
     for (NSInteger i = start ? 1 : 0; i < numberBlankRows; i += 2)
     {
         gridRects[rectNum++] = visibleRect;
index 9c625adeb99e54a0224315bdd52fcbde27b40e6e..704ae9b8557496f977aac345e0fba74906340728 100644 (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;