From ee12f402f6ab4a2dd5ea436b18f5538113739c1c Mon Sep 17 00:00:00 2001 From: Sebastian Scherrmann Date: Sat, 18 Jun 2016 10:53:21 +0200 Subject: [PATCH] Fixes local variable shadow warnings when warning -Wshadow is enabled. --- FSCalendar/FSCalendar.m | 4 ++-- FSCalendar/FSCalendarAnimator.m | 24 ++++++++++++------------ FSCalendar/FSCalendarCell.m | 12 ++++++------ FSCalendar/FSCalendarEventIndicator.m | 14 +++++++------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/FSCalendar/FSCalendar.m b/FSCalendar/FSCalendar.m index 5a484b04..cae9f7c8 100644 --- a/FSCalendar/FSCalendar.m +++ b/FSCalendar/FSCalendar.m @@ -511,8 +511,8 @@ - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView [stickyHeader setNeedsLayout]; NSArray *allKeys = [_stickyHeaderMapTable.dictionaryRepresentation allKeysForObject:stickyHeader]; if (allKeys.count) { - [allKeys enumerateObjectsUsingBlock:^(NSIndexPath *indexPath, NSUInteger idx, BOOL *stop) { - [_stickyHeaderMapTable removeObjectForKey:indexPath]; + [allKeys enumerateObjectsUsingBlock:^(NSIndexPath *itemIndexPath, NSUInteger idx, BOOL *stop) { + [_stickyHeaderMapTable removeObjectForKey:itemIndexPath]; }]; } [_stickyHeaderMapTable setObject:stickyHeader forKey:indexPath]; diff --git a/FSCalendar/FSCalendarAnimator.m b/FSCalendar/FSCalendarAnimator.m index c60f6490..79cd4497 100644 --- a/FSCalendar/FSCalendarAnimator.m +++ b/FSCalendar/FSCalendarAnimator.m @@ -354,16 +354,16 @@ - (FSCalendarTransitionAttributes *)transitionAttributes NSDate *focusedDate = self.calendar.selectedDate; if (focusedDate) { - UICollectionViewLayoutAttributes *attributes = [self.collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calendar indexPathForDate:focusedDate scope:FSCalendarScopeMonth]]; - CGPoint focuedCenter = attributes.center; + UICollectionViewLayoutAttributes *itemAttributes = [self.collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calendar indexPathForDate:focusedDate scope:FSCalendarScopeMonth]]; + CGPoint focuedCenter = itemAttributes.center; if (CGRectContainsPoint(self.collectionView.bounds, focuedCenter)) { switch (self.collectionViewLayout.scrollDirection) { case UICollectionViewScrollDirectionHorizontal: { - focusedRowNumber = attributes.indexPath.item%6; + focusedRowNumber = itemAttributes.indexPath.item%6; break; } case UICollectionViewScrollDirectionVertical: { - focusedRowNumber = attributes.indexPath.item/7; + focusedRowNumber = itemAttributes.indexPath.item/7; break; } } @@ -374,16 +374,16 @@ - (FSCalendarTransitionAttributes *)transitionAttributes if (!focusedDate) { focusedDate = self.calendar.today; if (focusedDate) { - UICollectionViewLayoutAttributes *attributes = [self.collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calendar indexPathForDate:focusedDate scope:FSCalendarScopeMonth]]; - CGPoint focuedCenter = attributes.center; + UICollectionViewLayoutAttributes *itemAttributes = [self.collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calendar indexPathForDate:focusedDate scope:FSCalendarScopeMonth]]; + CGPoint focuedCenter = itemAttributes.center; if (CGRectContainsPoint(self.collectionView.bounds, focuedCenter)) { switch (self.collectionViewLayout.scrollDirection) { case UICollectionViewScrollDirectionHorizontal: { - focusedRowNumber = attributes.indexPath.item%6; + focusedRowNumber = itemAttributes.indexPath.item%6; break; } case UICollectionViewScrollDirectionVertical: { - focusedRowNumber = attributes.indexPath.item/7; + focusedRowNumber = itemAttributes.indexPath.item/7; break; } } @@ -418,8 +418,8 @@ - (FSCalendarTransitionAttributes *)transitionAttributes if (self.calendar.focusOnSingleSelectedDate) { NSDate *focusedDate = self.calendar.selectedDate; if (focusedDate) { - UICollectionViewLayoutAttributes *attributes = [self.collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calendar indexPathForDate:focusedDate scope:FSCalendarScopeWeek]]; - CGPoint focuedCenter = attributes.center; + UICollectionViewLayoutAttributes *itemAttributes = [self.collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calendar indexPathForDate:focusedDate scope:FSCalendarScopeWeek]]; + CGPoint focuedCenter = itemAttributes.center; if (CGRectContainsPoint(self.collectionView.bounds, focuedCenter)) { firstDayOfMonth = [self.calendar beginingOfMonthOfDate:focusedDate]; } else { @@ -429,8 +429,8 @@ - (FSCalendarTransitionAttributes *)transitionAttributes if (!focusedDate) { focusedDate = self.calendar.today; if (focusedDate) { - UICollectionViewLayoutAttributes *attributes = [self.collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calendar indexPathForDate:focusedDate scope:FSCalendarScopeWeek]]; - CGPoint focuedCenter = attributes.center; + UICollectionViewLayoutAttributes *itemAttributes = [self.collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calendar indexPathForDate:focusedDate scope:FSCalendarScopeWeek]]; + CGPoint focuedCenter = itemAttributes.center; if (CGRectContainsPoint(self.collectionView.bounds, focuedCenter)) { firstDayOfMonth = [self.calendar beginingOfMonthOfDate:focusedDate]; } diff --git a/FSCalendar/FSCalendarCell.m b/FSCalendar/FSCalendarCell.m index 72db2317..59da1163 100644 --- a/FSCalendar/FSCalendarCell.m +++ b/FSCalendar/FSCalendarCell.m @@ -205,14 +205,14 @@ - (void)configureCell _shapeLayer.path = path; } - CGColorRef fillColor = self.colorForCellFill.CGColor; - if (!CGColorEqualToColor(_shapeLayer.fillColor, fillColor)) { - _shapeLayer.fillColor = fillColor; + CGColorRef cellFillColor = self.colorForCellFill.CGColor; + if (!CGColorEqualToColor(_shapeLayer.fillColor, cellFillColor)) { + _shapeLayer.fillColor = cellFillColor; } - CGColorRef borderColor = self.colorForCellBorder.CGColor; - if (!CGColorEqualToColor(_shapeLayer.strokeColor, borderColor)) { - _shapeLayer.strokeColor = borderColor; + CGColorRef cellBorderColor = self.colorForCellBorder.CGColor; + if (!CGColorEqualToColor(_shapeLayer.strokeColor, cellBorderColor)) { + _shapeLayer.strokeColor = cellBorderColor; } } diff --git a/FSCalendar/FSCalendarEventIndicator.m b/FSCalendar/FSCalendarEventIndicator.m index f4100456..90bc5c88 100644 --- a/FSCalendar/FSCalendarEventIndicator.m +++ b/FSCalendar/FSCalendarEventIndicator.m @@ -67,11 +67,11 @@ - (void)layoutSublayersOfLayer:(CALayer *)layer _needsAdjustingViewFrame = NO; CGFloat diameter = MIN(MIN(self.fs_width, self.fs_height),FSCalendarMaximumEventDotDiameter); for (int i = 0; i < self.eventLayers.count; i++) { - CALayer *layer = self.eventLayers[i]; - layer.hidden = i >= self.numberOfEvents; - if (!layer.hidden) { - layer.frame = CGRectMake(2*i*diameter, (self.fs_height-diameter)*0.5, diameter, diameter); - layer.cornerRadius = diameter * 0.5; + CALayer *eventLayer = self.eventLayers[i]; + eventLayer.hidden = i >= self.numberOfEvents; + if (!eventLayer.hidden) { + eventLayer.frame = CGRectMake(2*i*diameter, (self.fs_height-diameter)*0.5, diameter, diameter); + eventLayer.cornerRadius = diameter * 0.5; } } } @@ -89,9 +89,9 @@ - (void)layoutSublayersOfLayer:(CALayer *)layer if (i < colors.count) { lastColor = colors[i]; } - CALayer *layer = self.eventLayers[i]; + CALayer *eventLayer = self.eventLayers[i]; UIImage *dotImage = [self dotImageWithColor:lastColor diameter:diameter]; - layer.contents = (id)dotImage.CGImage; + eventLayer.contents = (id)dotImage.CGImage; } } }