Skip to content

Commit b2e4e3c

Browse files
committed
Let's be consistent with CGFloat across the board
1 parent 9b50115 commit b2e4e3c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+139
-139
lines changed

Icon.png

6.81 KB
Loading

samples/TTCatalog/Classes/StyleTestController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ - (void)loadView {
157157

158158
nil];
159159

160-
CGFloat padding = 10;
160+
CGFloat padding = 10.0f;
161161
CGFloat viewWidth = scrollView.width/2 - padding*2;
162162
CGFloat viewHeight = TT_ROW_HEIGHT;
163163

src/Three20Network/Sources/TTURLCache.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#import "Three20Core/TTDebugFlags.h"
2727
#import "Three20Core/NSStringAdditions.h"
2828

29-
static const CGFloat kLargeImageSize = 600 * 400;
29+
static const CGFloat kLargeImageSize = 600.0f * 400.0f;
3030

3131
static NSString* kDefaultCacheName = @"Three20";
3232
static NSString* kEtagCacheDirectoryName = @"etag";

src/Three20Style/Sources/TTFlowLayout.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ @implementation TTFlowLayout
3535
///////////////////////////////////////////////////////////////////////////////////////////////////
3636
- (CGSize)layoutSubviews:(NSArray*)subviews forView:(UIView*)view {
3737
CGFloat x = _padding, y = _padding;
38-
CGFloat maxX = 0, rowHeight = 0;
38+
CGFloat maxX = 0.0f, rowHeight = 0.0f;
3939
CGFloat maxWidth = view.frame.size.width - _padding*2;
4040
for (UIView* subview in subviews) {
4141
if (x > _padding && x + subview.frame.size.width > maxWidth) {

src/Three20Style/Sources/TTGlobalStyle.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616

1717
#import "Three20Style/TTGlobalStyle.h"
1818

19-
const CGFloat ttkRounded = -1;
19+
const CGFloat ttkRounded = -1.0f;

src/Three20Style/Sources/TTGridLayout.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ - (id)init {
4848
- (CGSize)layoutSubviews:(NSArray*)subviews forView:(UIView*)view {
4949
CGFloat innerWidth = (view.frame.size.width - _padding*2);
5050
CGFloat width = ceil(innerWidth / _columnCount);
51-
CGFloat rowHeight = 0;
51+
CGFloat rowHeight = 0.0f;
5252

5353
CGFloat x = _padding, y = _padding;
54-
CGFloat maxX = 0, lastHeight = 0;
54+
CGFloat maxX = 0.0f, lastHeight = 0.0f;
5555
NSInteger column = 0;
5656
for (UIView* subview in subviews) {
5757
if (column % _columnCount == 0) {

src/Three20Style/Sources/TTRectangleShape.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ - (void)addInverseToPath:(CGRect)rect {
6464
CGFloat fw = rect.size.width;
6565
CGFloat fh = rect.size.height;
6666

67-
CGFloat width = 5;
67+
CGFloat width = 5.0f;
6868
CGRect shadowRect = CGRectMake(-width, -width, fw+width*2, fh+width*2);
6969
CGMutablePathRef path = CGPathCreateMutable();
7070
CGPathAddRect(path, nil, shadowRect);

src/Three20Style/Sources/TTRoundedRectangleShape.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ - (void)addInverseToPath:(CGRect)rect {
8989
CGFloat fw = rect.size.width;
9090
CGFloat fh = rect.size.height;
9191

92-
CGFloat width = 5;
92+
CGFloat width = 5.0f;
9393
CGRect shadowRect = CGRectMake(-width, -width, fw+width*2, fh+width*2);
9494
CGMutablePathRef path = CGPathCreateMutable();
9595
CGPathAddRect(path, nil, shadowRect);

src/Three20Style/Sources/TTShapeInternal.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616

1717
#import "Three20Style/private/TTShapeInternal.h"
1818

19-
const CGFloat kArrowPointWidth = 2.8;
20-
const CGFloat kArrowRadius = 2;
19+
const CGFloat kArrowPointWidth = 2.8f;
20+
const CGFloat kArrowRadius = 2.0f;
2121

src/Three20Style/Sources/TTSpeechBubbleShape.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// Style (private)
2020
#import "Three20Style/private/TTShapeInternal.h"
2121

22-
static const CGFloat kInsetWidth = 5;
22+
static const CGFloat kInsetWidth = 5.0f;
2323

2424

2525
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -59,8 +59,8 @@ + (TTSpeechBubbleShape*)shapeWithRadius:(CGFloat)radius pointLocation:(CGFloat)p
5959

6060
///////////////////////////////////////////////////////////////////////////////////////////////////
6161
- (CGRect)subtractPointFromRect:(CGRect)rect {
62-
CGFloat x = 0;
63-
CGFloat y = 0;
62+
CGFloat x = 0.0f;
63+
CGFloat y = 0.0f;
6464
CGFloat w = rect.size.width;
6565
CGFloat h = rect.size.height;
6666

@@ -97,7 +97,7 @@ - (void)addTopEdge:(CGSize)size lightSource:(NSInteger)lightSource toPath:(CGMut
9797
reset:(BOOL)reset {
9898
CGFloat fw = size.width;
9999
CGFloat fh = size.height;
100-
CGFloat pointX = 0;
100+
CGFloat pointX = 0.0f;
101101
CGFloat radius = RD(_radius);
102102

103103
if (lightSource >= 0 && lightSource <= 90) {
@@ -131,7 +131,7 @@ - (void)addRightEdge:(CGSize)size lightSource:(NSInteger)lightSource toPath:(CGM
131131
reset:(BOOL)reset {
132132
CGFloat fw = size.width;
133133
CGFloat fh = size.height;
134-
CGFloat pointY = 0;
134+
CGFloat pointY = 0.0f;
135135
CGFloat radius = RD(_radius);
136136

137137
if (reset) {
@@ -157,7 +157,7 @@ - (void)addBottomEdge:(CGSize)size lightSource:(NSInteger)lightSource toPath:(CG
157157
reset:(BOOL)reset {
158158
CGFloat fw = size.width;
159159
CGFloat fh = size.height;
160-
CGFloat pointX = 0;
160+
CGFloat pointX = 0.0f;
161161
CGFloat radius = RD(_radius);
162162

163163
if (reset) {
@@ -190,7 +190,7 @@ - (void)addBottomEdge:(CGSize)size lightSource:(NSInteger)lightSource toPath:(CG
190190
- (void)addLeftEdge:(CGSize)size lightSource:(NSInteger)lightSource toPath:(CGMutablePathRef)path
191191
reset:(BOOL)reset {
192192
CGFloat fh = size.height;
193-
CGFloat pointY = 0;
193+
CGFloat pointY = 0.0f;
194194
CGFloat radius = RD(_radius);
195195

196196
if (reset) {

src/Three20Style/Sources/TTStyledLayout.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ - (void)layoutText:(TTStyledTextNode*)textNode container:(TTStyledElement*)eleme
709709

710710
NSInteger stringIndex = 0;
711711
NSInteger lineStartIndex = 0;
712-
CGFloat frameWidth = 0;
712+
CGFloat frameWidth = 0.0f;
713713
NSInteger frameStart = 0;
714714

715715
while (stringIndex < length) {

src/Three20UI/Sources/TTActivityLabel.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
// Core
3333
#import "Three20Core/TTCorePreprocessorMacros.h"
3434

35-
static CGFloat kMargin = 10;
36-
static CGFloat kPadding = 15;
37-
static CGFloat kBannerPadding = 8;
38-
static CGFloat kSpacing = 6;
39-
static CGFloat kProgressMargin = 6;
35+
static CGFloat kMargin = 10.0f;
36+
static CGFloat kPadding = 15.0f;
37+
static CGFloat kBannerPadding = 8.0f;
38+
static CGFloat kSpacing = 6.0f;
39+
static CGFloat kProgressMargin = 6.0f;
4040

4141

4242
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -191,7 +191,7 @@ - (void)layoutSubviews {
191191

192192
CGSize textSize = [_label.text sizeWithFont:_label.font];
193193

194-
CGFloat indicatorSize = 0;
194+
CGFloat indicatorSize = 0.0f;
195195
[_activityIndicator sizeToFit];
196196
if (_activityIndicator.isAnimating) {
197197
if (_activityIndicator.height > textSize.height) {

src/Three20UI/Sources/TTButton.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
// Core
3636
#import "Three20Core/TTCorePreprocessorMacros.h"
3737

38-
static const CGFloat kHPadding = 8;
39-
static const CGFloat kVPadding = 7;
38+
static const CGFloat kHPadding = 8.0f;
39+
static const CGFloat kVPadding = 7.0f;
4040

4141

4242
///////////////////////////////////////////////////////////////////////////////////////////////////

src/Three20UI/Sources/TTButtonBar.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
// Core
2424
#import "Three20Core/TTCorePreprocessorMacros.h"
2525

26-
static CGFloat kPadding = 10;
27-
static CGFloat kButtonHeight = 30;
28-
static CGFloat kButtonMaxWidth = 120;
26+
static CGFloat kPadding = 10.0f;
27+
static CGFloat kButtonHeight = 30.0f;
28+
static CGFloat kButtonMaxWidth = 120.0f;
2929

3030

3131
///////////////////////////////////////////////////////////////////////////////////////////////////

src/Three20UI/Sources/TTErrorView.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
// Core
2727
#import "Three20Core/TTCorePreprocessorMacros.h"
2828

29-
static const CGFloat kVPadding1 = 30;
30-
static const CGFloat kVPadding2 = 20;
31-
static const CGFloat kHPadding = 10;
29+
static const CGFloat kVPadding1 = 30.0f;
30+
static const CGFloat kVPadding2 = 20.0f;
31+
static const CGFloat kHPadding = 10.0f;
3232

3333

3434
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -104,7 +104,7 @@ - (void)layoutSubviews {
104104
+ kVPadding1 + kVPadding2;
105105
BOOL canShowImage = _imageView.image && self.height > maxHeight;
106106

107-
CGFloat totalHeight = 0;
107+
CGFloat totalHeight = 0.0f;
108108

109109
if (canShowImage) {
110110
totalHeight += _imageView.height;

src/Three20UI/Sources/TTLauncherHighlightView.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ - (void)layoutLabel {
107107
constrainedToSize:CGSizeMake(width, superviewSize.height)].height;
108108

109109
// If the highlighted rect is above center, put the text below it; otherwise, above it.
110-
CGFloat y = 0.0;
110+
CGFloat y = 0.0f;
111111
if (_highlightRect.origin.y + (_highlightRect.size.height / 2) < superviewSize.height / 2) {
112112
y = _highlightRect.origin.y + _highlightRect.size.height + kHighlightTextPadding;
113113

src/Three20UI/Sources/TTLauncherView.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@
4343
#import "Three20Core/TTDebugFlags.h"
4444
#import "Three20Core/TTGlobalCoreRects.h"
4545

46-
static const CGFloat kMargin = 0;
47-
static const CGFloat kPadding = 0;
48-
static const CGFloat kPromptMargin = 40;
49-
static const CGFloat kPagerHeight = 20;
50-
static const CGFloat kWobbleRadians = 1.5;
51-
static const CGFloat kSpringLoadFraction = 0.18;
46+
static const CGFloat kMargin = 0.0f;
47+
static const CGFloat kPadding = 0.0f;
48+
static const CGFloat kPromptMargin = 40.0f;
49+
static const CGFloat kPagerHeight = 20.0f;
50+
static const CGFloat kWobbleRadians = 1.5f;
51+
static const CGFloat kSpringLoadFraction = 0.18f;
5252

5353
static const NSTimeInterval kEditHoldTimeInterval = 1;
5454
static const NSTimeInterval kSpringLoadTimeInterval = 0.5;
@@ -266,7 +266,7 @@ - (void)layoutButtons {
266266
CGFloat buttonHeight = [self rowHeight];
267267
CGFloat pageWidth = _scrollView.width;
268268

269-
CGFloat x = kMargin, minX = 0;
269+
CGFloat x = kMargin, minX = 0.0f;
270270
for (NSMutableArray* buttonPage in _buttons) {
271271
CGFloat y = kMargin;
272272
for (TTLauncherButton* button in buttonPage) {

src/Three20UI/Sources/TTMessageController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ - (void)createFieldViews {
168168

169169
///////////////////////////////////////////////////////////////////////////////////////////////////
170170
- (void)layoutViews {
171-
CGFloat y = 0;
171+
CGFloat y = 0.0f;
172172

173173
for (UIView* view in _scrollView.subviews) {
174174
view.frame = CGRectMake(0, y, self.view.width, view.height);

src/Three20UI/Sources/TTPageControl.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ - (CGSize)sizeThatFits:(CGSize)size {
135135
TTStyleContext* context = [[[TTStyleContext alloc] init] autorelease];
136136
CGSize dotSize = [self.normalDotStyle addToSize:CGSizeZero context:context];
137137

138-
CGFloat margin = 0;
138+
CGFloat margin = 0.0f;
139139
TTBoxStyle* boxStyle = [self.normalDotStyle firstStyleOfClass:[TTBoxStyle class]];
140140
if (boxStyle) {
141141
margin = boxStyle.margin.right + boxStyle.margin.left;

src/Three20UI/Sources/TTPhotoView.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ - (void)layoutSubviews {
185185
CGFloat height = self.height;
186186
CGFloat cx = self.bounds.origin.x + width/2;
187187
CGFloat cy = self.bounds.origin.y + height/2;
188-
CGFloat marginRight = 0, marginLeft = 0, marginBottom = TTToolbarHeight();
188+
CGFloat marginRight = 0.0f, marginLeft = 0.0f, marginBottom = TTToolbarHeight();
189189

190190
// Since the photo view is constrained to the size of the image, but we want to position
191191
// the status views relative to the screen, offset by the difference

src/Three20UI/Sources/TTPickerTextField.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
static NSString* kEmpty = @" ";
3333
static NSString* kSelected = @"`";
3434

35-
static const CGFloat kCellPaddingY = 3;
36-
static const CGFloat kPaddingX = 8;
37-
static const CGFloat kSpacingY = 6;
38-
static const CGFloat kPaddingRatio = 1.75;
39-
static const CGFloat kClearButtonSize = 38;
40-
static const CGFloat kMinCursorWidth = 50;
35+
static const CGFloat kCellPaddingY = 3.0f;
36+
static const CGFloat kPaddingX = 8.0f;
37+
static const CGFloat kSpacingY = 6.0f;
38+
static const CGFloat kPaddingRatio = 1.75f;
39+
static const CGFloat kClearButtonSize = 38.0f;
40+
static const CGFloat kMinCursorWidth = 50.0f;
4141

4242

4343
///////////////////////////////////////////////////////////////////////////////////////////////////

src/Three20UI/Sources/TTPickerViewCell.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
// Core
2424
#import "Three20Core/TTCorePreprocessorMacros.h"
2525

26-
static const CGFloat kPaddingX = 8;
27-
static const CGFloat kPaddingY = 3;
28-
static const CGFloat kMaxWidth = 250;
26+
static const CGFloat kPaddingX = 8.0f;
27+
static const CGFloat kPaddingY = 3.0f;
28+
static const CGFloat kMaxWidth = 250.0f;
2929

3030

3131
///////////////////////////////////////////////////////////////////////////////////////////////////

src/Three20UI/Sources/TTPostController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
#import "Three20Core/NSStringAdditions.h"
4141
#import "Three20Core/TTGlobalCore.h"
4242

43-
static const CGFloat kMarginX = 5;
44-
static const CGFloat kMarginY = 6;
43+
static const CGFloat kMarginX = 5.0f;
44+
static const CGFloat kMarginY = 6.0f;
4545

4646

4747
///////////////////////////////////////////////////////////////////////////////////////////////////

src/Three20UI/Sources/TTScrollView.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@
2828
#import "Three20Core/TTCorePreprocessorMacros.h"
2929

3030
static const NSInteger kOffscreenPages = 1;
31-
static const CGFloat kDefaultPageSpacing = 40.0;
32-
static const CGFloat kFlickThreshold = 60.0;
33-
static const CGFloat kTapZoom = 0.75;
34-
static const CGFloat kResistance = 0.15;
31+
static const CGFloat kDefaultPageSpacing = 40.0f;
32+
static const CGFloat kFlickThreshold = 60.0f;
33+
static const CGFloat kTapZoom = 0.75f;
34+
static const CGFloat kResistance = 0.15f;
3535
static const NSInteger kInvalidIndex = -1;
3636
static const NSTimeInterval kFlickDuration = 0.4;
3737
static const NSTimeInterval kBounceDuration = 0.3;
3838
static const NSTimeInterval kOvershoot = 2;
39-
static const CGFloat kIncreaseSpeed = 1.5; // How much increase after release touch.
39+
static const CGFloat kIncreaseSpeed = 1.5f; // How much increase after release touch.
4040
// (Residual movement).
41-
static const CGFloat kFrameDuration = 1.0/40.0;
41+
static const CGFloat kFrameDuration = 1.0/40.0f;
4242

4343
///////////////////////////////////////////////////////////////////////////////////////////////////
4444
///////////////////////////////////////////////////////////////////////////////////////////////////

src/Three20UI/Sources/TTSearchBar.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@
3434
#import "Three20Core/TTCorePreprocessorMacros.h"
3535
#import "Three20Core/TTGlobalCoreLocale.h"
3636

37-
static const CGFloat kMarginX = 5;
38-
static const CGFloat kMarginY = 7;
39-
static const CGFloat kPaddingX = 10;
40-
static const CGFloat kPaddingY = 10;
41-
static const CGFloat kSpacingX = 4;
37+
static const CGFloat kMarginX = 5.0f;
38+
static const CGFloat kMarginY = 7.0f;
39+
static const CGFloat kPaddingX = 10.0f;
40+
static const CGFloat kPaddingY = 10.0f;
41+
static const CGFloat kSpacingX = 4.0f;
4242

43-
static const CGFloat kButtonSpacing = 12;
44-
static const CGFloat kButtonHeight = 30;
43+
static const CGFloat kButtonSpacing = 12.0f;
44+
static const CGFloat kButtonHeight = 30.0f;
4545

46-
static const CGFloat kIndexViewMargin = 4;
46+
static const CGFloat kIndexViewMargin = 4.0f;
4747

4848
///////////////////////////////////////////////////////////////////////////////////////////////////
4949
///////////////////////////////////////////////////////////////////////////////////////////////////

src/Three20UI/Sources/TTSearchTextField.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
// Core
4242
#import "Three20Core/TTCorePreprocessorMacros.h"
4343

44-
static const CGFloat kShadowHeight = 24;
45-
static const CGFloat kDesiredTableHeight = 150;
44+
static const CGFloat kShadowHeight = 24.0f;
45+
static const CGFloat kDesiredTableHeight = 150.0f;
4646

4747
///////////////////////////////////////////////////////////////////////////////////////////////////
4848
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -472,7 +472,7 @@ - (UIView*)superviewForSearchResults {
472472
- (CGRect)rectForSearchResults:(BOOL)withKeyboard {
473473
UIView* superview = self.superviewForSearchResults;
474474

475-
CGFloat y = 0;
475+
CGFloat y = 0.0f;
476476
UIView* view = self;
477477
while (view != superview) {
478478
y += view.top;

0 commit comments

Comments
 (0)