Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #41 from tonyarnold/develop

Fix pointer signedness comparison issues.
  • Loading branch information...
commit a9af11fa504615da352db539e35c0b8f8a63fb67 2 parents bbcb65d + f3f5af8
@steipete steipete authored
Showing with 9 additions and 9 deletions.
  1. +9 −9 GMGridView/GMGridView.m
View
18 GMGridView/GMGridView.m
@@ -32,7 +32,7 @@
#import "GMGridViewLayoutStrategies.h"
#import "UIGestureRecognizer+GMGridViewAdditions.h"
-static const NSUInteger kTagOffset = 50;
+static const NSInteger kTagOffset = 50;
static const CGFloat kDefaultAnimationDuration = 0.3;
static const UIViewAnimationOptions kDefaultAnimationOptions = UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionAllowUserInteraction;
@@ -429,7 +429,7 @@ - (void)setEditing:(BOOL)editing animated:(BOOL)animated
{
for (GMGridViewCell *cell in [self itemSubviews])
{
- NSUInteger index = [self positionForItemSubview:cell];
+ NSInteger index = [self positionForItemSubview:cell];
if (index != GMGV_INVALID_POSITION)
{
BOOL allowEdit = editing && [self.dataSource GMGridView:self canDeleteItemAtIndex:index];
@@ -1296,8 +1296,8 @@ - (void)loadRequiredItems
NSRange loadedPositionsRange = NSMakeRange(self.firstPositionLoaded, self.lastPositionLoaded - self.firstPositionLoaded);
// calculate new position range
- self.firstPositionLoaded = self.firstPositionLoaded == GMGV_INVALID_POSITION ? rangeOfPositions.location : MIN(self.firstPositionLoaded, rangeOfPositions.location);
- self.lastPositionLoaded = self.lastPositionLoaded == GMGV_INVALID_POSITION ? NSMaxRange(rangeOfPositions) : MAX(self.lastPositionLoaded, rangeOfPositions.length + rangeOfPositions.location);
+ self.firstPositionLoaded = self.firstPositionLoaded == GMGV_INVALID_POSITION ? rangeOfPositions.location : MIN(self.firstPositionLoaded, (NSInteger)rangeOfPositions.location);
+ self.lastPositionLoaded = self.lastPositionLoaded == GMGV_INVALID_POSITION ? NSMaxRange(rangeOfPositions) : MAX(self.lastPositionLoaded, (NSInteger)(rangeOfPositions.length + rangeOfPositions.location));
// remove now invisible items
[self setSubviewsCacheAsInvalid];
@@ -1306,7 +1306,7 @@ - (void)loadRequiredItems
// add new cells
BOOL forceLoad = self.firstPositionLoaded == GMGV_INVALID_POSITION || self.lastPositionLoaded == GMGV_INVALID_POSITION;
NSInteger positionToLoad;
- for (int i = 0; i < rangeOfPositions.length; i++)
+ for (NSUInteger i = 0; i < rangeOfPositions.length; i++)
{
positionToLoad = i + rangeOfPositions.location;
@@ -1327,9 +1327,9 @@ - (void)cleanupUnseenItems
NSRange rangeOfPositions = [self.layoutStrategy rangeOfPositionsInBoundsFromOffset: self.contentOffset];
GMGridViewCell *cell;
- if (rangeOfPositions.location > self.firstPositionLoaded)
+ if ((NSInteger)rangeOfPositions.location > self.firstPositionLoaded)
{
- for (int i = self.firstPositionLoaded; i < rangeOfPositions.location; i++)
+ for (NSInteger i = self.firstPositionLoaded; i < (NSInteger)rangeOfPositions.location; i++)
{
cell = [self cellForItemAtIndex:i];
if(cell)
@@ -1343,9 +1343,9 @@ - (void)cleanupUnseenItems
[self setSubviewsCacheAsInvalid];
}
- if (NSMaxRange(rangeOfPositions) < self.lastPositionLoaded)
+ if ((NSInteger)NSMaxRange(rangeOfPositions) < self.lastPositionLoaded)
{
- for (int i = NSMaxRange(rangeOfPositions); i <= self.lastPositionLoaded; i++)
+ for (NSInteger i = NSMaxRange(rangeOfPositions); i <= self.lastPositionLoaded; i++)
{
cell = [self cellForItemAtIndex:i];
if(cell)
Please sign in to comment.
Something went wrong with that request. Please try again.