From a2f6045466325fc4973ce0d4eb2777a7f3ca3229 Mon Sep 17 00:00:00 2001 From: randallli Date: Mon, 5 Dec 2016 14:42:31 -0500 Subject: [PATCH 1/2] Fix warnings that block warnings as errors builds --- src/CBCNodeListViewController.m | 12 ++++++------ src/private/CBCRuntime.m | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/CBCNodeListViewController.m b/src/CBCNodeListViewController.m index 6d8e29e..e7e07be 100644 --- a/src/CBCNodeListViewController.m +++ b/src/CBCNodeListViewController.m @@ -17,7 +17,7 @@ #import "CBCNodeListViewController.h" #import "CBCCatalogExample.h" -#import "CBCRuntime.h" +#import "private/CBCRuntime.h" @implementation CBCNode { NSMutableDictionary *_map; @@ -53,7 +53,7 @@ - (void)setExampleClass:(Class)exampleClass { _exampleClass = exampleClass; } -- (void)finalize { +- (void)finalizeNode { _children = [[_children sortedArrayUsingSelector:@selector(compare:)] mutableCopy]; } @@ -137,7 +137,7 @@ - (void)viewDidAppear:(BOOL)animated { #pragma mark - UITableViewDataSource - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return [_node.children count]; + return (NSInteger)[_node.children count]; } - (UITableViewCell *)tableView:(UITableView *)tableView @@ -147,7 +147,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; } - cell.textLabel.text = [_node.children[indexPath.row] title]; + cell.textLabel.text = [_node.children[(NSUInteger)indexPath.row] title]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; return cell; } @@ -155,7 +155,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView #pragma mark - UITableViewDelegate - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - CBCNode *node = _node.children[indexPath.row]; + CBCNode *node = _node.children[(NSUInteger)indexPath.row]; UIViewController *viewController = nil; if ([node isExample]) { viewController = [node createExampleViewController]; @@ -206,7 +206,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath [queue removeObjectAtIndex:0]; [queue addObjectsFromArray:node.children]; - [node finalize]; + [node finalizeNode]; } return tree; diff --git a/src/private/CBCRuntime.m b/src/private/CBCRuntime.m index 8cbb46e..81b8b8f 100644 --- a/src/private/CBCRuntime.m +++ b/src/private/CBCRuntime.m @@ -48,7 +48,7 @@ BOOL CBCCatalogIsPrimaryDemoFromClass(Class aClass) { NSArray *CBCGetAllClasses(void) { int numberOfClasses = objc_getClassList(NULL, 0); - Class *classList = (Class *)malloc(numberOfClasses * sizeof(Class)); + Class *classList = (Class *)malloc((size_t)numberOfClasses * sizeof(Class)); objc_getClassList(classList, numberOfClasses); NSMutableArray *classes = [NSMutableArray array]; From 11787d633cd3956021107042fb92b9b7354bcc0a Mon Sep 17 00:00:00 2001 From: randallli Date: Mon, 5 Dec 2016 15:00:16 -0500 Subject: [PATCH 2/2] fix travis: changed Xcode version to 8.1 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3afdcb9..93edf48 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode7.3 +osx_image: xcode8.1 sudo: false notifications: email: false