diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2012-02-06 21:00:24 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2012-02-06 21:00:24 +0000 |
commit | 1aafbe44c74b025faca3c4c91e6d90be4f7d4fe1 (patch) | |
tree | 7bc77021ba9fdd62c92760c007b93130887b8bd5 /AppKit/GTMNSBezierPath+RoundRectTest.m | |
parent | 754cbb4066c2682c8dec120f3d0550f84e326d3a (diff) |
[Author: thomasvl]
Always uses the first element of the array for the sizeof calc rather then
hard coding the type. Fixes an error with newer compiler where we did
sizeof(NSColor) instead of sizeof(NSColor*).
Fix warning about assignment of variable to itself.
R=dmaclach
DELTA=5 (0 added, 0 deleted, 5 changed)
Diffstat (limited to 'AppKit/GTMNSBezierPath+RoundRectTest.m')
-rw-r--r-- | AppKit/GTMNSBezierPath+RoundRectTest.m | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/AppKit/GTMNSBezierPath+RoundRectTest.m b/AppKit/GTMNSBezierPath+RoundRectTest.m index 101460c..69a0621 100644 --- a/AppKit/GTMNSBezierPath+RoundRectTest.m +++ b/AppKit/GTMNSBezierPath+RoundRectTest.m @@ -42,11 +42,11 @@ NSMakeRect(140.0, 10.0, 150.0, 30.0), //Large Test NSMakeRect(300.0, 10.0, 150.0, 30.0) //Large Test 2 (for different radius) }; - const NSUInteger theRectCount = sizeof(theRects) / sizeof(NSRect); + const NSUInteger theRectCount = sizeof(theRects) / sizeof(theRects[0]); // Line Width Tests CGFloat theLineWidths[] = { 0.5, 50.0, 2.0 }; - const NSUInteger theLineWidthCount = sizeof(theLineWidths) / sizeof(CGFloat); + const NSUInteger theLineWidthCount = sizeof(theLineWidths) / sizeof(theLineWidths[0]); NSUInteger i,j; for (i = 0; i < theLineWidthCount; ++i) { @@ -69,7 +69,7 @@ [NSColor colorWithCalibratedRed:1.0 green:0.0 blue:0.0 alpha:1.0], [NSColor colorWithCalibratedRed:0.2 green:0.4 blue:0.6 alpha:0.4] }; - const NSUInteger theColorCount = sizeof(theColors)/sizeof(NSColor); + const NSUInteger theColorCount = sizeof(theColors)/sizeof(theColors[0]); for (i = 0; i < theColorCount; ++i) { for (j = 0; j < theRectCount; ++j) { @@ -84,7 +84,7 @@ // Flatness test CGFloat theFlatness[] = {0.0, 0.1, 1.0, 10.0}; - const NSUInteger theFlatnessCount = sizeof(theFlatness)/sizeof(CGFloat); + const NSUInteger theFlatnessCount = sizeof(theFlatness)/sizeof(theFlatness[0]); for (i = 0; i < theFlatnessCount; i++) { for (j = 0; j < theRectCount; ++j) { |