Skip to content

Commit

Permalink
Merge pull request #6 from randallli/fixWarnings
Browse files Browse the repository at this point in the history
Fix warnings that block warnings as errors builds
  • Loading branch information
randallli committed Dec 5, 2016
2 parents 4b0a79b + 11787d6 commit 8136bf1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode7.3
osx_image: xcode8.1
sudo: false
notifications:
email: false
Expand Down
12 changes: 6 additions & 6 deletions src/CBCNodeListViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#import "CBCNodeListViewController.h"

#import "CBCCatalogExample.h"
#import "CBCRuntime.h"
#import "private/CBCRuntime.h"

@implementation CBCNode {
NSMutableDictionary *_map;
Expand Down Expand Up @@ -53,7 +53,7 @@ - (void)setExampleClass:(Class)exampleClass {
_exampleClass = exampleClass;
}

- (void)finalize {
- (void)finalizeNode {
_children = [[_children sortedArrayUsingSelector:@selector(compare:)] mutableCopy];
}

Expand Down Expand Up @@ -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
Expand All @@ -147,15 +147,15 @@ - (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;
}

#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];
Expand Down Expand Up @@ -206,7 +206,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
[queue removeObjectAtIndex:0];
[queue addObjectsFromArray:node.children];

[node finalize];
[node finalizeNode];
}

return tree;
Expand Down
2 changes: 1 addition & 1 deletion src/private/CBCRuntime.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ BOOL CBCCatalogIsPrimaryDemoFromClass(Class aClass) {

NSArray<Class> *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<Class> *classes = [NSMutableArray array];
Expand Down

0 comments on commit 8136bf1

Please sign in to comment.