summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--macosx/HBAVPlayer.m4
-rw-r--r--macosx/HBAddPresetController.m14
-rw-r--r--macosx/HBAppDelegate.m2
-rw-r--r--macosx/HBApplication.h1
-rw-r--r--macosx/HBAudio.m6
-rw-r--r--macosx/HBAudioController.h8
-rw-r--r--macosx/HBAudioDefaults.m2
-rw-r--r--macosx/HBAudioDefaultsController.h5
-rw-r--r--macosx/HBAudioDefaultsController.m6
-rw-r--r--macosx/HBAudioTrack.m2
-rw-r--r--macosx/HBChapterTitlesController.h8
-rw-r--r--macosx/HBChapterTitlesController.m4
-rw-r--r--macosx/HBController.h6
-rw-r--r--macosx/HBController.m10
-rw-r--r--macosx/HBCore.m4
-rw-r--r--macosx/HBDVDDetector.h3
-rw-r--r--macosx/HBDockTextField.h5
-rw-r--r--macosx/HBDockTile.h5
-rw-r--r--macosx/HBEncodingProgressHUDController.h7
-rw-r--r--macosx/HBEncodingProgressHUDController.m4
-rw-r--r--macosx/HBExceptionAlertController.h4
-rw-r--r--macosx/HBFilters+UIAdditions.m9
-rw-r--r--macosx/HBFiltersViewController.h5
-rw-r--r--macosx/HBImageUtilities.h9
-rw-r--r--macosx/HBJob+Private.h16
-rw-r--r--macosx/HBJob.m2
-rw-r--r--macosx/HBLanguagesSelection.h2
-rw-r--r--macosx/HBMutablePreset.m2
-rw-r--r--macosx/HBOutputFileWriter.m2
-rw-r--r--macosx/HBPictureController.h5
-rw-r--r--macosx/HBPictureHUDController.m14
-rw-r--r--macosx/HBPictureViewController.h5
-rw-r--r--macosx/HBPictureViewController.m4
-rw-r--r--macosx/HBPlayer.h3
-rw-r--r--macosx/HBPlayerHUDController.h6
-rw-r--r--macosx/HBPlayerHUDController.m16
-rw-r--r--macosx/HBPlayerTrack.h3
-rw-r--r--macosx/HBPreferencesController.m4
-rw-r--r--macosx/HBPreset.m8
-rw-r--r--macosx/HBPresetsManager.m4
-rw-r--r--macosx/HBPresetsMenuBuilder.h5
-rw-r--r--macosx/HBPreviewController.h8
-rw-r--r--macosx/HBPreviewController.m10
-rw-r--r--macosx/HBPreviewGenerator.m2
-rw-r--r--macosx/HBPreviewView.m2
-rw-r--r--macosx/HBPreviewViewController.h5
-rw-r--r--macosx/HBPreviewViewController.m4
-rw-r--r--macosx/HBQueue.h1
-rw-r--r--macosx/HBQueue.m5
-rw-r--r--macosx/HBQueueController.m6
-rw-r--r--macosx/HBQueueInfoViewController.m10
-rw-r--r--macosx/HBQueueItem.m7
-rw-r--r--macosx/HBQueueMultiSelectionViewController.m2
-rw-r--r--macosx/HBQueueTableViewController.m8
-rw-r--r--macosx/HBSecurityAccessToken.m2
-rw-r--r--macosx/HBSubtitles.m6
-rw-r--r--macosx/HBSubtitlesController.h8
-rw-r--r--macosx/HBSubtitlesDefaultsController.h5
-rw-r--r--macosx/HBSubtitlesDefaultsController.m4
-rw-r--r--macosx/HBSubtitlesTrack.m4
-rw-r--r--macosx/HBThumbnailItemView.h8
-rw-r--r--macosx/HBThumbnailItemView.m2
-rw-r--r--macosx/HBTitleSelectionController.m2
-rw-r--r--macosx/HBToolbarBadgedItem.h5
-rw-r--r--macosx/HBVideo.m4
-rw-r--r--macosx/HBVideoController.h8
-rw-r--r--macosx/HandBrake.xcodeproj/project.pbxproj70
-rw-r--r--macosx/HandBrakeXPCService/HBRemoteCoreProtocol.h4
-rw-r--r--macosx/HandBrakeXPCService/HandBrakeXPCService.h5
-rw-r--r--macosx/HandBrakeXPCService/HandBrakeXPCService.m2
-rw-r--r--macosx/NSArray+HBAdditions.h7
-rw-r--r--macosx/NSJSONSerialization+HBAdditions.h4
-rw-r--r--macosx/NSJSONSerialization+HBAdditions.m4
-rw-r--r--macosx/NSWindow+HBAdditions.m4
-rw-r--r--macosx/main.m (renamed from macosx/main.mm)0
75 files changed, 309 insertions, 153 deletions
diff --git a/macosx/HBAVPlayer.m b/macosx/HBAVPlayer.m
index 833c0643a..940c5bdb6 100644
--- a/macosx/HBAVPlayer.m
+++ b/macosx/HBAVPlayer.m
@@ -25,7 +25,7 @@ typedef void (^HBPlayableObverser)(void);
@implementation HBAVPlayerRateObserver
-- (void)postNotification;
+- (void)postNotification
{
self.block();
}
@@ -284,7 +284,7 @@ typedef void (^HBPlayableObverser)(void);
#pragma mark public methods
-- (void)loadPlayableValueAsynchronouslyWithCompletionHandler:(nullable void (^)(void))handler;
+- (void)loadPlayableValueAsynchronouslyWithCompletionHandler:(nullable void (^)(void))handler
{
if (self.isLoaded)
{
diff --git a/macosx/HBAddPresetController.m b/macosx/HBAddPresetController.m
index 406ab379e..238361e14 100644
--- a/macosx/HBAddPresetController.m
+++ b/macosx/HBAddPresetController.m
@@ -24,15 +24,15 @@ typedef NS_ENUM(NSUInteger, HBAddPresetControllerMode) {
@interface HBAddPresetController ()
-@property (unsafe_unretained) IBOutlet NSTextField *name;
-@property (unsafe_unretained) IBOutlet NSTextField *desc;
+@property (nonatomic, unsafe_unretained) IBOutlet NSTextField *name;
+@property (nonatomic, unsafe_unretained) IBOutlet NSTextField *desc;
-@property (unsafe_unretained) IBOutlet NSPopUpButton *categories;
+@property (nonatomic, unsafe_unretained) IBOutlet NSPopUpButton *categories;
-@property (unsafe_unretained) IBOutlet NSPopUpButton *picSettingsPopUp;
-@property (unsafe_unretained) IBOutlet NSTextField *picWidth;
-@property (unsafe_unretained) IBOutlet NSTextField *picHeight;
-@property (unsafe_unretained) IBOutlet NSBox *picWidthHeightBox;
+@property (nonatomic, unsafe_unretained) IBOutlet NSPopUpButton *picSettingsPopUp;
+@property (nonatomic, unsafe_unretained) IBOutlet NSTextField *picWidth;
+@property (nonatomic, unsafe_unretained) IBOutlet NSTextField *picHeight;
+@property (nonatomic, unsafe_unretained) IBOutlet NSBox *picWidthHeightBox;
@property (nonatomic, strong) HBPreset *preset;
@property (nonatomic, strong) HBMutablePreset *mutablePreset;
diff --git a/macosx/HBAppDelegate.m b/macosx/HBAppDelegate.m
index d22d03ef6..dbc52facb 100644
--- a/macosx/HBAppDelegate.m
+++ b/macosx/HBAppDelegate.m
@@ -27,7 +27,7 @@
@property (nonatomic, strong) HBPresetsManager *presetsManager;
@property (nonatomic, strong) HBPresetsMenuBuilder *presetsMenuBuilder;
-@property (unsafe_unretained) IBOutlet NSMenu *presetsMenu;
+@property (nonatomic, unsafe_unretained) IBOutlet NSMenu *presetsMenu;
@property (nonatomic, strong) HBPreferencesController *preferencesController;
diff --git a/macosx/HBApplication.h b/macosx/HBApplication.h
index 2fbeab833..e3473001f 100644
--- a/macosx/HBApplication.h
+++ b/macosx/HBApplication.h
@@ -7,5 +7,4 @@
#import <Cocoa/Cocoa.h>
@interface HBApplication : NSApplication
-
@end
diff --git a/macosx/HBAudio.m b/macosx/HBAudio.m
index cdd929efb..093d70dff 100644
--- a/macosx/HBAudio.m
+++ b/macosx/HBAudio.m
@@ -54,7 +54,7 @@ NSString *HBAudioEncoderChangedNotification = @"HBAudioEncoderChangedNotificatio
#pragma mark - Data Source
-- (NSDictionary<NSString *, id> *)sourceTrackAtIndex:(NSUInteger)idx;
+- (NSDictionary<NSString *, id> *)sourceTrackAtIndex:(NSUInteger)idx
{
return self.sourceTracks[idx];
}
@@ -73,7 +73,7 @@ NSString *HBAudioEncoderChangedNotification = @"HBAudioEncoderChangedNotificatio
#pragma mark - Delegate
-- (void)track:(HBAudioTrack *)track didChangeSourceFrom:(NSUInteger)oldSourceIdx;
+- (void)track:(HBAudioTrack *)track didChangeSourceFrom:(NSUInteger)oldSourceIdx
{
// If the source was changed to None, remove the track
if (track.sourceTrackIdx == NONE_TRACK_INDEX)
@@ -321,7 +321,7 @@ fail:
return self.tracks[index];
}
-- (void)insertObject:(HBAudioTrack *)track inTracksAtIndex:(NSUInteger)index;
+- (void)insertObject:(HBAudioTrack *)track inTracksAtIndex:(NSUInteger)index
{
[[self.undo prepareWithInvocationTarget:self] removeObjectFromTracksAtIndex:index];
[self.tracks insertObject:track atIndex:index];
diff --git a/macosx/HBAudioController.h b/macosx/HBAudioController.h
index 1385d15d2..c1caf8c54 100644
--- a/macosx/HBAudioController.h
+++ b/macosx/HBAudioController.h
@@ -8,11 +8,13 @@
@class HBAudio;
-/**
- * HBAudioController
- */
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBAudioController : NSViewController
@property (nonatomic, readwrite, weak) HBAudio *audio;
@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBAudioDefaults.m b/macosx/HBAudioDefaults.m
index 538c06e22..0dbef621b 100644
--- a/macosx/HBAudioDefaults.m
+++ b/macosx/HBAudioDefaults.m
@@ -509,7 +509,7 @@ fail:
return self.tracksArray[index];
}
-- (void)insertObject:(HBAudioTrackPreset *)track inTracksArrayAtIndex:(NSUInteger)index;
+- (void)insertObject:(HBAudioTrackPreset *)track inTracksArrayAtIndex:(NSUInteger)index
{
[[self.undo prepareWithInvocationTarget:self] removeObjectFromTracksArrayAtIndex:index];
[self.tracksArray insertObject:track atIndex:index];
diff --git a/macosx/HBAudioDefaultsController.h b/macosx/HBAudioDefaultsController.h
index 63e18d515..8968713af 100644
--- a/macosx/HBAudioDefaultsController.h
+++ b/macosx/HBAudioDefaultsController.h
@@ -8,8 +8,13 @@
@class HBAudioDefaults;
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBAudioDefaultsController : NSWindowController
- (instancetype)initWithSettings:(HBAudioDefaults *)settings;
@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBAudioDefaultsController.m b/macosx/HBAudioDefaultsController.m
index 5fb7c04d9..b299875d7 100644
--- a/macosx/HBAudioDefaultsController.m
+++ b/macosx/HBAudioDefaultsController.m
@@ -17,10 +17,10 @@ static void *HBAudioDefaultsContext = &HBAudioDefaultsContext;
@property (nonatomic, readonly, strong) HBLanguagesSelection *languagesList;
-@property (unsafe_unretained) IBOutlet HBLanguageArrayController *tableController;
-@property (unsafe_unretained) IBOutlet NSButton *showAllButton;
+@property (nonatomic, unsafe_unretained) IBOutlet HBLanguageArrayController *tableController;
+@property (nonatomic, unsafe_unretained) IBOutlet NSButton *showAllButton;
-@property (unsafe_unretained) IBOutlet NSArrayController *tracksController;
+@property (nonatomic, unsafe_unretained) IBOutlet NSArrayController *tracksController;
@end
diff --git a/macosx/HBAudioTrack.m b/macosx/HBAudioTrack.m
index 512012911..c854d7fdc 100644
--- a/macosx/HBAudioTrack.m
+++ b/macosx/HBAudioTrack.m
@@ -45,7 +45,7 @@ NSString *keyAudioTrackLanguageIsoCode = @"keyAudioTrackLanguageIsoCode";
- (instancetype)initWithTrackIdx:(NSUInteger)index
container:(int)container
dataSource:(id<HBAudioTrackDataSource>)dataSource
- delegate:(id<HBAudioTrackDelegate>)delegate;
+ delegate:(id<HBAudioTrackDelegate>)delegate
{
self = [super init];
if (self)
diff --git a/macosx/HBChapterTitlesController.h b/macosx/HBChapterTitlesController.h
index 106261615..53d8a8b31 100644
--- a/macosx/HBChapterTitlesController.h
+++ b/macosx/HBChapterTitlesController.h
@@ -8,11 +8,13 @@
@class HBJob;
-/**
- * HBChapterTitlesController
- */
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBChapterTitlesController : NSViewController
@property (nonatomic, readwrite, weak) HBJob *job;
@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBChapterTitlesController.m b/macosx/HBChapterTitlesController.m
index ed0bee9bb..88b8cc954 100644
--- a/macosx/HBChapterTitlesController.m
+++ b/macosx/HBChapterTitlesController.m
@@ -43,7 +43,7 @@
// <one>
// <John said, "Hello there.">
// <three>
-+ (nullable NSArray<NSArray<NSString *> *> *)HB_arrayWithContentsOfCSVURL:(NSURL *)url;
++ (nullable NSArray<NSArray<NSString *> *> *)HB_arrayWithContentsOfCSVURL:(NSURL *)url
{
NSString *str = [[NSString alloc] initWithContentsOfURL:url encoding:NSUTF8StringEncoding error:NULL];
@@ -157,7 +157,7 @@
@interface HBChapterTitlesController () <NSTableViewDataSource, NSTableViewDelegate>
-@property (weak) IBOutlet NSTableView *table;
+@property (nonatomic, weak) IBOutlet NSTableView *table;
@property (nonatomic, readwrite, strong) NSArray<HBChapter *> *chapterTitles;
@end
diff --git a/macosx/HBController.h b/macosx/HBController.h
index fa8a9ac42..4b951fd90 100644
--- a/macosx/HBController.h
+++ b/macosx/HBController.h
@@ -12,6 +12,8 @@
@class HBJob;
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBController : NSWindowController
- (instancetype)initWithDelegate:(HBAppDelegate *)delegate queue:(HBQueue *)queue presetsManager:(HBPresetsManager *)manager;
@@ -42,5 +44,7 @@
- (IBAction)deletePreset:(id)sender;
- (IBAction)reloadPreset:(id)sender;
-
@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBController.m b/macosx/HBController.m
index f10d771f3..6fed7ebd9 100644
--- a/macosx/HBController.m
+++ b/macosx/HBController.m
@@ -160,7 +160,7 @@ static void *HBControllerScanCoreContext = &HBControllerScanCoreContext;
@implementation HBController
-- (instancetype)initWithDelegate:(HBAppDelegate *)delegate queue:(HBQueue *)queue presetsManager:(HBPresetsManager *)manager;
+- (instancetype)initWithDelegate:(HBAppDelegate *)delegate queue:(HBQueue *)queue presetsManager:(HBPresetsManager *)manager
{
self = [super initWithWindowNibName:@"MainWindow"];
if (self)
@@ -394,7 +394,7 @@ static void *HBControllerScanCoreContext = &HBControllerScanCoreContext;
[self _touchBar_validateUserInterfaceItems];
}
NSUInteger count = self.queue.pendingItemsCount;
- self.showQueueToolbarItem.badgeValue = count ? @(count).stringValue : nil;
+ self.showQueueToolbarItem.badgeValue = count ? @(count).stringValue : @"";
}
- (void)updateToolbarButtonsStateForScanCore:(HBState)state
@@ -592,7 +592,7 @@ static void *HBControllerScanCoreContext = &HBControllerScanCoreContext;
{
if ([NSUserDefaults.standardUserDefaults boolForKey:HBShowOpenPanelAtLaunch])
{
- [self browseSources:nil];
+ [self browseSources:self];
}
}
}
@@ -1168,7 +1168,7 @@ static void *HBControllerScanCoreContext = &HBControllerScanCoreContext;
[self doAddTitlesToQueue:titles];
}
-- (void)doAddTitlesToQueue:(NSArray<HBTitle *> *)titles;
+- (void)doAddTitlesToQueue:(NSArray<HBTitle *> *)titles
{
NSMutableArray<HBJob *> *jobs = [[NSMutableArray alloc] init];
BOOL fileExists = NO;
@@ -1321,7 +1321,7 @@ static void *HBControllerScanCoreContext = &HBControllerScanCoreContext;
}
}
-- (void)reloadPreset:(id)sender;
+- (void)reloadPreset:(id)sender
{
// Reload the currently selected preset if it is selected.
if (self.currentPreset != NULL)
diff --git a/macosx/HBCore.m b/macosx/HBCore.m
index d784b92c4..c720c5795 100644
--- a/macosx/HBCore.m
+++ b/macosx/HBCore.m
@@ -391,7 +391,7 @@ typedef void (^HBCoreCleanupHandler)(void);
hb_image_close(&image);
}
- if (angle || flipped)
+ if (img && (angle || flipped))
{
CGImageRef rotatedImg = CGImageRotated(img, angle, flipped);
CGImageRelease(img);
@@ -410,7 +410,7 @@ typedef void (^HBCoreCleanupHandler)(void);
#pragma mark - Encodes
-- (void)encodeJob:(HBJob *)job progressHandler:(HBCoreProgressHandler)progressHandler completionHandler:(HBCoreCompletionHandler)completionHandler;
+- (void)encodeJob:(HBJob *)job progressHandler:(HBCoreProgressHandler)progressHandler completionHandler:(HBCoreCompletionHandler)completionHandler
{
NSAssert(self.state == HBStateIdle, @"[HBCore encodeJob:] called while another scan or encode already in progress");
NSAssert(job, @"[HBCore encodeJob:] called with nil job");
diff --git a/macosx/HBDVDDetector.h b/macosx/HBDVDDetector.h
index a5bb7beae..27b7fcf25 100644
--- a/macosx/HBDVDDetector.h
+++ b/macosx/HBDVDDetector.h
@@ -25,4 +25,5 @@ NS_ASSUME_NONNULL_BEGIN
@end
-NS_ASSUME_NONNULL_END \ No newline at end of file
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBDockTextField.h b/macosx/HBDockTextField.h
index bad413a9c..0961311be 100644
--- a/macosx/HBDockTextField.h
+++ b/macosx/HBDockTextField.h
@@ -6,6 +6,8 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBDockTextField : NSTextField
@property (nonatomic, copy) NSString *textToDisplay;
@@ -15,3 +17,6 @@
- (void)changeGradientColors:(NSColor *)startColor endColor:(NSColor *)endColor;
@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBDockTile.h b/macosx/HBDockTile.h
index 434025442..3fcc61cc4 100644
--- a/macosx/HBDockTile.h
+++ b/macosx/HBDockTile.h
@@ -6,6 +6,8 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBDockTile : NSObject
- (instancetype)init NS_UNAVAILABLE;
@@ -31,3 +33,6 @@
- (void)updateDockIcon:(double)progress hours:(NSInteger)hours minutes:(NSInteger)minutes seconds:(NSInteger)seconds;
@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBEncodingProgressHUDController.h b/macosx/HBEncodingProgressHUDController.h
index e147d09c4..f8a829588 100644
--- a/macosx/HBEncodingProgressHUDController.h
+++ b/macosx/HBEncodingProgressHUDController.h
@@ -7,6 +7,8 @@
#import <Cocoa/Cocoa.h>
#import "HBHUD.h"
+NS_ASSUME_NONNULL_BEGIN
+
@protocol HBEncodingProgressHUDControllerDelegate <NSObject>
- (void)cancelEncoding;
@@ -17,7 +19,10 @@
@property (nonatomic, nullable, assign) id<HBEncodingProgressHUDControllerDelegate> delegate;
-@property (nonatomic, nonnull) NSString *info;
+@property (nonatomic) NSString *info;
@property (nonatomic) double progress;
@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBEncodingProgressHUDController.m b/macosx/HBEncodingProgressHUDController.m
index a78ed85a1..d2a7c25ca 100644
--- a/macosx/HBEncodingProgressHUDController.m
+++ b/macosx/HBEncodingProgressHUDController.m
@@ -8,8 +8,8 @@
@interface HBEncodingProgressHUDController ()
-@property (weak) IBOutlet NSProgressIndicator *progressIndicator;
-@property (weak) IBOutlet NSTextField *infoLabel;
+@property (nonatomic, weak) IBOutlet NSProgressIndicator *progressIndicator;
+@property (nonatomic, weak) IBOutlet NSTextField *infoLabel;
@end
diff --git a/macosx/HBExceptionAlertController.h b/macosx/HBExceptionAlertController.h
index aaf49647c..c6c0ee4b2 100644
--- a/macosx/HBExceptionAlertController.h
+++ b/macosx/HBExceptionAlertController.h
@@ -14,8 +14,8 @@ typedef NS_ENUM(NSUInteger, HBExceptionAlertControllerResult) {
@interface HBExceptionAlertController : NSWindowController
// Properties are used by bindings
-@property (copy) NSString *exceptionMessage;
-@property (copy) NSAttributedString *exceptionBacktrace;
+@property (nonatomic, copy) NSString *exceptionMessage;
+@property (nonatomic, copy) NSAttributedString *exceptionBacktrace;
- (IBAction)btnCrashClicked:(id)sender;
- (IBAction)btnContinueClicked:(id)sender;
diff --git a/macosx/HBFilters+UIAdditions.m b/macosx/HBFilters+UIAdditions.m
index 42f249e43..b5472a42e 100644
--- a/macosx/HBFilters+UIAdditions.m
+++ b/macosx/HBFilters+UIAdditions.m
@@ -68,7 +68,14 @@ static NSDictionary * filterParamsToNamesDict(hb_filter_param_t * (f)(int), int
- (id)transformedValue:(id)value
{
- return [[self.dict allKeysForObject:value] firstObject];
+ if (value)
+ {
+ return [[self.dict allKeysForObject:value] firstObject];
+ }
+ else
+ {
+ return nil;
+ }
}
+ (BOOL)allowsReverseTransformation
diff --git a/macosx/HBFiltersViewController.h b/macosx/HBFiltersViewController.h
index 88beefe66..d66c90b8f 100644
--- a/macosx/HBFiltersViewController.h
+++ b/macosx/HBFiltersViewController.h
@@ -8,8 +8,13 @@
@class HBFilters;
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBFiltersViewController : NSViewController
@property (nonatomic, readwrite, weak) HBFilters *filters;
@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBImageUtilities.h b/macosx/HBImageUtilities.h
index 6258d5d4f..beb19593f 100644
--- a/macosx/HBImageUtilities.h
+++ b/macosx/HBImageUtilities.h
@@ -6,6 +6,11 @@
#import <Foundation/Foundation.h>
-CGImageRef CreateScaledCGImageFromCGImage(CGImageRef image, CGFloat thumbnailHeight);
-CGImageRef CGImageRotated(CGImageRef imgRef, CGFloat angle, BOOL flipped) CF_RETURNS_RETAINED;
+CF_ASSUME_NONNULL_BEGIN
+
+CGImageRef __nullable CreateScaledCGImageFromCGImage(CGImageRef image, CGFloat thumbnailHeight);
+CGImageRef __nullable CGImageRotated(CGImageRef imgRef, CGFloat angle, BOOL flipped) CF_RETURNS_RETAINED;
CGColorSpaceRef copyColorSpace(int primaries, int transfer, int matrix);
+
+CF_ASSUME_NONNULL_END
+
diff --git a/macosx/HBJob+Private.h b/macosx/HBJob+Private.h
index 839267253..1f8c26ffd 100644
--- a/macosx/HBJob+Private.h
+++ b/macosx/HBJob+Private.h
@@ -1,14 +1,14 @@
-//
-// HBJob+HBJob_Private.h
-// HandBrake
-//
-// Created by Damiano Galassi on 29/10/16.
-//
-//
+/* HBJob+HBJob_Private.h $
+
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr/>.
+ It may be used under the terms of the GNU General Public License. */
#import <HandBrakeKit/HandBrakeKit.h>
#import "HBSecurityAccessToken.h"
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBJob (Private) <HBSecurityScope>
@end
@@ -71,3 +71,5 @@
@end
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBJob.m b/macosx/HBJob.m
index 4d52735c7..d3b4de8b8 100644
--- a/macosx/HBJob.m
+++ b/macosx/HBJob.m
@@ -71,6 +71,8 @@ NSString *HBChaptersChangedNotification = @"HBChaptersChangedNotification";
_chapterTitles = [title.chapters copy];
+ _presetName = @"";
+
[self applyPreset:preset];
}
diff --git a/macosx/HBLanguagesSelection.h b/macosx/HBLanguagesSelection.h
index 0d57fba17..100de9d13 100644
--- a/macosx/HBLanguagesSelection.h
+++ b/macosx/HBLanguagesSelection.h
@@ -59,7 +59,7 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic, readwrite) BOOL isDragginEnabled;
-@property (unsafe_unretained) IBOutlet NSTableView *tableView;
+@property (nonatomic, unsafe_unretained) IBOutlet NSTableView *tableView;
@end
diff --git a/macosx/HBMutablePreset.m b/macosx/HBMutablePreset.m
index e773065ad..0fddc6a40 100644
--- a/macosx/HBMutablePreset.m
+++ b/macosx/HBMutablePreset.m
@@ -15,7 +15,7 @@
@implementation HBMutablePreset
-- (void)setObject:(id)obj forKey:(NSString *)key;
+- (void)setObject:(id)obj forKey:(NSString *)key
{
self.content[key] = obj;
}
diff --git a/macosx/HBOutputFileWriter.m b/macosx/HBOutputFileWriter.m
index bbc802492..20b2e5084 100644
--- a/macosx/HBOutputFileWriter.m
+++ b/macosx/HBOutputFileWriter.m
@@ -13,7 +13,7 @@
NSDateFormatter *_formatter;
}
-- (nullable instancetype)initWithFileURL:(NSURL *)url;
+- (nullable instancetype)initWithFileURL:(NSURL *)url
{
self = [super init];
if (self)
diff --git a/macosx/HBPictureController.h b/macosx/HBPictureController.h
index 577937dfd..2f03cf68a 100644
--- a/macosx/HBPictureController.h
+++ b/macosx/HBPictureController.h
@@ -8,9 +8,14 @@
@class HBPicture;
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBPictureController : NSWindowController <NSWindowDelegate>
@property (nonatomic, readwrite, strong) HBPicture *picture;
@property (nonatomic, readwrite, assign) NSWindowController *previewController;
@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBPictureHUDController.m b/macosx/HBPictureHUDController.m
index d87e1290f..bb3168112 100644
--- a/macosx/HBPictureHUDController.m
+++ b/macosx/HBPictureHUDController.m
@@ -10,16 +10,16 @@
@interface HBPictureHUDController ()
-@property (weak) IBOutlet NSTextField *scaleLabel;
-@property (weak) IBOutlet NSTextField *infoLabel;
+@property (nonatomic, weak) IBOutlet NSTextField *scaleLabel;
+@property (nonatomic, weak) IBOutlet NSTextField *infoLabel;
-@property (weak) IBOutlet NSSlider *slider;
+@property (nonatomic, weak) IBOutlet NSSlider *slider;
-@property (weak) IBOutlet NSPopUpButton *durationPopUp;
-@property (weak) IBOutlet NSButton *scaleToScreenButton;
+@property (nonatomic, weak) IBOutlet NSPopUpButton *durationPopUp;
+@property (nonatomic, weak) IBOutlet NSButton *scaleToScreenButton;
-@property (weak) IBOutlet NSTextField *durationLabel;
-@property (weak) IBOutlet NSTextField *durationUnitLabel;
+@property (nonatomic, weak) IBOutlet NSTextField *durationLabel;
+@property (nonatomic, weak) IBOutlet NSTextField *durationUnitLabel;
@property (nonatomic) BOOL fitToView;
@property (nonatomic) BOOL ignoreUpdates;
diff --git a/macosx/HBPictureViewController.h b/macosx/HBPictureViewController.h
index 13802e803..95795d576 100644
--- a/macosx/HBPictureViewController.h
+++ b/macosx/HBPictureViewController.h
@@ -8,8 +8,13 @@
@class HBPicture;
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBPictureViewController : NSViewController
@property (nonatomic, readwrite, weak) HBPicture *picture;
@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBPictureViewController.m b/macosx/HBPictureViewController.m
index 52beb8013..ae18cf38f 100644
--- a/macosx/HBPictureViewController.m
+++ b/macosx/HBPictureViewController.m
@@ -12,8 +12,8 @@ static void *HBPictureViewControllerContext = &HBPictureViewControllerContext;
@interface HBPictureViewController ()
-@property (weak) IBOutlet NSStepper *widthStepper;
-@property (weak) IBOutlet NSStepper *heightStepper;
+@property (nonatomic, weak) IBOutlet NSStepper *widthStepper;
+@property (nonatomic, weak) IBOutlet NSStepper *heightStepper;
@property (nonatomic, readwrite) NSColor *labelColor;
diff --git a/macosx/HBPlayer.h b/macosx/HBPlayer.h
index 77d6ada6b..bbb775986 100644
--- a/macosx/HBPlayer.h
+++ b/macosx/HBPlayer.h
@@ -54,4 +54,5 @@ NS_ASSUME_NONNULL_BEGIN
@end
-NS_ASSUME_NONNULL_END \ No newline at end of file
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBPlayerHUDController.h b/macosx/HBPlayerHUDController.h
index 7becadb64..a66dc4dd1 100644
--- a/macosx/HBPlayerHUDController.h
+++ b/macosx/HBPlayerHUDController.h
@@ -8,6 +8,8 @@
#import "HBPlayer.h"
#import "HBHUD.h"
+NS_ASSUME_NONNULL_BEGIN
+
@protocol HBPlayerHUDControllerDelegate <NSObject>
- (void)stopPlayer;
@@ -17,7 +19,9 @@
@interface HBPlayerHUDController : NSViewController <HBHUD>
@property (nonatomic, nullable, assign) id<HBPlayerHUDControllerDelegate> delegate;
-
@property (nonatomic, nullable) id<HBPlayer> player;
@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBPlayerHUDController.m b/macosx/HBPlayerHUDController.m
index 473b5ce0a..5fa0e36ce 100644
--- a/macosx/HBPlayerHUDController.m
+++ b/macosx/HBPlayerHUDController.m
@@ -9,15 +9,15 @@
@interface HBPlayerHUDController ()
-@property (weak) IBOutlet NSButton *playButton;
-@property (weak) IBOutlet NSSlider *slider;
+@property (nonatomic, weak) IBOutlet NSButton *playButton;
+@property (nonatomic, weak) IBOutlet NSSlider *slider;
-@property (weak) IBOutlet NSSlider *volumeSlider;
+@property (nonatomic, weak) IBOutlet NSSlider *volumeSlider;
-@property (weak) IBOutlet NSTextField *currentTimeLabel;
-@property (weak) IBOutlet NSTextField *remaingTimeLabel;
+@property (nonatomic, weak) IBOutlet NSTextField *currentTimeLabel;
+@property (nonatomic, weak) IBOutlet NSTextField *remaingTimeLabel;
-@property (weak) IBOutlet NSPopUpButton *tracksSelection;
+@property (nonatomic, weak) IBOutlet NSPopUpButton *tracksSelection;
@property (nonatomic, readwrite) id rateObserver;
@property (nonatomic, readwrite) id periodicObserver;
@@ -338,7 +338,7 @@
return YES;
}
-- (BOOL)HB_scrollWheel:(NSEvent *)theEvent;
+- (BOOL)HB_scrollWheel:(NSEvent *)theEvent
{
if (theEvent.deltaY < 0)
{
@@ -466,7 +466,7 @@ static NSTouchBarItemIdentifier HBTouchBarTimeSlider = @"fr.handbrake.timeSlider
slider.maxValue = duration;
}
-- (NSString *)_timeToString:(NSTimeInterval)timeInSeconds negative:(BOOL)negative;
+- (NSString *)_timeToString:(NSTimeInterval)timeInSeconds negative:(BOOL)negative
{
UInt16 seconds = (UInt16)fmod(timeInSeconds, 60.0);
UInt16 minutes = (UInt16)fmod(timeInSeconds / 60.0, 60.0);
diff --git a/macosx/HBPlayerTrack.h b/macosx/HBPlayerTrack.h
index 950fdfdda..fef5279cc 100644
--- a/macosx/HBPlayerTrack.h
+++ b/macosx/HBPlayerTrack.h
@@ -18,4 +18,5 @@ NS_ASSUME_NONNULL_BEGIN
@end
-NS_ASSUME_NONNULL_END \ No newline at end of file
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBPreferencesController.m b/macosx/HBPreferencesController.m
index 7eb0dfb74..adecdbcf3 100644
--- a/macosx/HBPreferencesController.m
+++ b/macosx/HBPreferencesController.m
@@ -57,8 +57,8 @@ NSString * const HBQueueAutoClearCompletedItems = @"HBQueueAutoClearCompletedIt
IBOutlet NSTextField * fSendEncodeToAppField;
}
-@property (unsafe_unretained) IBOutlet NSTokenField *formatTokenField;
-@property (unsafe_unretained) IBOutlet NSTokenField *builtInTokenField;
+@property (nonatomic, unsafe_unretained) IBOutlet NSTokenField *formatTokenField;
+@property (nonatomic, unsafe_unretained) IBOutlet NSTokenField *builtInTokenField;
@property (nonatomic, readonly, strong) NSArray *buildInFormatTokens;
@property (nonatomic, strong) NSArray *matches;
diff --git a/macosx/HBPreset.m b/macosx/HBPreset.m
index 98d424253..917657c74 100644
--- a/macosx/HBPreset.m
+++ b/macosx/HBPreset.m
@@ -53,7 +53,7 @@
return self;
}
-- (instancetype)initWithName:(NSString *)title content:(NSDictionary *)content builtIn:(BOOL)builtIn;
+- (instancetype)initWithName:(NSString *)title content:(NSDictionary *)content builtIn:(BOOL)builtIn
{
self = [self init];
if (self)
@@ -69,7 +69,7 @@
return self;
}
-- (instancetype)initWithCategoryName:(NSString *)title builtIn:(BOOL)builtIn;
+- (instancetype)initWithCategoryName:(NSString *)title builtIn:(BOOL)builtIn
{
self = [self init];
if (self)
@@ -110,7 +110,7 @@
return self;
}
-- (nullable instancetype)initWithContentsOfURL:(NSURL *)url error:(NSError **)outError
+- (nullable instancetype)initWithContentsOfURL:(NSURL *)url error:(NSError * __autoreleasing *)outError
{
NSParameterAssert(url);
@@ -246,7 +246,7 @@
return output;
}
-- (BOOL)writeToURL:(NSURL *)url atomically:(BOOL)atomically format:(HBPresetFormat)format removeRoot:(BOOL)removeRoot;
+- (BOOL)writeToURL:(NSURL *)url atomically:(BOOL)atomically format:(HBPresetFormat)format removeRoot:(BOOL)removeRoot
{
BOOL success = NO;
NSArray *presetList;
diff --git a/macosx/HBPresetsManager.m b/macosx/HBPresetsManager.m
index cb90e5835..e5b3b3173 100644
--- a/macosx/HBPresetsManager.m
+++ b/macosx/HBPresetsManager.m
@@ -124,7 +124,7 @@ typedef NS_ENUM(NSUInteger, HBPresetLoadingResult) {
HBPresetLoadingResultFailed
};
-- (NSDictionary *)dictionaryWithPresetsAtURL:(NSURL *)url backup:(BOOL)backup result:(HBPresetLoadingResult *)result;
+- (NSDictionary *)dictionaryWithPresetsAtURL:(NSURL *)url backup:(BOOL)backup result:(HBPresetLoadingResult *)result
{
NSData *presetData = [[NSData alloc] initWithContentsOfURL:url];
@@ -180,7 +180,7 @@ typedef NS_ENUM(NSUInteger, HBPresetLoadingResult) {
return nil;
}
-- (void)loadPresetsFromURL:(NSURL *)url;
+- (void)loadPresetsFromURL:(NSURL *)url
{
HBPresetLoadingResult result;
NSDictionary *presetsDict;
diff --git a/macosx/HBPresetsMenuBuilder.h b/macosx/HBPresetsMenuBuilder.h
index d8c340bb4..e3c9d67a6 100644
--- a/macosx/HBPresetsMenuBuilder.h
+++ b/macosx/HBPresetsMenuBuilder.h
@@ -8,6 +8,8 @@
@import HandBrakeKit;
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBPresetsMenuBuilder : NSObject
@property (nonatomic, readonly) NSMenu *menu;
@@ -20,3 +22,6 @@
- (void)build;
@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBPreviewController.h b/macosx/HBPreviewController.h
index ca0cdefbc..a28103ded 100644
--- a/macosx/HBPreviewController.h
+++ b/macosx/HBPreviewController.h
@@ -10,11 +10,15 @@
@class HBPicture;
@class HBController;
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBPreviewController : NSWindowController <NSWindowDelegate>
-@property (nonatomic, strong) HBPreviewGenerator *generator;
-@property (nonatomic, strong) HBPicture *picture;
+@property (nonatomic, strong, nullable) HBPreviewGenerator *generator;
+@property (nonatomic, strong, nullable) HBPicture *picture;
@property (nonatomic, assign) HBController *documentController;
@end
+
+NS_ASSUME_NONNULL_END
diff --git a/macosx/HBPreviewController.m b/macosx/HBPreviewController.m
index 643c1c28d..e3d9c72af 100644
--- a/macosx/HBPreviewController.m
+++ b/macosx/HBPreviewController.m
@@ -43,7 +43,7 @@
@property (nonatomic) HBPictureController *pictureSettingsWindow;
@property (nonatomic) NSPoint windowCenterPoint;
-@property (weak) IBOutlet HBPreviewView *previewView;
+@property (nonatomic, weak) IBOutlet HBPreviewView *previewView;
@end
@@ -522,7 +522,7 @@
[self switchStateToHUD:self.pictureHUD];
}
-- (void)showAlert:(NSURL *)fileURL;
+- (void)showAlert:(NSURL *)fileURL
{
NSAlert *alert = [[NSAlert alloc] init];
alert.messageText = NSLocalizedString(@"HandBrake can't open the preview.", @"Preview -> live preview alert message");
@@ -539,7 +539,7 @@
}];
}
-- (void)setUpPlaybackOfURL:(NSURL *)fileURL playerClass:(Class)class;
+- (void)setUpPlaybackOfURL:(NSURL *)fileURL playerClass:(Class)class
{
NSArray<Class> *availablePlayerClasses = @[[HBAVPlayer class]];
@@ -615,7 +615,7 @@
- (void)keyDown:(NSEvent *)event
{
- if ([self.currentHUD HB_keyDown:event] == NO)
+ if (self.generator && [self.currentHUD HB_keyDown:event] == NO)
{
[super keyDown:event];
}
@@ -623,7 +623,7 @@
- (void)scrollWheel:(NSEvent *)event
{
- if ([self.currentHUD HB_scrollWheel:event] == NO)
+ if (self.generator && [self.currentHUD HB_scrollWheel:event] == NO)
{
[super scrollWheel:event];
}
diff --git a/macosx/HBPreviewGenerator.m b/macosx/HBPreviewGenerator.m
index 0ea12d806..91dcfb6de 100644
--- a/macosx/HBPreviewGenerator.m
+++ b/macosx/HBPreviewGenerator.m
@@ -238,7 +238,7 @@
* @param index picture index in title.
* @param duration the duration in seconds of the preview movie.
*/
-- (BOOL) createMovieAsyncWithImageAtIndex: (NSUInteger) index duration: (NSUInteger) seconds;
+- (BOOL) createMovieAsyncWithImageAtIndex: (NSUInteger) index duration: (NSUInteger) seconds
{
// return if an encoding if already started.
if (self.core || index >= self.imagesCount)
diff --git a/macosx/HBPreviewView.m b/macosx/HBPreviewView.m
index d906777c9..518f82061 100644
--- a/macosx/HBPreviewView.m
+++ b/macosx/HBPreviewView.m
@@ -284,7 +284,7 @@
return resultSize;
}
-#pragma MARK: - Accessibility
+#pragma mark - Accessibility
- (BOOL)isAccessibilityElement
{
diff --git a/macosx/HBPreviewViewController.h b/macosx/HBPreviewViewController.h
index d3101a540..3b4c0b111 100644
--- a/macosx/HBPreviewViewController.h
+++ b/macosx/HBPreviewViewController.h
@@ -10,6 +10,8 @@
@class HBPreviewGenerator;
@class HBPreviewController;
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBPreviewViewController : NSViewController
@property (nonatomic, readwrite, weak, nullable) HBPreviewGenerator *generator;
@@ -17,3 +19,6 @@
- (void)update;
@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBPreviewViewController.m b/macosx/HBPreviewViewController.m
index ca63d424a..2890d3ecd 100644
--- a/macosx/HBPreviewViewController.m
+++ b/macosx/HBPreviewViewController.m
@@ -83,7 +83,7 @@
[self updatePicture];
}
-#pragma MARK: - HUD
+#pragma mark - HUD
- (void)mouseEntered:(NSEvent *)theEvent
{
@@ -154,7 +154,7 @@
}
}
-#pragma MARK: - Preview index
+#pragma mark - Preview index
- (void)setSelectedIndex:(NSInteger)selectedIndex
{
diff --git a/macosx/HBQueue.h b/macosx/HBQueue.h
index 6cbc9f4ce..6a9f4e4cb 100644
--- a/macosx/HBQueue.h
+++ b/macosx/HBQueue.h
@@ -8,7 +8,6 @@
#import "HBDistributedArray.h"
#import "HBQueueItem.h"
-#import "HBJobOutputFileWriter.h"
NS_ASSUME_NONNULL_BEGIN
diff --git a/macosx/HBQueue.m b/macosx/HBQueue.m
index bd6f74490..49fed88c1 100644
--- a/macosx/HBQueue.m
+++ b/macosx/HBQueue.m
@@ -9,6 +9,7 @@
#import "HBPreferencesKeys.h"
#import "NSArray+HBAdditions.h"
+#import "HBJobOutputFileWriter.h"
static void *HBQueueContext = &HBQueueContext;
@@ -107,7 +108,7 @@ NSString * const HBQueueItemNotificationItemKey = @"HBQueueItemNotificationItemK
[self addJobs:@[item]];
}
-- (void)addJobs:(NSArray<HBJob *> *)jobs;
+- (void)addJobs:(NSArray<HBJob *> *)jobs
{
NSParameterAssert(jobs);
@@ -628,7 +629,7 @@ NSString * const HBQueueItemNotificationItemKey = @"HBQueueItemNotificationItemK
[self.items commit];
}
-- (void)completedItem:(HBQueueItem *)item result:(HBCoreResult)result;
+- (void)completedItem:(HBQueueItem *)item result:(HBCoreResult)result
{
NSParameterAssert(item);
[self.items beginTransaction];
diff --git a/macosx/HBQueueController.m b/macosx/HBQueueController.m
index 4de78e300..e49a53b11 100644
--- a/macosx/HBQueueController.m
+++ b/macosx/HBQueueController.m
@@ -22,7 +22,7 @@
@interface HBQueueController () <NSUserNotificationCenterDelegate, HBQueueTableViewControllerDelegate, HBQueueDetailsViewControllerDelegate>
-@property (weak) IBOutlet NSSplitView *splitView;
+@property (nonatomic, weak) IBOutlet NSSplitView *splitView;
@property (nonatomic) NSSplitViewController *splitViewController;
@property (nonatomic) HBQueueTableViewController *tableViewController;
@property (nonatomic) NSViewController *containerViewController;
@@ -329,7 +329,7 @@
return item.state == HBQueueItemStateWorking;
}];
- if ([workingItems containsObject:self.queue.currentItem])
+ if (self.queue.currentItem && [workingItems containsObject:self.queue.currentItem])
{
NSString *alertTitle = [NSString stringWithFormat:NSLocalizedString(@"Stop This Encode and Remove It?", @"Queue Stop Alert -> stop and remove message")];
@@ -876,7 +876,7 @@ static NSTouchBarItemIdentifier HBTouchBarPause = @"fr.handbrake.pause";
return nil;
}
-- (void)_touchBar_updateButtonsState;
+- (void)_touchBar_updateButtonsState
{
NSButton *ripButton = (NSButton *)[[self.touchBar itemForIdentifier:HBTouchBarRip] view];
NSButton *pauseButton = (NSButton *)[[self.touchBar itemForIdentifier:HBTouchBarPause] view];
diff --git a/macosx/HBQueueInfoViewController.m b/macosx/HBQueueInfoViewController.m
index 0521ccc04..583eb3cfc 100644
--- a/macosx/HBQueueInfoViewController.m
+++ b/macosx/HBQueueInfoViewController.m
@@ -9,12 +9,12 @@
@interface HBQueueInfoViewController ()
-@property (weak) IBOutlet NSView *statisticsHeader;
-@property (weak) IBOutlet NSTextField *statisticsLabel;
-@property (weak) IBOutlet NSTextField *summaryLabel;
-@property (weak) IBOutlet NSScrollView *scrollView;
+@property (nonatomic, weak) IBOutlet NSView *statisticsHeader;
+@property (nonatomic, weak) IBOutlet NSTextField *statisticsLabel;
+@property (nonatomic, weak) IBOutlet NSTextField *summaryLabel;
+@property (nonatomic, weak) IBOutlet NSScrollView *scrollView;
-@property (weak) id<HBQueueDetailsViewControllerDelegate> delegate;
+@property (nonatomic, weak) id<HBQueueDetailsViewControllerDelegate> delegate;
@property (nonatomic) BOOL canReset;
diff --git a/macosx/HBQueueItem.m b/macosx/HBQueueItem.m
index 6eb82d2b0..29aef3530 100644
--- a/macosx/HBQueueItem.m
+++ b/macosx/HBQueueItem.m
@@ -203,8 +203,11 @@ static NSDictionary *shortHeightAttr;
{
[self resumedAtDate:endedDate];
}
- self.encodeDuration = [self.endedDate timeIntervalSinceDate:self.startedDate];
- self.encodeDuration -= self.pauseDuration;
+ if (endedDate && self.startedDate)
+ {
+ self.encodeDuration = [self.endedDate timeIntervalSinceDate:self.startedDate];
+ self.encodeDuration -= self.pauseDuration;
+ }
[self.completeOutputURL removeCachedResourceValueForKey:NSURLFileSizeKey];
NSDictionary<NSURLResourceKey, id> *values = [self.completeOutputURL resourceValuesForKeys:@[NSURLFileSizeKey] error:NULL];
diff --git a/macosx/HBQueueMultiSelectionViewController.m b/macosx/HBQueueMultiSelectionViewController.m
index b1476e0ad..f0e5b63f0 100644
--- a/macosx/HBQueueMultiSelectionViewController.m
+++ b/macosx/HBQueueMultiSelectionViewController.m
@@ -8,7 +8,7 @@
@interface HBQueueMultiSelectionViewController ()
-@property (weak) IBOutlet NSTextField *label;
+@property (nonatomic, weak) IBOutlet NSTextField *label;
@end
diff --git a/macosx/HBQueueTableViewController.m b/macosx/HBQueueTableViewController.m
index 2f3931c8e..034e03487 100644
--- a/macosx/HBQueueTableViewController.m
+++ b/macosx/HBQueueTableViewController.m
@@ -17,9 +17,9 @@
@property (nonatomic, weak, readonly) HBQueue *queue;
@property (nonatomic) NSArray<HBQueueItem *> *dragNodesArray;
-@property (strong) id<HBQueueTableViewControllerDelegate> delegate;
+@property (nonatomic, strong) id<HBQueueTableViewControllerDelegate> delegate;
-@property (weak) IBOutlet HBTableView *tableView;
+@property (nonatomic, weak) IBOutlet HBTableView *tableView;
@end
@@ -266,7 +266,7 @@
[self removeSelectedQueueItem:tableView];
}
-- (BOOL)tableView:(NSTableView *)tableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard;
+- (BOOL)tableView:(NSTableView *)tableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard
{
NSArray<HBQueueItem *> *items = [self.queue.items objectsAtIndexes:rowIndexes];
// Dragging is only allowed of the pending items.
@@ -297,7 +297,7 @@
// We do not let the user drop a pending item before or *above*
// already finished or currently encoding items.
- NSInteger encodingRow = [self.queue.items indexOfObject:self.queue.currentItem];
+ NSInteger encodingRow = self.queue.currentItem ? [self.queue.items indexOfObject:self.queue.currentItem] : NSNotFound;
if (encodingRow != NSNotFound && row <= encodingRow)
{
return NSDragOperationNone;
diff --git a/macosx/HBSecurityAccessToken.m b/macosx/HBSecurityAccessToken.m
index 1a5023197..67e1b78be 100644
--- a/macosx/HBSecurityAccessToken.m
+++ b/macosx/HBSecurityAccessToken.m
@@ -13,7 +13,7 @@
@implementation HBSecurityAccessToken
-- (instancetype)initWithObject:(id<HBSecurityScope>)object;
+- (instancetype)initWithObject:(id<HBSecurityScope>)object
{
self = [super init];
if (self)
diff --git a/macosx/HBSubtitles.m b/macosx/HBSubtitles.m
index c31ed233c..485603560 100644
--- a/macosx/HBSubtitles.m
+++ b/macosx/HBSubtitles.m
@@ -82,7 +82,7 @@ extern NSString *keySubTrackExternalFileURLBookmark;
#pragma mark - Data Source
-- (NSDictionary<NSString *, id> *)sourceTrackAtIndex:(NSUInteger)idx;
+- (NSDictionary<NSString *, id> *)sourceTrackAtIndex:(NSUInteger)idx
{
return self.sourceTracks[idx];
}
@@ -101,7 +101,7 @@ extern NSString *keySubTrackExternalFileURLBookmark;
#pragma mark - Delegate
-- (void)track:(HBSubtitlesTrack *)track didChangeSourceFrom:(NSUInteger)oldSourceIdx;
+- (void)track:(HBSubtitlesTrack *)track didChangeSourceFrom:(NSUInteger)oldSourceIdx
{
// If the source was changed to None, remove the track
if (track.sourceTrackIdx == NONE_TRACK_INDEX)
@@ -553,7 +553,7 @@ fail:
return self.tracks[index];
}
-- (void)insertObject:(HBSubtitlesTrack *)track inTracksAtIndex:(NSUInteger)index;
+- (void)insertObject:(HBSubtitlesTrack *)track inTracksAtIndex:(NSUInteger)index
{
[[self.undo prepareWithInvocationTarget:self] removeObjectFromTracksAtIndex:index];
[self.tracks insertObject:track atIndex:index];
diff --git a/macosx/HBSubtitlesController.h b/macosx/HBSubtitlesController.h
index 2be943cd8..cbf1fcbc2 100644
--- a/macosx/HBSubtitlesController.h
+++ b/macosx/HBSubtitlesController.h
@@ -8,11 +8,13 @@
@class HBSubtitles;
-/**
- * HBSubtitlesController
- */
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBSubtitlesController : NSViewController
@property (nonatomic, readwrite, weak) HBSubtitles *subtitles;
@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBSubtitlesDefaultsController.h b/macosx/HBSubtitlesDefaultsController.h
index 379c35aed..6b150a961 100644
--- a/macosx/HBSubtitlesDefaultsController.h
+++ b/macosx/HBSubtitlesDefaultsController.h
@@ -8,8 +8,13 @@
@class HBSubtitlesDefaults;
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBSubtitlesDefaultsController : NSWindowController
- (instancetype)initWithSettings:(HBSubtitlesDefaults *)settings;
@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBSubtitlesDefaultsController.m b/macosx/HBSubtitlesDefaultsController.m
index adff701ec..a1b0307b8 100644
--- a/macosx/HBSubtitlesDefaultsController.m
+++ b/macosx/HBSubtitlesDefaultsController.m
@@ -16,8 +16,8 @@ static void *HBSubtitlesDefaultsContext = &HBSubtitlesDefaultsContext;
@property (nonatomic, readonly) HBSubtitlesDefaults *settings;
@property (nonatomic, readonly) HBLanguagesSelection *languagesList;
-@property (unsafe_unretained) IBOutlet HBLanguageArrayController *tableController;
-@property (unsafe_unretained) IBOutlet NSButton *showAllButton;
+@property (nonatomic, unsafe_unretained) IBOutlet HBLanguageArrayController *tableController;
+@property (nonatomic, unsafe_unretained) IBOutlet NSButton *showAllButton;
@end
diff --git a/macosx/HBSubtitlesTrack.m b/macosx/HBSubtitlesTrack.m
index a654fef48..795aa68c5 100644
--- a/macosx/HBSubtitlesTrack.m
+++ b/macosx/HBSubtitlesTrack.m
@@ -220,7 +220,7 @@ NSString *keySubTrackExternalFileURLBookmark = @"keySubTrackSrtFileURLBookmark";
- (void)setIsoLanguage:(NSString *)isoLanguage
{
- if (![isoLanguage isEqualToString:_isoLanguage])
+ if (_isoLanguage != isoLanguage || (_isoLanguage && ![isoLanguage isEqualToString:_isoLanguage]))
{
[[self.undo prepareWithInvocationTarget:self] setIsoLanguage:_isoLanguage];
}
@@ -229,7 +229,7 @@ NSString *keySubTrackExternalFileURLBookmark = @"keySubTrackSrtFileURLBookmark";
- (void)setCharCode:(NSString *)charCode
{
- if (![charCode isEqualToString:_charCode])
+ if (_charCode != charCode || (_charCode && ![charCode isEqualToString:_charCode]))
{
[[self.undo prepareWithInvocationTarget:self] setCharCode:_charCode];
}
diff --git a/macosx/HBThumbnailItemView.h b/macosx/HBThumbnailItemView.h
index 0e57ba344..b6b79aa9a 100644
--- a/macosx/HBThumbnailItemView.h
+++ b/macosx/HBThumbnailItemView.h
@@ -9,11 +9,15 @@
#import <Cocoa/Cocoa.h>
#import "HBPreviewGenerator.h"
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBThumbnailItemView : NSScrubberItemView
-@property (nonatomic) NSImage *thumbnail;
+@property (nonatomic, nullable) NSImage *thumbnail;
@property (nonatomic) NSUInteger thumbnailIndex;
@property (nonatomic, weak) HBPreviewGenerator *generator;
-
@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBThumbnailItemView.m b/macosx/HBThumbnailItemView.m
index 21f8e7ac6..eb6e6646f 100644
--- a/macosx/HBThumbnailItemView.m
+++ b/macosx/HBThumbnailItemView.m
@@ -10,7 +10,7 @@
@interface HBThumbnailItemView ()
-@property (strong) NSImageView *imageView;
+@property (nonatomic, strong) NSImageView *imageView;
@end
diff --git a/macosx/HBTitleSelectionController.m b/macosx/HBTitleSelectionController.m
index b92a92065..6152e37d0 100644
--- a/macosx/HBTitleSelectionController.m
+++ b/macosx/HBTitleSelectionController.m
@@ -47,7 +47,7 @@
@implementation HBTitleSelectionController
-- (instancetype)initWithTitles:(NSArray<HBTitle *> *)titles presetName:(NSString *)presetName delegate:(id<HBTitleSelectionDelegate>)delegate;
+- (instancetype)initWithTitles:(NSArray<HBTitle *> *)titles presetName:(NSString *)presetName delegate:(id<HBTitleSelectionDelegate>)delegate
{
self = [super initWithWindowNibName:@"HBTitleSelection"];
if (self)
diff --git a/macosx/HBToolbarBadgedItem.h b/macosx/HBToolbarBadgedItem.h
index 401918d56..9f7f0644e 100644
--- a/macosx/HBToolbarBadgedItem.h
+++ b/macosx/HBToolbarBadgedItem.h
@@ -7,6 +7,8 @@
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBToolbarBadgedItem : NSToolbarItem
@property (nonatomic, copy) NSString *badgeValue;
@@ -15,3 +17,6 @@
@property (nonatomic, copy) NSColor *badgeFillColor;
@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HBVideo.m b/macosx/HBVideo.m
index 1c35349ba..c4fc5f0da 100644
--- a/macosx/HBVideo.m
+++ b/macosx/HBVideo.m
@@ -28,7 +28,7 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification";
@implementation HBVideo
-- (instancetype)initWithJob:(HBJob *)job;
+- (instancetype)initWithJob:(HBJob *)job
{
self = [super init];
if (self) {
@@ -43,6 +43,8 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification";
_profile = @"auto";
_level = @"auto";
+ _videoOptionExtra = @"";
+
[self updateQualityBounds];
_notificationsEnabled = YES;
diff --git a/macosx/HBVideoController.h b/macosx/HBVideoController.h
index 937563575..369d2cc05 100644
--- a/macosx/HBVideoController.h
+++ b/macosx/HBVideoController.h
@@ -8,11 +8,13 @@
@class HBVideo;
-/**
- * HBVideoController
- */
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBVideoController : NSViewController
@property (nonatomic, readwrite, weak) HBVideo *video;
@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HandBrake.xcodeproj/project.pbxproj b/macosx/HandBrake.xcodeproj/project.pbxproj
index ef64e890e..f025c225f 100644
--- a/macosx/HandBrake.xcodeproj/project.pbxproj
+++ b/macosx/HandBrake.xcodeproj/project.pbxproj
@@ -88,7 +88,7 @@
A916C9961C8449BE00C7B560 /* HBJobOutputFileWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = A91AFD0E1A949472009BECED /* HBJobOutputFileWriter.m */; };
A916C9971C8449CA00C7B560 /* HBAudioDefaultsController.m in Sources */ = {isa = PBXBuildFile; fileRef = A932E26E198833920047D13E /* HBAudioDefaultsController.m */; };
A916C9981C8449DB00C7B560 /* HBTitleSelectionController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C183941A716B8F00C897C2 /* HBTitleSelectionController.m */; };
- A916C9991C8449E200C7B560 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 273F20BD14ADC09F0021BE6D /* main.mm */; };
+ A916C9991C8449E200C7B560 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 273F20BD14ADC09F0021BE6D /* main.m */; };
A916C99B1C844A0800C7B560 /* HBTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9EA43671A2210C400785E95 /* HBTableView.m */; };
A919430D1FB5E2FE001E9BB0 /* HBSummaryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A919430B1FB5E2FE001E9BB0 /* HBSummaryViewController.m */; };
A91943111FB5E39E001E9BB0 /* HBSummaryViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A919430F1FB5E39E001E9BB0 /* HBSummaryViewController.xib */; };
@@ -434,7 +434,7 @@
273F20A414ADBE670021BE6D /* HBPreviewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBPreviewController.m; sourceTree = "<group>"; };
273F20A914ADBE670021BE6D /* HBPictureController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBPictureController.h; sourceTree = "<group>"; };
273F20AA14ADBE670021BE6D /* HBPictureController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBPictureController.m; sourceTree = "<group>"; };
- 273F20BD14ADC09F0021BE6D /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
+ 273F20BD14ADC09F0021BE6D /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
275916DA14B2AB27007211E9 /* native.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = native.xcconfig; sourceTree = "<group>"; };
277EFE8D17ED5628001D4A6A /* supplemental.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = supplemental.xcconfig; sourceTree = "<group>"; };
277EFE9217ED799E001D4A6A /* libfdk-aac.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libfdk-aac.a"; path = "external/contrib/lib/libfdk-aac.a"; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -1234,7 +1234,7 @@
A95121E51B5F7BE700FD773D /* NSArray+HBAdditions.m */,
A943873F22ED911B005F701B /* HBJob+HBAdditions.h */,
A943874022ED911B005F701B /* HBJob+HBAdditions.m */,
- 273F20BD14ADC09F0021BE6D /* main.mm */,
+ 273F20BD14ADC09F0021BE6D /* main.m */,
);
name = Others;
sourceTree = "<group>";
@@ -1889,7 +1889,7 @@
A954010322FF397000F83A5F /* HBRedirect.m in Sources */,
A95BA161220CA5DB00A2F9F9 /* HBDistributedArray.m in Sources */,
A916C99B1C844A0800C7B560 /* HBTableView.m in Sources */,
- A916C9991C8449E200C7B560 /* main.mm in Sources */,
+ A916C9991C8449E200C7B560 /* main.m in Sources */,
A973E10C216E74E900D498EC /* HBThumbnailItemView.m in Sources */,
A916C9981C8449DB00C7B560 /* HBTitleSelectionController.m in Sources */,
A943874122ED911B005F701B /* HBJob+HBAdditions.m in Sources */,
@@ -2421,7 +2421,12 @@
CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES;
+ CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES;
+ CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES;
CLANG_ENABLE_MODULES = YES;
+ CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES;
+ CLANG_WARN_ASSIGN_ENUM = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
@@ -2432,11 +2437,12 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = NO;
+ CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = NO;
+ CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -2455,9 +2461,12 @@
"DEBUG=1",
"$(inherited)",
);
+ GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
+ GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+ GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
@@ -2465,6 +2474,7 @@
GCC_WARN_SHADOW = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
@@ -2474,7 +2484,7 @@
HBKitLocalizedString,
);
MACOSX_DEPLOYMENT_TARGET = 10.11;
- OTHER_CFLAGS = "";
+ OTHER_CFLAGS = "-Wno-duplicate-decl-specifier ";
OTHER_LDFLAGS = (
"-filelist",
"$(EXTERNAL_BUILD)/macosx/osl.filelist.txt",
@@ -2495,7 +2505,12 @@
CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES;
+ CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES;
+ CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES;
CLANG_ENABLE_MODULES = YES;
+ CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES;
+ CLANG_WARN_ASSIGN_ENUM = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
@@ -2506,11 +2521,12 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = NO;
+ CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = NO;
+ CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -2525,9 +2541,12 @@
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_NO_COMMON_BLOCKS = YES;
+ GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
+ GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+ GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
@@ -2535,6 +2554,7 @@
GCC_WARN_SHADOW = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
@@ -2544,7 +2564,7 @@
HBKitLocalizedString,
);
MACOSX_DEPLOYMENT_TARGET = 10.11;
- OTHER_CFLAGS = "";
+ OTHER_CFLAGS = "-Wno-duplicate-decl-specifier ";
OTHER_LDFLAGS = (
"-filelist",
"$(EXTERNAL_BUILD)/macosx/osl.filelist.txt",
@@ -3199,7 +3219,12 @@
CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES;
+ CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES;
+ CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES;
CLANG_ENABLE_MODULES = YES;
+ CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES;
+ CLANG_WARN_ASSIGN_ENUM = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
@@ -3210,11 +3235,12 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = NO;
+ CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = NO;
+ CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -3235,9 +3261,12 @@
"$(inherited)",
"__SANDBOX_ENABLED__=1",
);
+ GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
+ GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+ GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
@@ -3245,6 +3274,7 @@
GCC_WARN_SHADOW = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
@@ -3254,7 +3284,7 @@
HBKitLocalizedString,
);
MACOSX_DEPLOYMENT_TARGET = 10.11;
- OTHER_CFLAGS = "";
+ OTHER_CFLAGS = "-Wno-duplicate-decl-specifier ";
OTHER_LDFLAGS = (
"-filelist",
"$(EXTERNAL_BUILD)/macosx/osl.filelist.txt",
@@ -3457,7 +3487,12 @@
CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES;
+ CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES;
+ CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES;
CLANG_ENABLE_MODULES = YES;
+ CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES;
+ CLANG_WARN_ASSIGN_ENUM = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
@@ -3468,10 +3503,11 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = NO;
+ CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
@@ -3489,9 +3525,12 @@
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = "__SANDBOX_ENABLED__=1";
+ GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
+ GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+ GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
@@ -3499,6 +3538,7 @@
GCC_WARN_SHADOW = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
@@ -3508,7 +3548,7 @@
HBKitLocalizedString,
);
MACOSX_DEPLOYMENT_TARGET = 10.11;
- OTHER_CFLAGS = "";
+ OTHER_CFLAGS = "-Wno-duplicate-decl-specifier ";
OTHER_LDFLAGS = (
"-filelist",
"$(EXTERNAL_BUILD)/macosx/osl.filelist.txt",
diff --git a/macosx/HandBrakeXPCService/HBRemoteCoreProtocol.h b/macosx/HandBrakeXPCService/HBRemoteCoreProtocol.h
index e55d1ee04..15843007a 100644
--- a/macosx/HandBrakeXPCService/HBRemoteCoreProtocol.h
+++ b/macosx/HandBrakeXPCService/HBRemoteCoreProtocol.h
@@ -6,6 +6,8 @@
@import HandBrakeKit;
+NS_ASSUME_NONNULL_BEGIN
+
@protocol HBRemoteCoreProtocol
- (void)setDVDNav:(BOOL)enabled;
@@ -41,3 +43,5 @@
@end
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HandBrakeXPCService/HandBrakeXPCService.h b/macosx/HandBrakeXPCService/HandBrakeXPCService.h
index d7a084bd0..7d645e602 100644
--- a/macosx/HandBrakeXPCService/HandBrakeXPCService.h
+++ b/macosx/HandBrakeXPCService/HandBrakeXPCService.h
@@ -5,9 +5,14 @@
#import <Foundation/Foundation.h>
#import "HBRemoteCoreProtocol.h"
+NS_ASSUME_NONNULL_BEGIN
+
@interface HandBrakeXPCService : NSObject <HBRemoteCoreProtocol>
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithConnection:(NSXPCConnection *)connection;
@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/HandBrakeXPCService/HandBrakeXPCService.m b/macosx/HandBrakeXPCService/HandBrakeXPCService.m
index 366326b69..8bae39845 100644
--- a/macosx/HandBrakeXPCService/HandBrakeXPCService.m
+++ b/macosx/HandBrakeXPCService/HandBrakeXPCService.m
@@ -149,7 +149,7 @@ static void *HandBrakeXPCServiceContext = &HandBrakeXPCServiceContext;
});
}
- - (void)encodeJob:(HBJob *)job withReply:(void (^)(HBCoreResult))reply;
+ - (void)encodeJob:(HBJob *)job withReply:(void (^)(HBCoreResult))reply
{
dispatch_sync(_queue, ^{
void (^progressHandler)(HBState state, HBProgress progress, NSString *info) = ^(HBState state, HBProgress progress, NSString *info)
diff --git a/macosx/NSArray+HBAdditions.h b/macosx/NSArray+HBAdditions.h
index 7e7c8bce4..ee7a6bdc2 100644
--- a/macosx/NSArray+HBAdditions.h
+++ b/macosx/NSArray+HBAdditions.h
@@ -6,9 +6,14 @@
#import <Foundation/Foundation.h>
+NS_ASSUME_NONNULL_BEGIN
+
@interface NSArray (HBAdditions)
- (NSArray *)filteredArrayUsingBlock:(BOOL (^)(id object))block;
- (NSIndexSet *)indexesOfObjectsUsingBlock:(BOOL (^)(id object))block;
-@end \ No newline at end of file
+@end
+
+NS_ASSUME_NONNULL_END
+
diff --git a/macosx/NSJSONSerialization+HBAdditions.h b/macosx/NSJSONSerialization+HBAdditions.h
index 58bb47d98..c4938a1a2 100644
--- a/macosx/NSJSONSerialization+HBAdditions.h
+++ b/macosx/NSJSONSerialization+HBAdditions.h
@@ -10,8 +10,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface NSJSONSerialization (HBAdditions)
-+ (nullable id)HB_JSONObjectWithUTF8String:(const char *)nullTerminatedCString options:(NSJSONReadingOptions)opt error:(NSError **)error;
-+ (nullable NSString *)HB_StringWithJSONObject:(id)obj options:(NSJSONWritingOptions)opt error:(NSError **)error;
++ (nullable id)HB_JSONObjectWithUTF8String:(const char *)nullTerminatedCString options:(NSJSONReadingOptions)opt error:(NSError * __autoreleasing *)error;
++ (nullable NSString *)HB_StringWithJSONObject:(id)obj options:(NSJSONWritingOptions)opt error:(NSError * __autoreleasing *)error;
@end
diff --git a/macosx/NSJSONSerialization+HBAdditions.m b/macosx/NSJSONSerialization+HBAdditions.m
index e7b981ce9..b0cb10a2f 100644
--- a/macosx/NSJSONSerialization+HBAdditions.m
+++ b/macosx/NSJSONSerialization+HBAdditions.m
@@ -8,7 +8,7 @@
@implementation NSJSONSerialization (HBAdditions)
-+ (id)HB_JSONObjectWithUTF8String:(const char *)nullTerminatedCString options:(NSJSONReadingOptions)opt error:(NSError **)error;
++ (id)HB_JSONObjectWithUTF8String:(const char *)nullTerminatedCString options:(NSJSONReadingOptions)opt error:(NSError * __autoreleasing *)error
{
if (!nullTerminatedCString) {
return nil;
@@ -18,7 +18,7 @@
return result;
}
-+ (NSString *)HB_StringWithJSONObject:(id)obj options:(NSJSONWritingOptions)opt error:(NSError **)error
++ (NSString *)HB_StringWithJSONObject:(id)obj options:(NSJSONWritingOptions)opt error:(NSError * __autoreleasing *)error
{
NSData *data = [NSJSONSerialization dataWithJSONObject:obj options:opt error:error];
if (data)
diff --git a/macosx/NSWindow+HBAdditions.m b/macosx/NSWindow+HBAdditions.m
index ea13a9dcc..daf572bfa 100644
--- a/macosx/NSWindow+HBAdditions.m
+++ b/macosx/NSWindow+HBAdditions.m
@@ -73,7 +73,7 @@
return center;
}
-- (BOOL)HB_endEditing;
+- (BOOL)HB_endEditing
{
BOOL success;
NSRange selectedRange = NSMakeRange(0, 0);
@@ -107,7 +107,7 @@
return success;
}
-- (void)HB_forceEndEditing;
+- (void)HB_forceEndEditing
{
[self endEditingFor:nil];
}
diff --git a/macosx/main.mm b/macosx/main.m
index 961d1fa78..961d1fa78 100644
--- a/macosx/main.mm
+++ b/macosx/main.m