Permalink
Browse files

Let's be consistent with CGFloat across the board

  • Loading branch information...
1 parent 9b50115 commit b2e4e3c89f0c02b136b2f17193d7d9ce427c8484 @jwang jwang committed Aug 19, 2011
Showing with 139 additions and 139 deletions.
  1. BIN Icon.png
  2. +1 −1 samples/TTCatalog/Classes/StyleTestController.m
  3. +1 −1 src/Three20Network/Sources/TTURLCache.m
  4. +1 −1 src/Three20Style/Sources/TTFlowLayout.m
  5. +1 −1 src/Three20Style/Sources/TTGlobalStyle.m
  6. +2 −2 src/Three20Style/Sources/TTGridLayout.m
  7. +1 −1 src/Three20Style/Sources/TTRectangleShape.m
  8. +1 −1 src/Three20Style/Sources/TTRoundedRectangleShape.m
  9. +2 −2 src/Three20Style/Sources/TTShapeInternal.m
  10. +7 −7 src/Three20Style/Sources/TTSpeechBubbleShape.m
  11. +1 −1 src/Three20Style/Sources/TTStyledLayout.m
  12. +6 −6 src/Three20UI/Sources/TTActivityLabel.m
  13. +2 −2 src/Three20UI/Sources/TTButton.m
  14. +3 −3 src/Three20UI/Sources/TTButtonBar.m
  15. +4 −4 src/Three20UI/Sources/TTErrorView.m
  16. +1 −1 src/Three20UI/Sources/TTLauncherHighlightView.m
  17. +7 −7 src/Three20UI/Sources/TTLauncherView.m
  18. +1 −1 src/Three20UI/Sources/TTMessageController.m
  19. +1 −1 src/Three20UI/Sources/TTPageControl.m
  20. +1 −1 src/Three20UI/Sources/TTPhotoView.m
  21. +6 −6 src/Three20UI/Sources/TTPickerTextField.m
  22. +3 −3 src/Three20UI/Sources/TTPickerViewCell.m
  23. +2 −2 src/Three20UI/Sources/TTPostController.m
  24. +6 −6 src/Three20UI/Sources/TTScrollView.m
  25. +8 −8 src/Three20UI/Sources/TTSearchBar.m
  26. +3 −3 src/Three20UI/Sources/TTSearchTextField.m
  27. +2 −2 src/Three20UI/Sources/TTSearchlightLabel.m
  28. +1 −1 src/Three20UI/Sources/TTStyledTextLabel.m
  29. +1 −1 src/Three20UI/Sources/TTStyledTextTableItemCell.m
  30. +5 −5 src/Three20UI/Sources/TTTabBarInternal.m
  31. +2 −2 src/Three20UI/Sources/TTTableCaptionItemCell.m
  32. +2 −2 src/Three20UI/Sources/TTTableControlCell.m
  33. +1 −1 src/Three20UI/Sources/TTTableFooterInfiniteScrollView.m
  34. +2 −2 src/Three20UI/Sources/TTTableImageItemCell.m
  35. +3 −3 src/Three20UI/Sources/TTTableMessageItemCell.m
  36. +1 −1 src/Three20UI/Sources/TTTableMoreButtonCell.m
  37. +1 −1 src/Three20UI/Sources/TTTableSubtitleItemCell.m
  38. +1 −1 src/Three20UI/Sources/TTTableTextItemCell.m
  39. +3 −3 src/Three20UI/Sources/TTTableView.m
  40. +5 −5 src/Three20UI/Sources/TTTableViewCell.m
  41. +4 −4 src/Three20UI/Sources/TTTableViewDelegate.m
  42. +2 −2 src/Three20UI/Sources/TTTableViewGroupedVarHeightDelegate.m
  43. +1 −1 src/Three20UI/Sources/TTTableViewNetworkEnabledDelegate.m
  44. +2 −2 src/Three20UI/Sources/TTTextBarController.m
  45. +4 −4 src/Three20UI/Sources/TTTextEditor.m
  46. +2 −2 src/Three20UI/Sources/TTThumbsDataSource.m
  47. +2 −2 src/Three20UI/Sources/TTThumbsTableViewCell.m
  48. +1 −1 src/Three20UI/Sources/TTThumbsViewController.m
  49. +2 −2 src/Three20UI/Sources/TTYouTubeView.m
  50. +4 −4 src/Three20UI/Sources/UIViewAdditions.m
  51. +13 −13 src/Three20UICommon/Sources/TTGlobalUICommon.m
