diff --git a/Classes/MetadataImporters/iTunesStore.m b/Classes/MetadataImporters/iTunesStore.m index bcc078e..2399ecf 100755 --- a/Classes/MetadataImporters/iTunesStore.m +++ b/Classes/MetadataImporters/iTunesStore.m @@ -384,4 +384,4 @@ NSInteger sortMP42Metadata(id ep1, id ep2, void *context) return [returnArray autorelease]; } -@end \ No newline at end of file +@end diff --git a/Classes/PropertyView/SBChapterViewController.m b/Classes/PropertyView/SBChapterViewController.m index 91dee4f..1740404 100755 --- a/Classes/PropertyView/SBChapterViewController.m +++ b/Classes/PropertyView/SBChapterViewController.m @@ -90,7 +90,7 @@ } - (IBAction)removeChapter:(id)sender { - NSUInteger current_index = [chapterTableView selectedRow]; + NSInteger current_index = [chapterTableView selectedRow]; if (current_index < [track chapterCount]) { [track removeChapterAtIndex:current_index]; diff --git a/Classes/PropertyView/SBMovieViewController.h b/Classes/PropertyView/SBMovieViewController.h index 67fdf14..57e9aac 100755 --- a/Classes/PropertyView/SBMovieViewController.h +++ b/Classes/PropertyView/SBMovieViewController.h @@ -74,4 +74,4 @@ - (IBAction) selectArtwork: (id) sender; - (IBAction) removeArtwork: (id) sender; -@end \ No newline at end of file +@end diff --git a/Classes/PropertyView/SBMovieViewController.m b/Classes/PropertyView/SBMovieViewController.m index 83c593b..05ad1e0 100755 --- a/Classes/PropertyView/SBMovieViewController.m +++ b/Classes/PropertyView/SBMovieViewController.m @@ -537,7 +537,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn - (IBAction) changeMediaKind: (id) sender { - uint8_t tagName = [[sender selectedItem] tag]; + uint8_t tagName = (uint8_t)[[sender selectedItem] tag]; if (metadata.mediaKind != tagName) { metadata.mediaKind = tagName; @@ -548,7 +548,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn - (IBAction) changecContentRating: (id) sender { - uint8_t tagName = [[sender selectedItem] tag]; + uint8_t tagName = (uint8_t)[[sender selectedItem] tag]; if (metadata.contentRating != tagName) { metadata.contentRating = tagName; @@ -561,7 +561,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn { uint8_t newValue; if (sender == gapless) - newValue = [gapless state]; + newValue = (uint8_t)[gapless state]; else { newValue = ![gapless state]; [gapless setState:newValue]; @@ -583,9 +583,9 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn - (IBAction) changePodcast: (id) sender { uint8_t newValue; - if (sender == podcast) - newValue = [podcast state]; - else { + if (sender == podcast) { + newValue = (uint8_t)[podcast state]; + } else { newValue = ![podcast state]; [podcast setState:newValue]; } @@ -605,7 +605,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn - (IBAction) changehdVideo: (id) sender { - uint8_t tagName = [[sender selectedItem] tag]; + uint8_t tagName = (uint8_t)[[sender selectedItem] tag]; if (metadata.hdVideo != tagName) { metadata.hdVideo = tagName; diff --git a/Classes/PropertyView/SBSoundViewController.m b/Classes/PropertyView/SBSoundViewController.m index 7b646a4..8157a73 100755 --- a/Classes/PropertyView/SBSoundViewController.m +++ b/Classes/PropertyView/SBSoundViewController.m @@ -13,7 +13,7 @@ - (void)awakeFromNib { - [alternateGroup selectItemAtIndex:track.alternate_group]; + [alternateGroup selectItemAtIndex:(NSInteger)track.alternate_group]; _fallbacks = [[NSMutableArray alloc] init]; @@ -86,7 +86,7 @@ - (IBAction)setTrackVolume:(id)sender { - float value = [sender doubleValue] / 100; + float value = [sender floatValue] / 100; if (track.volume != value) { track.volume = value; [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; @@ -130,7 +130,7 @@ - (IBAction)setAltenateGroup:(id)sender { - uint8_t tagName = [[sender selectedItem] tag]; + NSInteger tagName = [[sender selectedItem] tag]; if (track.alternate_group != tagName) { track.alternate_group = tagName; diff --git a/Classes/PropertyView/SBVideoViewController.m b/Classes/PropertyView/SBVideoViewController.m index 0617290..f097978 100755 --- a/Classes/PropertyView/SBVideoViewController.m +++ b/Classes/PropertyView/SBVideoViewController.m @@ -70,7 +70,7 @@ static NSString *getLevelName(uint8_t level) { [offsetX setStringValue: [NSString stringWithFormat:@"%d", track.offsetX]]; [offsetY setStringValue: [NSString stringWithFormat:@"%d", track.offsetY]]; - [alternateGroup selectItemAtIndex:track.alternate_group]; + [alternateGroup selectItemAtIndex:(NSInteger)track.alternate_group]; if ([track.format isEqualToString:MP42VideoFormatH264] && track.origProfile && track.origLevel) { [profileLevelUnchanged setTitle:[NSString stringWithFormat:@"Current profile: %@ @ %@", @@ -163,7 +163,7 @@ static NSString *getLevelName(uint8_t level) { if (track.trackWidth != i) { if ([preserveAspectRatio state] == NSOnState) { track.trackHeight = (track.trackHeight / track.trackWidth) * i; - [trackHeight setIntegerValue:track.trackHeight]; + [trackHeight setIntegerValue:(NSInteger)track.trackHeight]; } track.trackWidth = i; @@ -227,7 +227,7 @@ static NSString *getLevelName(uint8_t level) { - (IBAction)setAltenateGroup:(id)sender { - uint8_t tagName = [[sender selectedItem] tag]; + NSInteger tagName = [[sender selectedItem] tag]; if (track.alternate_group != tagName) { track.alternate_group = tagName; diff --git a/Classes/SBDocument.m b/Classes/SBDocument.m index 12681ef..f580952 100755 --- a/Classes/SBDocument.m +++ b/Classes/SBDocument.m @@ -482,7 +482,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn } else if ([tableColumn.identifier isEqualToString:@"trackEnabled"]) { if (!(track.enabled == [anObject integerValue])) { - track.enabled = [anObject integerValue]; + track.enabled = [anObject boolValue]; [self updateChangeCount:NSChangeDone]; } } @@ -770,7 +770,8 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn for (MP42Track *track in self.mp4.tracks) if ([track isKindOfClass:[MP42VideoTrack class]]) { - int hdVideo = isHdVideo([((MP42VideoTrack *) track) trackWidth], [((MP42VideoTrack *) track) trackHeight]); + MP42VideoTrack *videoTrack = (MP42VideoTrack *)track; + int hdVideo = isHdVideo((uint64_t)videoTrack.trackWidth, (uint64_t)videoTrack.trackHeight); if (hdVideo) [self.mp4.metadata setTag:@(hdVideo) forKey:@"HD Video"]; diff --git a/Classes/SBQueueAction.h b/Classes/SBQueueAction.h index f12f5cc..3fba0d3 100644 --- a/Classes/SBQueueAction.h +++ b/Classes/SBQueueAction.h @@ -29,4 +29,4 @@ @end @interface SBQueueOrganizeGroupsAction : NSObject -@end \ No newline at end of file +@end diff --git a/Classes/SBQueueAction.m b/Classes/SBQueueAction.m index 6f74fb0..8123c50 100644 --- a/Classes/SBQueueAction.m +++ b/Classes/SBQueueAction.m @@ -147,7 +147,8 @@ for (MP42Track *track in [item.mp4File tracksWithMediaType:MP42MediaTypeVideo]) if ([track isKindOfClass:[MP42VideoTrack class]]) { - int hdVideo = isHdVideo([((MP42VideoTrack *) track) trackWidth], [((MP42VideoTrack *) track) trackHeight]); + MP42VideoTrack *videoTrack = (MP42VideoTrack *)track; + int hdVideo = isHdVideo((uint64_t)videoTrack.trackWidth, (uint64_t)videoTrack.trackHeight); if (hdVideo) [metadata setTag:@(hdVideo) forKey:@"HD Video"]; diff --git a/Others/MAAttachedWindow.h b/Others/MAAttachedWindow.h index 5740abe..f09adc8 100755 --- a/Others/MAAttachedWindow.h +++ b/Others/MAAttachedWindow.h @@ -51,12 +51,12 @@ typedef enum _MAWindowPosition { @interface MAAttachedWindow : NSWindow { NSColor *borderColor; - float borderWidth; - float viewMargin; - float arrowBaseWidth; - float arrowHeight; + CGFloat borderWidth; + CGFloat viewMargin; + CGFloat arrowBaseWidth; + CGFloat arrowHeight; BOOL hasArrow; - float cornerRadius; + CGFloat cornerRadius; BOOL drawsRoundCornerBesideArrow; @private @@ -65,7 +65,7 @@ typedef enum _MAWindowPosition { __weak NSWindow *_window; NSPoint _point; MAWindowPosition _side; - float _distance; + CGFloat _distance; NSRect _viewFrame; BOOL _resizing; } @@ -123,20 +123,20 @@ typedef enum _MAWindowPosition { // Accessor methods - (NSColor *)borderColor; - (void)setBorderColor:(NSColor *)value; -- (float)borderWidth; -- (void)setBorderWidth:(float)value; // See note 1 below. -- (float)viewMargin; -- (void)setViewMargin:(float)value; // See note 2 below. -- (float)arrowBaseWidth; -- (void)setArrowBaseWidth:(float)value; // See note 2 below. -- (float)arrowHeight; -- (void)setArrowHeight:(float)value; // See note 2 below. -- (float)hasArrow; -- (void)setHasArrow:(float)value; -- (float)cornerRadius; -- (void)setCornerRadius:(float)value; // See note 2 below. -- (float)drawsRoundCornerBesideArrow; // See note 3 below. -- (void)setDrawsRoundCornerBesideArrow:(float)value; // See note 2 below. +- (CGFloat)borderWidth; +- (void)setBorderWidth:(CGFloat)value; // See note 1 below. +- (CGFloat)viewMargin; +- (void)setViewMargin:(CGFloat)value; // See note 2 below. +- (CGFloat)arrowBaseWidth; +- (void)setArrowBaseWidth:(CGFloat)value; // See note 2 below. +- (CGFloat)arrowHeight; +- (void)setArrowHeight:(CGFloat)value; // See note 2 below. +- (CGFloat)hasArrow; +- (void)setHasArrow:(CGFloat)value; +- (CGFloat)cornerRadius; +- (void)setCornerRadius:(CGFloat)value; // See note 2 below. +- (CGFloat)drawsRoundCornerBesideArrow; // See note 3 below. +- (void)setDrawsRoundCornerBesideArrow:(CGFloat)value; // See note 2 below. - (void)setBackgroundImage:(NSImage *)value; - (NSColor *)windowBackgroundColor; // See note 4 below. - (void)setBackgroundColor:(NSColor *)value; diff --git a/Others/MAAttachedWindow.m b/Others/MAAttachedWindow.m index e34ee5f..0e63976 100755 --- a/Others/MAAttachedWindow.m +++ b/Others/MAAttachedWindow.m @@ -16,7 +16,7 @@ // Geometry - (void)_updateGeometry; - (MAWindowPosition)_bestSideForAutomaticPosition; -- (float)_arrowInset; +- (CGFloat)_arrowInset; // Drawing - (void)_updateBackground; @@ -194,7 +194,7 @@ // Note: we always leave room for the arrow, even if it currently set to // not be shown. This is so it can easily be toggled whilst the window // is visible, without altering the window's frame origin point. - float scaledArrowHeight = arrowHeight * MAATTACHEDWINDOW_SCALE_FACTOR; + CGFloat scaledArrowHeight = arrowHeight * MAATTACHEDWINDOW_SCALE_FACTOR; switch (_side) { case MAPositionLeft: case MAPositionLeftTop: @@ -224,9 +224,9 @@ // Position frame origin appropriately for _side, accounting for arrow-inset. contentRect.origin = (_window) ? [_window convertBaseToScreen:_point] : _point; - float arrowInset = [self _arrowInset]; - float halfWidth = contentRect.size.width / 2.0; - float halfHeight = contentRect.size.height / 2.0; + CGFloat arrowInset = [self _arrowInset]; + CGFloat halfWidth = contentRect.size.width / 2.0; + CGFloat halfHeight = contentRect.size.height / 2.0; switch (_side) { case MAPositionTopLeft: contentRect.origin.x -= contentRect.size.width - arrowInset; @@ -320,7 +320,7 @@ viewSize.width += (viewMargin * MAATTACHEDWINDOW_SCALE_FACTOR) * 2.0; viewSize.height += (viewMargin * MAATTACHEDWINDOW_SCALE_FACTOR) * 2.0; MAWindowPosition side = MAPositionBottom; // By default, position us centered below. - float scaledArrowHeight = (arrowHeight * MAATTACHEDWINDOW_SCALE_FACTOR) + _distance; + CGFloat scaledArrowHeight = (arrowHeight * MAATTACHEDWINDOW_SCALE_FACTOR) + _distance; // We'd like to display directly below the specified point, since this gives a // sense of a relationship between the point and this window. Check there's room. @@ -341,11 +341,11 @@ } } - float halfWidth = viewSize.width / 2.0; - float halfHeight = viewSize.height / 2.0; + CGFloat halfWidth = viewSize.width / 2.0; + CGFloat halfHeight = viewSize.height / 2.0; NSRect parentFrame = (_window) ? [_window frame] : screenFrame; - float arrowInset = [self _arrowInset]; + CGFloat arrowInset = [self _arrowInset]; // We're currently at a primary side. // Try to avoid going outwith the parent area in the secondary dimension, @@ -409,9 +409,9 @@ } -- (float)_arrowInset +- (CGFloat)_arrowInset { - float cornerInset = (drawsRoundCornerBesideArrow) ? cornerRadius : 0; + CGFloat cornerInset = (drawsRoundCornerBesideArrow) ? cornerRadius : 0; return (cornerInset + (arrowBaseWidth / 2.0)) * MAATTACHEDWINDOW_SCALE_FACTOR; } @@ -476,19 +476,19 @@ 6. cornerRadius */ - float scaleFactor = MAATTACHEDWINDOW_SCALE_FACTOR; - float scaledRadius = cornerRadius * scaleFactor; - float scaledArrowWidth = arrowBaseWidth * scaleFactor; - float halfArrowWidth = scaledArrowWidth / 2.0; + CGFloat scaleFactor = MAATTACHEDWINDOW_SCALE_FACTOR; + CGFloat scaledRadius = cornerRadius * scaleFactor; + CGFloat scaledArrowWidth = arrowBaseWidth * scaleFactor; + CGFloat halfArrowWidth = scaledArrowWidth / 2.0; NSRect contentArea = NSInsetRect(_viewFrame, -viewMargin * scaleFactor, -viewMargin * scaleFactor); - float minX = NSMinX(contentArea) * scaleFactor; - float midX = NSMidX(contentArea) * scaleFactor; - float maxX = NSMaxX(contentArea) * scaleFactor; - float minY = NSMinY(contentArea) * scaleFactor; - float midY = NSMidY(contentArea) * scaleFactor; - float maxY = NSMaxY(contentArea) * scaleFactor; + CGFloat minX = NSMinX(contentArea) * scaleFactor; + CGFloat midX = NSMidX(contentArea) * scaleFactor; + CGFloat maxX = NSMaxX(contentArea) * scaleFactor; + CGFloat minY = NSMinY(contentArea) * scaleFactor; + CGFloat midY = NSMidY(contentArea) * scaleFactor; + CGFloat maxY = NSMaxY(contentArea) * scaleFactor; NSBezierPath *path = [NSBezierPath bezierPath]; [path setLineJoinStyle:NSRoundLineJoinStyle]; @@ -663,10 +663,10 @@ return; } - float scaleFactor = MAATTACHEDWINDOW_SCALE_FACTOR; - float scaledArrowWidth = arrowBaseWidth * scaleFactor; - float halfArrowWidth = scaledArrowWidth / 2.0; - float scaledArrowHeight = arrowHeight * scaleFactor; + CGFloat scaleFactor = MAATTACHEDWINDOW_SCALE_FACTOR; + CGFloat scaledArrowWidth = arrowBaseWidth * scaleFactor; + CGFloat halfArrowWidth = scaledArrowWidth / 2.0; + CGFloat scaledArrowHeight = arrowHeight * scaleFactor; NSPoint currPt = [path currentPoint]; NSPoint tipPt = currPt; NSPoint endPt = currPt; @@ -811,14 +811,14 @@ } -- (float)borderWidth { +- (CGFloat)borderWidth { return borderWidth; } -- (void)setBorderWidth:(float)value { +- (void)setBorderWidth:(CGFloat)value { if (borderWidth != value) { - float maxBorderWidth = viewMargin; + CGFloat maxBorderWidth = viewMargin; if (value <= maxBorderWidth) { borderWidth = value; } else { @@ -830,12 +830,12 @@ } -- (float)viewMargin { +- (CGFloat)viewMargin { return viewMargin; } -- (void)setViewMargin:(float)value { +- (void)setViewMargin:(CGFloat)value { if (viewMargin != value) { viewMargin = MAX(value, 0.0); @@ -845,13 +845,13 @@ } -- (float)arrowBaseWidth { +- (CGFloat)arrowBaseWidth { return arrowBaseWidth; } -- (void)setArrowBaseWidth:(float)value { - float maxWidth = (MIN(_viewFrame.size.width, _viewFrame.size.height) + +- (void)setArrowBaseWidth:(CGFloat)value { + CGFloat maxWidth = (MIN(_viewFrame.size.width, _viewFrame.size.height) + (viewMargin * 2.0)) - cornerRadius; if (drawsRoundCornerBesideArrow) { maxWidth -= cornerRadius; @@ -866,12 +866,12 @@ } -- (float)arrowHeight { +- (CGFloat)arrowHeight { return arrowHeight; } -- (void)setArrowHeight:(float)value { +- (void)setArrowHeight:(CGFloat)value { if (arrowHeight != value) { arrowHeight = value; @@ -880,12 +880,12 @@ } -- (float)hasArrow { +- (CGFloat)hasArrow { return hasArrow; } -- (void)setHasArrow:(float)value { +- (void)setHasArrow:(CGFloat)value { if (hasArrow != value) { hasArrow = value; @@ -894,13 +894,13 @@ } -- (float)cornerRadius { +- (CGFloat)cornerRadius { return cornerRadius; } -- (void)setCornerRadius:(float)value { - float maxRadius = ((MIN(_viewFrame.size.width, _viewFrame.size.height) + +- (void)setCornerRadius:(CGFloat)value { + CGFloat maxRadius = ((MIN(_viewFrame.size.width, _viewFrame.size.height) + (viewMargin * 2.0)) - arrowBaseWidth) / 2.0; if (value <= maxRadius) { cornerRadius = value; @@ -914,12 +914,12 @@ } -- (float)drawsRoundCornerBesideArrow { +- (CGFloat)drawsRoundCornerBesideArrow { return drawsRoundCornerBesideArrow; } -- (void)setDrawsRoundCornerBesideArrow:(float)value { +- (void)setDrawsRoundCornerBesideArrow:(CGFloat)value { if (drawsRoundCornerBesideArrow != value) { drawsRoundCornerBesideArrow = value; diff --git a/Others/XMLReader.m b/Others/XMLReader.m index 933fc39..e7c6fec 100755 --- a/Others/XMLReader.m +++ b/Others/XMLReader.m @@ -229,4 +229,4 @@ NSString *const kXMLReaderTextNodeKey = @"text"; *errorPointer = parseError; } -@end \ No newline at end of file +@end diff --git a/Subler.xcodeproj/project.pbxproj b/Subler.xcodeproj/project.pbxproj index d8d60cd..0662777 100755 --- a/Subler.xcodeproj/project.pbxproj +++ b/Subler.xcodeproj/project.pbxproj @@ -866,7 +866,6 @@ "\"$(SRCROOT)\"", ); GCC_DYNAMIC_NO_PIC = NO; - GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Subler_Prefix.pch; @@ -893,7 +892,6 @@ "\"$(SRCROOT)\"", ); GCC_DYNAMIC_NO_PIC = YES; - GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Subler_Prefix.pch; GCC_VERSION = ""; @@ -911,11 +909,13 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = NO; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_ENTITLEMENTS = ""; CODE_SIGN_IDENTITY = ""; @@ -925,10 +925,13 @@ GCC_C_LANGUAGE_STANDARD = c99; GCC_OPTIMIZATION_LEVEL = 0; GCC_VERSION = ""; - GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_SHADOW = YES; GCC_WARN_SIGN_COMPARE = NO; GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = NO; GCC_WARN_UNUSED_PARAMETER = NO; GCC_WARN_UNUSED_VARIABLE = YES; @@ -948,11 +951,13 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = NO; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_ENTITLEMENTS = ""; CODE_SIGN_IDENTITY = ""; @@ -962,9 +967,11 @@ GCC_ENABLE_SSE3_EXTENSIONS = YES; GCC_OPTIMIZATION_LEVEL = 3; GCC_VERSION = ""; - GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_PEDANTIC = NO; + GCC_WARN_SHADOW = YES; GCC_WARN_SIGN_COMPARE = NO; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES;