Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CGPointNull] Rename globally exported C function to avoid collisions #trivial #62

Merged
merged 3 commits into from
Apr 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Source/Layout/ASLayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ NS_ASSUME_NONNULL_BEGIN

ASDISPLAYNODE_EXTERN_C_BEGIN

extern CGPoint const CGPointNull;
extern CGPoint const ASPointNull; // {NAN, NAN}

extern BOOL CGPointIsNull(CGPoint point);
extern BOOL ASPointIsNull(CGPoint point);

/**
* Safely calculates the layout of the given root layoutElement by guarding against nil nodes.
Expand Down
12 changes: 6 additions & 6 deletions Source/Layout/ASLayout.mm
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
#import <AsyncDisplayKit/ASObjectDescriptionHelpers.h>
#import <AsyncDisplayKit/ASRectTable.h>

CGPoint const CGPointNull = {NAN, NAN};
CGPoint const ASPointNull = {NAN, NAN};

extern BOOL CGPointIsNull(CGPoint point)
extern BOOL ASPointIsNull(CGPoint point)
{
return isnan(point.x) && isnan(point.y);
}
Expand Down Expand Up @@ -87,7 +87,7 @@ - (instancetype)initWithLayoutElement:(id<ASLayoutElement>)layoutElement
if (self) {
#if DEBUG
for (ASLayout *sublayout in sublayouts) {
ASDisplayNodeAssert(CGPointIsNull(sublayout.position) == NO, @"Invalid position is not allowed in sublayout.");
ASDisplayNodeAssert(ASPointIsNull(sublayout.position) == NO, @"Invalid position is not allowed in sublayout.");
}
#endif

Expand All @@ -104,7 +104,7 @@ - (instancetype)initWithLayoutElement:(id<ASLayoutElement>)layoutElement
}
_size = size;

if (CGPointIsNull(position) == NO) {
if (ASPointIsNull(position) == NO) {
_position = CGPointMake(ASCeilPixelValue(position.x), ASCeilPixelValue(position.y));
} else {
_position = position;
Expand Down Expand Up @@ -149,15 +149,15 @@ + (instancetype)layoutWithLayoutElement:(id<ASLayoutElement>)layoutElement
{
return [self layoutWithLayoutElement:layoutElement
size:size
position:CGPointNull
position:ASPointNull
sublayouts:sublayouts];
}

+ (instancetype)layoutWithLayoutElement:(id<ASLayoutElement>)layoutElement size:(CGSize)size
{
return [self layoutWithLayoutElement:layoutElement
size:size
position:CGPointNull
position:ASPointNull
sublayouts:nil];
}

Expand Down