View
BIN Icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -157,7 +157,7 @@ - (void)loadView {
nil];
- CGFloat padding = 10;
+ CGFloat padding = 10.0f;
CGFloat viewWidth = scrollView.width/2 - padding*2;
CGFloat viewHeight = TT_ROW_HEIGHT;
@@ -26,7 +26,7 @@
#import "Three20Core/TTDebugFlags.h"
#import "Three20Core/NSStringAdditions.h"
-static const CGFloat kLargeImageSize = 600 * 400;
+static const CGFloat kLargeImageSize = 600.0f * 400.0f;
static NSString* kDefaultCacheName = @"Three20";
static NSString* kEtagCacheDirectoryName = @"etag";
@@ -35,7 +35,7 @@ @implementation TTFlowLayout
///////////////////////////////////////////////////////////////////////////////////////////////////
- (CGSize)layoutSubviews:(NSArray*)subviews forView:(UIView*)view {
CGFloat x = _padding, y = _padding;
- CGFloat maxX = 0, rowHeight = 0;
+ CGFloat maxX = 0.0f, rowHeight = 0.0f;
CGFloat maxWidth = view.frame.size.width - _padding*2;
for (UIView* subview in subviews) {
if (x > _padding && x + subview.frame.size.width > maxWidth) {
@@ -16,4 +16,4 @@
#import "Three20Style/TTGlobalStyle.h"
-const CGFloat ttkRounded = -1;
+const CGFloat ttkRounded = -1.0f;
@@ -48,10 +48,10 @@ - (id)init {
- (CGSize)layoutSubviews:(NSArray*)subviews forView:(UIView*)view {
CGFloat innerWidth = (view.frame.size.width - _padding*2);
CGFloat width = ceil(innerWidth / _columnCount);
- CGFloat rowHeight = 0;
+ CGFloat rowHeight = 0.0f;
CGFloat x = _padding, y = _padding;
- CGFloat maxX = 0, lastHeight = 0;
+ CGFloat maxX = 0.0f, lastHeight = 0.0f;
NSInteger column = 0;
for (UIView* subview in subviews) {
if (column % _columnCount == 0) {
@@ -64,7 +64,7 @@ - (void)addInverseToPath:(CGRect)rect {
CGFloat fw = rect.size.width;
CGFloat fh = rect.size.height;
- CGFloat width = 5;
+ CGFloat width = 5.0f;
CGRect shadowRect = CGRectMake(-width, -width, fw+width*2, fh+width*2);
CGMutablePathRef path = CGPathCreateMutable();
CGPathAddRect(path, nil, shadowRect);
@@ -89,7 +89,7 @@ - (void)addInverseToPath:(CGRect)rect {
CGFloat fw = rect.size.width;
CGFloat fh = rect.size.height;
- CGFloat width = 5;
+ CGFloat width = 5.0f;
CGRect shadowRect = CGRectMake(-width, -width, fw+width*2, fh+width*2);
CGMutablePathRef path = CGPathCreateMutable();
CGPathAddRect(path, nil, shadowRect);
@@ -16,6 +16,6 @@
#import "Three20Style/private/TTShapeInternal.h"
-const CGFloat kArrowPointWidth = 2.8;
-const CGFloat kArrowRadius = 2;
+const CGFloat kArrowPointWidth = 2.8f;
+const CGFloat kArrowRadius = 2.0f;
@@ -19,7 +19,7 @@
// Style (private)
#import "Three20Style/private/TTShapeInternal.h"
-static const CGFloat kInsetWidth = 5;
+static const CGFloat kInsetWidth = 5.0f;
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -59,8 +59,8 @@ + (TTSpeechBubbleShape*)shapeWithRadius:(CGFloat)radius pointLocation:(CGFloat)p
///////////////////////////////////////////////////////////////////////////////////////////////////
- (CGRect)subtractPointFromRect:(CGRect)rect {
- CGFloat x = 0;
- CGFloat y = 0;
+ CGFloat x = 0.0f;
+ CGFloat y = 0.0f;
CGFloat w = rect.size.width;
CGFloat h = rect.size.height;
@@ -97,7 +97,7 @@ - (void)addTopEdge:(CGSize)size lightSource:(NSInteger)lightSource toPath:(CGMut
reset:(BOOL)reset {
CGFloat fw = size.width;
CGFloat fh = size.height;
- CGFloat pointX = 0;
+ CGFloat pointX = 0.0f;
CGFloat radius = RD(_radius);
if (lightSource >= 0 && lightSource <= 90) {
@@ -131,7 +131,7 @@ - (void)addRightEdge:(CGSize)size lightSource:(NSInteger)lightSource toPath:(CGM
reset:(BOOL)reset {
CGFloat fw = size.width;
CGFloat fh = size.height;
- CGFloat pointY = 0;
+ CGFloat pointY = 0.0f;
CGFloat radius = RD(_radius);
if (reset) {
@@ -157,7 +157,7 @@ - (void)addBottomEdge:(CGSize)size lightSource:(NSInteger)lightSource toPath:(CG
reset:(BOOL)reset {
CGFloat fw = size.width;
CGFloat fh = size.height;
- CGFloat pointX = 0;
+ CGFloat pointX = 0.0f;
CGFloat radius = RD(_radius);
if (reset) {
@@ -190,7 +190,7 @@ - (void)addBottomEdge:(CGSize)size lightSource:(NSInteger)lightSource toPath:(CG
- (void)addLeftEdge:(CGSize)size lightSource:(NSInteger)lightSource toPath:(CGMutablePathRef)path
reset:(BOOL)reset {
CGFloat fh = size.height;
- CGFloat pointY = 0;
+ CGFloat pointY = 0.0f;
CGFloat radius = RD(_radius);
if (reset) {
@@ -709,7 +709,7 @@ - (void)layoutText:(TTStyledTextNode*)textNode container:(TTStyledElement*)eleme
NSInteger stringIndex = 0;
NSInteger lineStartIndex = 0;
- CGFloat frameWidth = 0;
+ CGFloat frameWidth = 0.0f;
NSInteger frameStart = 0;
while (stringIndex < length) {
@@ -32,11 +32,11 @@
// Core
#import "Three20Core/TTCorePreprocessorMacros.h"
-static CGFloat kMargin = 10;
-static CGFloat kPadding = 15;
-static CGFloat kBannerPadding = 8;
-static CGFloat kSpacing = 6;
-static CGFloat kProgressMargin = 6;
+static CGFloat kMargin = 10.0f;
+static CGFloat kPadding = 15.0f;
+static CGFloat kBannerPadding = 8.0f;
+static CGFloat kSpacing = 6.0f;
+static CGFloat kProgressMargin = 6.0f;
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -191,7 +191,7 @@ - (void)layoutSubviews {
CGSize textSize = [_label.text sizeWithFont:_label.font];
- CGFloat indicatorSize = 0;
+ CGFloat indicatorSize = 0.0f;
[_activityIndicator sizeToFit];
if (_activityIndicator.isAnimating) {
if (_activityIndicator.height > textSize.height) {
@@ -35,8 +35,8 @@
// Core
#import "Three20Core/TTCorePreprocessorMacros.h"
-static const CGFloat kHPadding = 8;
-static const CGFloat kVPadding = 7;
+static const CGFloat kHPadding = 8.0f;
+static const CGFloat kVPadding = 7.0f;
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -23,9 +23,9 @@
// Core
#import "Three20Core/TTCorePreprocessorMacros.h"
-static CGFloat kPadding = 10;
-static CGFloat kButtonHeight = 30;
-static CGFloat kButtonMaxWidth = 120;
+static CGFloat kPadding = 10.0f;
+static CGFloat kButtonHeight = 30.0f;
+static CGFloat kButtonMaxWidth = 120.0f;
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -26,9 +26,9 @@
// Core
#import "Three20Core/TTCorePreprocessorMacros.h"
-static const CGFloat kVPadding1 = 30;
-static const CGFloat kVPadding2 = 20;
-static const CGFloat kHPadding = 10;
+static const CGFloat kVPadding1 = 30.0f;
+static const CGFloat kVPadding2 = 20.0f;
+static const CGFloat kHPadding = 10.0f;
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -104,7 +104,7 @@ - (void)layoutSubviews {
+ kVPadding1 + kVPadding2;
BOOL canShowImage = _imageView.image && self.height > maxHeight;
- CGFloat totalHeight = 0;
+ CGFloat totalHeight = 0.0f;
if (canShowImage) {
totalHeight += _imageView.height;
@@ -107,7 +107,7 @@ - (void)layoutLabel {
constrainedToSize:CGSizeMake(width, superviewSize.height)].height;
// If the highlighted rect is above center, put the text below it; otherwise, above it.
- CGFloat y = 0.0;
+ CGFloat y = 0.0f;
if (_highlightRect.origin.y + (_highlightRect.size.height / 2) < superviewSize.height / 2) {
y = _highlightRect.origin.y + _highlightRect.size.height + kHighlightTextPadding;
@@ -43,12 +43,12 @@
#import "Three20Core/TTDebugFlags.h"
#import "Three20Core/TTGlobalCoreRects.h"
-static const CGFloat kMargin = 0;
-static const CGFloat kPadding = 0;
-static const CGFloat kPromptMargin = 40;
-static const CGFloat kPagerHeight = 20;
-static const CGFloat kWobbleRadians = 1.5;
-static const CGFloat kSpringLoadFraction = 0.18;
+static const CGFloat kMargin = 0.0f;
+static const CGFloat kPadding = 0.0f;
+static const CGFloat kPromptMargin = 40.0f;
+static const CGFloat kPagerHeight = 20.0f;
+static const CGFloat kWobbleRadians = 1.5f;
+static const CGFloat kSpringLoadFraction = 0.18f;
static const NSTimeInterval kEditHoldTimeInterval = 1;
static const NSTimeInterval kSpringLoadTimeInterval = 0.5;
@@ -266,7 +266,7 @@ - (void)layoutButtons {
CGFloat buttonHeight = [self rowHeight];
CGFloat pageWidth = _scrollView.width;
- CGFloat x = kMargin, minX = 0;
+ CGFloat x = kMargin, minX = 0.0f;
for (NSMutableArray* buttonPage in _buttons) {
CGFloat y = kMargin;
for (TTLauncherButton* button in buttonPage) {
@@ -168,7 +168,7 @@ - (void)createFieldViews {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)layoutViews {
- CGFloat y = 0;
+ CGFloat y = 0.0f;
for (UIView* view in _scrollView.subviews) {
view.frame = CGRectMake(0, y, self.view.width, view.height);
@@ -135,7 +135,7 @@ - (CGSize)sizeThatFits:(CGSize)size {
TTStyleContext* context = [[[TTStyleContext alloc] init] autorelease];
CGSize dotSize = [self.normalDotStyle addToSize:CGSizeZero context:context];
- CGFloat margin = 0;
+ CGFloat margin = 0.0f;
TTBoxStyle* boxStyle = [self.normalDotStyle firstStyleOfClass:[TTBoxStyle class]];
if (boxStyle) {
margin = boxStyle.margin.right + boxStyle.margin.left;
@@ -185,7 +185,7 @@ - (void)layoutSubviews {
CGFloat height = self.height;
CGFloat cx = self.bounds.origin.x + width/2;
CGFloat cy = self.bounds.origin.y + height/2;
- CGFloat marginRight = 0, marginLeft = 0, marginBottom = TTToolbarHeight();
+ CGFloat marginRight = 0.0f, marginLeft = 0.0f, marginBottom = TTToolbarHeight();
// Since the photo view is constrained to the size of the image, but we want to position
// the status views relative to the screen, offset by the difference
@@ -32,12 +32,12 @@
static NSString* kEmpty = @" ";
static NSString* kSelected = @"`";
-static const CGFloat kCellPaddingY = 3;
-static const CGFloat kPaddingX = 8;
-static const CGFloat kSpacingY = 6;
-static const CGFloat kPaddingRatio = 1.75;
-static const CGFloat kClearButtonSize = 38;
-static const CGFloat kMinCursorWidth = 50;
+static const CGFloat kCellPaddingY = 3.0f;
+static const CGFloat kPaddingX = 8.0f;
+static const CGFloat kSpacingY = 6.0f;
+static const CGFloat kPaddingRatio = 1.75f;
+static const CGFloat kClearButtonSize = 38.0f;
+static const CGFloat kMinCursorWidth = 50.0f;
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -23,9 +23,9 @@
// Core
#import "Three20Core/TTCorePreprocessorMacros.h"
-static const CGFloat kPaddingX = 8;
-static const CGFloat kPaddingY = 3;
-static const CGFloat kMaxWidth = 250;
+static const CGFloat kPaddingX = 8.0f;
+static const CGFloat kPaddingY = 3.0f;
+static const CGFloat kMaxWidth = 250.0f;
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -40,8 +40,8 @@
#import "Three20Core/NSStringAdditions.h"
#import "Three20Core/TTGlobalCore.h"
-static const CGFloat kMarginX = 5;
-static const CGFloat kMarginY = 6;
+static const CGFloat kMarginX = 5.0f;
+static const CGFloat kMarginY = 6.0f;
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -28,17 +28,17 @@
#import "Three20Core/TTCorePreprocessorMacros.h"
static const NSInteger kOffscreenPages = 1;
-static const CGFloat kDefaultPageSpacing = 40.0;
-static const CGFloat kFlickThreshold = 60.0;
-static const CGFloat kTapZoom = 0.75;
-static const CGFloat kResistance = 0.15;
+static const CGFloat kDefaultPageSpacing = 40.0f;
+static const CGFloat kFlickThreshold = 60.0f;
+static const CGFloat kTapZoom = 0.75f;
+static const CGFloat kResistance = 0.15f;
static const NSInteger kInvalidIndex = -1;
static const NSTimeInterval kFlickDuration = 0.4;
static const NSTimeInterval kBounceDuration = 0.3;
static const NSTimeInterval kOvershoot = 2;
-static const CGFloat kIncreaseSpeed = 1.5; // How much increase after release touch.
+static const CGFloat kIncreaseSpeed = 1.5f; // How much increase after release touch.
// (Residual movement).
-static const CGFloat kFrameDuration = 1.0/40.0;
+static const CGFloat kFrameDuration = 1.0/40.0f;
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -34,16 +34,16 @@
#import "Three20Core/TTCorePreprocessorMacros.h"
#import "Three20Core/TTGlobalCoreLocale.h"
-static const CGFloat kMarginX = 5;
-static const CGFloat kMarginY = 7;
-static const CGFloat kPaddingX = 10;
-static const CGFloat kPaddingY = 10;
-static const CGFloat kSpacingX = 4;
+static const CGFloat kMarginX = 5.0f;
+static const CGFloat kMarginY = 7.0f;
+static const CGFloat kPaddingX = 10.0f;
+static const CGFloat kPaddingY = 10.0f;
+static const CGFloat kSpacingX = 4.0f;
-static const CGFloat kButtonSpacing = 12;
-static const CGFloat kButtonHeight = 30;
+static const CGFloat kButtonSpacing = 12.0f;
+static const CGFloat kButtonHeight = 30.0f;
-static const CGFloat kIndexViewMargin = 4;
+static const CGFloat kIndexViewMargin = 4.0f;
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -41,8 +41,8 @@
// Core
#import "Three20Core/TTCorePreprocessorMacros.h"
-static const CGFloat kShadowHeight = 24;
-static const CGFloat kDesiredTableHeight = 150;
+static const CGFloat kShadowHeight = 24.0f;
+static const CGFloat kDesiredTableHeight = 150.0f;
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -472,7 +472,7 @@ - (UIView*)superviewForSearchResults {
- (CGRect)rectForSearchResults:(BOOL)withKeyboard {
UIView* superview = self.superviewForSearchResults;
- CGFloat y = 0;
+ CGFloat y = 0.0f;
UIView* view = self;
while (view != superview) {
y += view.top;
Oops, something went wrong.

0 comments on commit b2e4e3c

Please sign in to comment.