Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.
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
5 changes: 4 additions & 1 deletion AsyncDisplayKit/ASDisplayNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,10 @@ - (void)_insertSubnode:(ASDisplayNode *)subnode atSubnodeIndex:(NSInteger)subnod
if (canUseViewAPI && sublayerIndex != NSNotFound) {
[_view insertSubview:subnode.view atIndex:sublayerIndex];
} else if (sublayerIndex != NSNotFound) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wconversion"
[_layer insertSublayer:subnode.layer atIndex:sublayerIndex];
#pragma clang diagnostic pop
}
}
}
Expand Down Expand Up @@ -840,7 +843,7 @@ - (void)insertSubnode:(ASDisplayNode *)subnode atIndex:(NSInteger)idx
ASDN::MutexLocker l(_propertyLock);

if (idx > _subnodes.count || idx < 0) {
NSString *reason = [NSString stringWithFormat:@"Cannot insert a subnode at index %d. Count is %d", idx, _subnodes.count];
NSString *reason = [NSString stringWithFormat:@"Cannot insert a subnode at index %zd. Count is %zd", idx, _subnodes.count];
@throw [NSException exceptionWithName:NSInvalidArgumentException reason:reason userInfo:nil];
}

Expand Down
2 changes: 1 addition & 1 deletion AsyncDisplayKit/ASImageNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ - (void)dealloc

- (NSString *)description
{
return [NSString stringWithFormat:@"<%@ : %p image:%@ cropEnabled:%@ opaque:%@ bounds:%@ contentsScale:%.2f backgroundColor:%@ tint:%u contentMode:%@ cropRect:%@>", [self class], self, self.image, @(self.cropEnabled), @(self.opaque), NSStringFromCGRect(self.bounds), self.contentsScale, self.backgroundColor, self.tint, ASDisplayNodeNSStringFromUIContentMode(self.contentMode), NSStringFromCGRect(self.cropRect)];
return [NSString stringWithFormat:@"<%@ : %p image:%@ cropEnabled:%@ opaque:%@ bounds:%@ contentsScale:%.2f backgroundColor:%@ tint:%zd contentMode:%@ cropRect:%@>", [self class], self, self.image, @(self.cropEnabled), @(self.opaque), NSStringFromCGRect(self.bounds), self.contentsScale, self.backgroundColor, self.tint, ASDisplayNodeNSStringFromUIContentMode(self.contentMode), NSStringFromCGRect(self.cropRect)];
}

@end
Expand Down
2 changes: 1 addition & 1 deletion AsyncDisplayKit/Private/_ASCoreAnimationExtras.mm
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ UIViewContentMode ASDisplayNodeUIContentModeFromNSString(NSString *string) {
return UIContentModeCAGravityLUT[i].string;
}
}
ASDisplayNodeCAssert(contentMode == UIViewContentModeRedraw, @"Encountered an unknown contentMode %d. Is this a new version of iOS?", contentMode);
ASDisplayNodeCAssert(contentMode == UIViewContentModeRedraw, @"Encountered an unknown contentMode %ld. Is this a new version of iOS?", contentMode);
// Redraw is ok to return nil.
return nil;
}
Expand Down
2 changes: 1 addition & 1 deletion AsyncDisplayKitTests/ASDisplayLayerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ @implementation _ASDisplayLayerTestLayer

- (NSString *)setContentsCounts
{
return [NSString stringWithFormat:@"syncCount:%u, asyncCount:%u", _setContentsSyncCount, _setContentsAsyncCount];
return [NSString stringWithFormat:@"syncCount:%tu, asyncCount:%tu", _setContentsSyncCount, _setContentsAsyncCount];
}

- (BOOL)checkSetContentsCountsWithSyncCount:(NSUInteger)syncCount asyncCount:(NSUInteger)asyncCount
Expand Down
10 changes: 5 additions & 5 deletions AsyncDisplayKitTests/ASDisplayNodeTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -746,11 +746,11 @@ - (void)testReferenceCounting
};

// verify initial
XCTAssertTrue(1 == node.retainCount, @"unexpected retain count:%d", node.retainCount);
XCTAssertTrue(1 == node.retainCount, @"unexpected retain count:%tu", node.retainCount);

// verify increment
[node retain];
XCTAssertTrue(2 == node.retainCount, @"unexpected retain count:%d", node.retainCount);
XCTAssertTrue(2 == node.retainCount, @"unexpected retain count:%tu", node.retainCount);

// verify dealloc
[node release];
Expand All @@ -768,15 +768,15 @@ - (void)testAddingNodeToHierarchyRetainsNode
};

// verify initial
XCTAssertTrue(1 == node.retainCount, @"unexpected retain count:%d", node.retainCount);
XCTAssertTrue(1 == node.retainCount, @"unexpected retain count:%tu", node.retainCount);

UIView *v = [[UIView alloc] initWithFrame:CGRectZero];
[v addSubview:node.view];

XCTAssertTrue(2 == node.retainCount, @"view should retain node when added. retain count:%d", node.retainCount);
XCTAssertTrue(2 == node.retainCount, @"view should retain node when added. retain count:%tu", node.retainCount);

[node release];
XCTAssertTrue(1 == node.retainCount, @"unexpected retain count:%d", node.retainCount);
XCTAssertTrue(1 == node.retainCount, @"unexpected retain count:%tu", node.retainCount);

[node.view removeFromSuperview];
XCTAssertTrue(didDealloc, @"unexpected node lifetime:%@", node);
Expand Down
6 changes: 3 additions & 3 deletions AsyncDisplayKitTests/ASTextNodeRendererTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ - (void)testTruncation
[_renderer size];
NSRange stringRange = NSMakeRange(0, _attributedString.length);
NSRange visibleRange = [_renderer visibleRange];
XCTAssertTrue(visibleRange.length < stringRange.length, @"Some truncation should occur if the constrained size is smaller than the previously calculated bounding size. String length %d, visible range %@", _attributedString.length, NSStringFromRange(visibleRange));
XCTAssertTrue(visibleRange.length < stringRange.length, @"Some truncation should occur if the constrained size is smaller than the previously calculated bounding size. String length %tu, visible range %@", _attributedString.length, NSStringFromRange(visibleRange));
NSRange truncationRange = [_renderer truncationStringCharacterRange];
XCTAssertTrue(truncationRange.location == NSMaxRange(visibleRange), @"Truncation location (%d) should be after the end of the visible range (%d)", truncationRange.location, NSMaxRange(visibleRange));
XCTAssertTrue(truncationRange.length == _truncationString.length, @"Truncation string length (%d) should be the full length of the supplied truncation string (%@)", truncationRange.length, _truncationString.string);
XCTAssertTrue(truncationRange.location == NSMaxRange(visibleRange), @"Truncation location (%zd) should be after the end of the visible range (%zd)", truncationRange.location, NSMaxRange(visibleRange));
XCTAssertTrue(truncationRange.length == _truncationString.length, @"Truncation string length (%zd) should be the full length of the supplied truncation string (%@)", truncationRange.length, _truncationString.string);
}

/**
Expand Down