]> granicus.if.org Git - handbrake/commitdiff
MacGui: enable and fix more warnings. Review nullability annotations.
authorDamiano Galassi <damiog@gmail.com>
Mon, 12 Aug 2019 08:19:00 +0000 (10:19 +0200)
committerDamiano Galassi <damiog@gmail.com>
Mon, 12 Aug 2019 08:19:00 +0000 (10:19 +0200)
75 files changed:
macosx/HBAVPlayer.m
macosx/HBAddPresetController.m
macosx/HBAppDelegate.m
macosx/HBApplication.h
macosx/HBAudio.m
macosx/HBAudioController.h
macosx/HBAudioDefaults.m
macosx/HBAudioDefaultsController.h
macosx/HBAudioDefaultsController.m
macosx/HBAudioTrack.m
macosx/HBChapterTitlesController.h
macosx/HBChapterTitlesController.m
macosx/HBController.h
macosx/HBController.m
macosx/HBCore.m
macosx/HBDVDDetector.h
macosx/HBDockTextField.h
macosx/HBDockTile.h
macosx/HBEncodingProgressHUDController.h
macosx/HBEncodingProgressHUDController.m
macosx/HBExceptionAlertController.h
macosx/HBFilters+UIAdditions.m
macosx/HBFiltersViewController.h
macosx/HBImageUtilities.h
macosx/HBJob+Private.h
macosx/HBJob.m
macosx/HBLanguagesSelection.h
macosx/HBMutablePreset.m
macosx/HBOutputFileWriter.m
macosx/HBPictureController.h
macosx/HBPictureHUDController.m
macosx/HBPictureViewController.h
macosx/HBPictureViewController.m
macosx/HBPlayer.h
macosx/HBPlayerHUDController.h
macosx/HBPlayerHUDController.m
macosx/HBPlayerTrack.h
macosx/HBPreferencesController.m
macosx/HBPreset.m
macosx/HBPresetsManager.m
macosx/HBPresetsMenuBuilder.h
macosx/HBPreviewController.h
macosx/HBPreviewController.m
macosx/HBPreviewGenerator.m
macosx/HBPreviewView.m
macosx/HBPreviewViewController.h
macosx/HBPreviewViewController.m
macosx/HBQueue.h
macosx/HBQueue.m
macosx/HBQueueController.m
macosx/HBQueueInfoViewController.m
macosx/HBQueueItem.m
macosx/HBQueueMultiSelectionViewController.m
macosx/HBQueueTableViewController.m
macosx/HBSecurityAccessToken.m
macosx/HBSubtitles.m
macosx/HBSubtitlesController.h
macosx/HBSubtitlesDefaultsController.h
macosx/HBSubtitlesDefaultsController.m
macosx/HBSubtitlesTrack.m
macosx/HBThumbnailItemView.h
macosx/HBThumbnailItemView.m
macosx/HBTitleSelectionController.m
macosx/HBToolbarBadgedItem.h
macosx/HBVideo.m
macosx/HBVideoController.h
macosx/HandBrake.xcodeproj/project.pbxproj
macosx/HandBrakeXPCService/HBRemoteCoreProtocol.h
macosx/HandBrakeXPCService/HandBrakeXPCService.h
macosx/HandBrakeXPCService/HandBrakeXPCService.m
macosx/NSArray+HBAdditions.h
macosx/NSJSONSerialization+HBAdditions.h
macosx/NSJSONSerialization+HBAdditions.m
macosx/NSWindow+HBAdditions.m
macosx/main.m [moved from macosx/main.mm with 100% similarity]

index 833c0643a192e3cfc531556807189558803a1687..940c5bdb6db3eac51648c66fe20968d7c489bee8 100644 (file)
@@ -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)
     {
index 406ab379e84fff73de36fc84c89cefcd9916a25a..238361e144509bb85d2b322a5fde2cb46ed095b7 100644 (file)
@@ -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;
index d22d03ef606960da0895a6b255e4b40e6c411b86..dbc52facb0bbeccb1a99c413f8dea88a141f11f0 100644 (file)
@@ -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;
 
index 2fbeab833fa23e5999c4e8e876352965a56da4bf..e3473001fd6d6e35770a599c0fea206989c40db0 100644 (file)
@@ -7,5 +7,4 @@
 #import <Cocoa/Cocoa.h>
 
 @interface HBApplication : NSApplication
-
 @end
index cdd929efb03d2a0ea05581eca8808b9317f89f15..093d70dff00c3f281b199ac7cc6bf62b611b15e2 100644 (file)
@@ -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];
index 1385d15d28c5ca3b2ec2bda98c751e4fe1bdfa87..c1caf8c54d20abc5bc4ef7a5bb00a80e333d2800 100644 (file)
@@ -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
+
index 538c06e22c4e0031e79957eaed7a0c548b2c60b3..0dbef621bdce4be9ad8fa0d5dcb7b7425438a033 100644 (file)
@@ -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];
index 63e18d515b849bac7107deaef4622474303f58ea..8968713aff4ebf78595b7b1c0cf15b7f1b4dce1a 100644 (file)
@@ -8,8 +8,13 @@
 
 @class HBAudioDefaults;
 
+NS_ASSUME_NONNULL_BEGIN
+
 @interface HBAudioDefaultsController : NSWindowController
 
 - (instancetype)initWithSettings:(HBAudioDefaults *)settings;
 
 @end
+
+NS_ASSUME_NONNULL_END
+
index 5fb7c04d976f22932a86fde9d592a76348abb136..b299875d79ab43fec7c708f2e19c3da31a96a915 100644 (file)
@@ -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
 
index 5120129115702a4f36c516891898968339c3ee39..c854d7fdc028fe403a996aac3d645dd5219aacf3 100644 (file)
@@ -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)
index 106261615b2666c1033aec0bf77b3f913e1edb1b..53d8a8b31272ab1ae78cac10e9842b500adf3b0a 100644 (file)
@@ -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
+
index ed0bee9bb33b9d88426796b010dbb7676cbbfec7..88b8cc9546700ef0ec507b12d2213280f00d4e0c 100644 (file)
@@ -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];
 
 
 @interface HBChapterTitlesController () <NSTableViewDataSource, NSTableViewDelegate>
 
-@property (weak) IBOutlet NSTableView *table;
+@property (nonatomic, weak) IBOutlet NSTableView *table;
 @property (nonatomic, readwrite, strong) NSArray<HBChapter *> *chapterTitles;
 
 @end
index fa8a9ac425b30c6564b52bb4fe5f8e626753ec9a..4b951fd901df0b8235a369dc8bae42755d3300ea 100644 (file)
@@ -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
+
index f10d771f33c2714c7bdb4057df89ada8518f1ac9..6fed7ebd9273f0b32677f5879deddbd236dcf302 100644 (file)
@@ -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)
index d784b92c497fb573e0871bf25559279e6ce38280..c720c5795742ff296155439414ddec02e51682c8 100644 (file)
@@ -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");
index a5bb7beaef59b845660b20e5cdb5ea9f37ea7e4b..27b7fcf259868a23d91d87db97a3c3f68cb48e6f 100644 (file)
@@ -25,4 +25,5 @@ NS_ASSUME_NONNULL_BEGIN
 
 @end
 
-NS_ASSUME_NONNULL_END
\ No newline at end of file
+NS_ASSUME_NONNULL_END
+
index bad413a9cc60762ec40a15e2338133f33b8209c5..0961311beea3e5ba0452b6ed766845b20f9bb720 100644 (file)
@@ -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
+
index 434025442d6f07152099398e309e89811a9e9ecc..3fcc61cc44ffb8bee64556d018ed927f5ed163c5 100644 (file)
@@ -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
+
index e147d09c4700bc1ac66bbea904e0f9e6d3a74b71..f8a829588fbf6fb9fab73534d0b991a4e144ddd4 100644 (file)
@@ -7,6 +7,8 @@
 #import <Cocoa/Cocoa.h>
 #import "HBHUD.h"
 
+NS_ASSUME_NONNULL_BEGIN
+
 @protocol HBEncodingProgressHUDControllerDelegate <NSObject>
 
 - (void)cancelEncoding;
 
 @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
+
index a78ed85a164a031847d31d6d076ce7267c5e4696..d2a7c25ca4b86c1213026e618fd5c59eb4f6acce 100644 (file)
@@ -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
 
index aaf49647c4b9f9704dd00a5df5435f49b42e7844..c6c0ee4b24023a163b3b190228c2795a639ff20d 100644 (file)
@@ -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;
index 42f249e4375b67057017bf7e5a9529752886e0f4..b5472a42eb3bd58409bf25934bf9107bab3d98c5 100644 (file)
@@ -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
index 88beefe66f4326ca7d4af4c8c93f956c9596b465..d66c90b8fe3807895f27ae8f42f80b82f4263443 100644 (file)
@@ -8,8 +8,13 @@
 
 @class HBFilters;
 
+NS_ASSUME_NONNULL_BEGIN
+
 @interface HBFiltersViewController : NSViewController
 
 @property (nonatomic, readwrite, weak) HBFilters *filters;
 
 @end
+
+NS_ASSUME_NONNULL_END
+
index 6258d5d4fdb9b63ab7610f5be5b268f026cd41da..beb19593ffb258cbc4d2d110ed7b11dbb02b8162 100644 (file)
@@ -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
+
index 8392672536de91978c6fb495a0db2c221a159fb7..1f8c26ffd08ae9d3176ac551a8e93f9bea2330d8 100644 (file)
@@ -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
+
index 4d52735c78fc62783830cfb693795ad98633463b..d3b4de8b886b48f61426de01f4b28ea31a4ef313 100644 (file)
@@ -71,6 +71,8 @@ NSString *HBChaptersChangedNotification  = @"HBChaptersChangedNotification";
 
         _chapterTitles = [title.chapters copy];
 
+        _presetName = @"";
+
         [self applyPreset:preset];
     }
 
index 0d57fba17cddb46d80973c854518bde71e45aa62..100de9d13ff45eae9aa2a006d16814260d731a5f 100644 (file)
@@ -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
 
index e773065ad88fc93d7f69a855d7bcf60ec2eeace8..0fddc6a405c9e44c13d13572c2741feecec8329b 100644 (file)
@@ -15,7 +15,7 @@
 
 @implementation HBMutablePreset
 
-- (void)setObject:(id)obj forKey:(NSString *)key;
+- (void)setObject:(id)obj forKey:(NSString *)key
 {
     self.content[key] = obj;
 }
index bbc802492b85377c55f0663f30bceef37678ac85..20b2e50840f984772e8d6a8619c5b57bb22f54a6 100644 (file)
@@ -13,7 +13,7 @@
     NSDateFormatter *_formatter;
 }
 
-- (nullable instancetype)initWithFileURL:(NSURL *)url;
+- (nullable instancetype)initWithFileURL:(NSURL *)url
 {
     self = [super init];
     if (self)
index 577937dfd550bc2688a21f07d9e14774f248a5a7..2f03cf68a13e66a3f3ecb59366f8ef7a27048f17 100644 (file)
@@ -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
+
index d87e1290fbbd314870094d7072e4b6ad64928573..bb316811271347c049889deb4e04ad283b4b4508 100644 (file)
 
 @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;
index 13802e80310766d2bd1ac96d4dabeab658e2e253..95795d576530c6bf64b815599f1ccdef4a623779 100644 (file)
@@ -8,8 +8,13 @@
 
 @class HBPicture;
 
+NS_ASSUME_NONNULL_BEGIN
+
 @interface HBPictureViewController : NSViewController
 
 @property (nonatomic, readwrite, weak) HBPicture *picture;
 
 @end
+
+NS_ASSUME_NONNULL_END
+
index 52beb8013ef74d79a9fd4bdcd02395eb3ed44594..ae18cf38f85f7cd60b884d9c4519eff8dfbf18fb 100644 (file)
@@ -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;
 
index 77d6ada6b1ad1a667d3cbbda625aa0ec03bae386..bbb775986e5854829707c4176c9d5f91b5ff4d20 100644 (file)
@@ -54,4 +54,5 @@ NS_ASSUME_NONNULL_BEGIN
 
 @end
 
-NS_ASSUME_NONNULL_END
\ No newline at end of file
+NS_ASSUME_NONNULL_END
+
index 7becadb64c5af3609ff4e62d20185282566040cb..a66dc4dd1eca8b4379fee1015d5b60c70c03ec6a 100644 (file)
@@ -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
+
index 473b5ce0a51d0266e02e4b4707efaacdfb3256bb..5fa0e36ce7053e3f26928028fa4f0b49f69f73fc 100644 (file)
@@ -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;
     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);
index 950fdfdda50f48e3abc8d01ae8f6fc3a6b9e0dc6..fef5279ccef9d46791fd297cb32f11dfe60dd01a 100644 (file)
@@ -18,4 +18,5 @@ NS_ASSUME_NONNULL_BEGIN
 
 @end
 
-NS_ASSUME_NONNULL_END
\ No newline at end of file
+NS_ASSUME_NONNULL_END
+
index 7eb0dfb74c6c1d820cfdc776a1d72ea0edf62fd2..adecdbcf3216de9868d026470ae8803a9a9cb167 100644 (file)
@@ -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;
 
index 98d424253bc1d401ca44ca70ae9afe04352a3c1d..917657c7484eab57c36744cf8431eca6b174f7ba 100644 (file)
@@ -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)
     return self;
 }
 
-- (nullable instancetype)initWithContentsOfURL:(NSURL *)url error:(NSError **)outError
+- (nullable instancetype)initWithContentsOfURL:(NSURL *)url error:(NSError * __autoreleasing *)outError
 {
     NSParameterAssert(url);
 
     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;
index cb90e583592101f76a0bbd00b30d3139bdbac760..e5b3b3173dabe3d7222302ce9bf27b5abc3afbc7 100644 (file)
@@ -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;
index d8c340bb437e122e95287b38878ff0e90e03b378..e3c9d67a65be449c4b7fcdab7a314e02b1aaf89e 100644 (file)
@@ -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
+
index ca0cdefbc6563fe73d8be9561a27f0c48d1042ba..a28103ded38e567ffe9ea560c0c9974430272c76 100644 (file)
 @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
index 643c1c28d478a0ecbaa7c71d09bf01afe9a7ab17..e3d9c72aff1004c4181d54ffbaee02534cb07012 100644 (file)
@@ -43,7 +43,7 @@
 @property (nonatomic) HBPictureController *pictureSettingsWindow;
 
 @property (nonatomic) NSPoint windowCenterPoint;
-@property (weak) IBOutlet HBPreviewView *previewView;
+@property (nonatomic, weak) IBOutlet HBPreviewView *previewView;
 
 @end
 
     [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");
     }];
 }
 
-- (void)setUpPlaybackOfURL:(NSURL *)fileURL playerClass:(Class)class;
+- (void)setUpPlaybackOfURL:(NSURL *)fileURL playerClass:(Class)class
 {
     NSArray<Class> *availablePlayerClasses = @[[HBAVPlayer class]];
 
 
 - (void)keyDown:(NSEvent *)event
 {
-    if ([self.currentHUD HB_keyDown:event] == NO)
+    if (self.generator && [self.currentHUD HB_keyDown:event] == NO)
     {
         [super keyDown:event];
     }
 
 - (void)scrollWheel:(NSEvent *)event
 {
-    if ([self.currentHUD HB_scrollWheel:event] == NO)
+    if (self.generator && [self.currentHUD HB_scrollWheel:event] == NO)
     {
         [super scrollWheel:event];
     }
index 0ea12d806c5d956f6432ced10e6e45875690328f..91dcfb6de41686de24e6eb6e0877c44b5ae9fa84 100644 (file)
  * @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)
index d906777c91036e678e8d614ed8148a14f8fc485b..518f8206143a9cf381ab916c6a506d02873af7fc 100644 (file)
     return resultSize;
 }
 
-#pragma MARK: - Accessibility
+#pragma mark - Accessibility
 
 - (BOOL)isAccessibilityElement
 {
index d3101a540c7dcb21da4e1bd1707af3f3d33f0c02..3b4c0b1111ef8c03a6f64691bb12d2531ce1a4ca 100644 (file)
@@ -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
+
index ca63d424a5c06d51a1c735f538e30291ba0f9b36..2890d3ecd194248d751f4ef1376b2d67fd76472e 100644 (file)
@@ -83,7 +83,7 @@
     [self updatePicture];
 }
 
-#pragma MARK: - HUD
+#pragma mark - HUD
 
 - (void)mouseEntered:(NSEvent *)theEvent
 {
     }
 }
 
-#pragma MARK: - Preview index
+#pragma mark - Preview index
 
 - (void)setSelectedIndex:(NSInteger)selectedIndex
 {
index 6cbc9f4cef0db2b262ee860c5f2b14988bd04a4c..6a9f4e4cbdc9b00f3c14b07fb1d95c62d194631e 100644 (file)
@@ -8,7 +8,6 @@
 
 #import "HBDistributedArray.h"
 #import "HBQueueItem.h"
-#import "HBJobOutputFileWriter.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
index bd6f744907657868a0238bb07486965499e5e183..49fed88c19f60b65f4dd7ef1630de1b6b13dfc32 100644 (file)
@@ -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];
index 4de78e300d487b3da6d98f509fe8296bc5f397b8..e49a53b11958f823be7f96ae308218af7e01e7fe 100644 (file)
@@ -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;
                 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];
index 0521ccc0497baa21b55e9992bd3198b8821e1529..583eb3cfc54c37175007c41c3f38ca2ed2a7aad4 100644 (file)
@@ -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;
 
index 6eb82d2b0d8021ddabacfae39f14551559cc7d06..29aef3530de874a84fc2f2ca095c4e933be69ab0 100644 (file)
@@ -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];
index b1476e0adf43b2b4203e09b34259aec6bbdcd400..f0e5b63f0e1dcd10f285a536496c4ff11f8af9b6 100644 (file)
@@ -8,7 +8,7 @@
 
 @interface HBQueueMultiSelectionViewController ()
 
-@property (weak) IBOutlet NSTextField *label;
+@property (nonatomic, weak) IBOutlet NSTextField *label;
 
 @end
 
index 2f3931c8e13cbffcdafa19c3ec36dd9ab421fd63..034e034870454a65caf2e12e8acd8e582b887b90 100644 (file)
@@ -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
 
     [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.
 
     // 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;
index 1a50231975471840aa0e47b6e16f722c5525ad1d..67e1b78be30eb5b647709f6a997eac8e5d340281 100644 (file)
@@ -13,7 +13,7 @@
 
 @implementation HBSecurityAccessToken
 
-- (instancetype)initWithObject:(id<HBSecurityScope>)object;
+- (instancetype)initWithObject:(id<HBSecurityScope>)object
 {
     self = [super init];
     if (self)
index c31ed233ce64a8e8cdaccad2c3d3322e24773807..4856035605d5b0328953faeeeffe61cc34d8c0db 100644 (file)
@@ -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];
index 2be943cd88b1699d5b6d3f073881dc0ec4c4524d..cbf1fcbc2d0ecf5c5205eb9dc321487200014025 100644 (file)
@@ -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
+
index 379c35aed4c374b5eb00b2dc418a3624e985070a..6b150a9619274d93f455b8dd36f997eef6b09b9a 100644 (file)
@@ -8,8 +8,13 @@
 
 @class HBSubtitlesDefaults;
 
+NS_ASSUME_NONNULL_BEGIN
+
 @interface HBSubtitlesDefaultsController : NSWindowController
 
 - (instancetype)initWithSettings:(HBSubtitlesDefaults *)settings;
 
 @end
+
+NS_ASSUME_NONNULL_END
+
index adff701ecceda2d1fa6ffdc4813e0daf98ca892d..a1b0307b852b6f644e7e5891387137296f43fade 100644 (file)
@@ -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
 
index a654fef4807f806bb36ec8b5c00bcec29a6713f4..795aa68c5a061cece7d41cd24825b679ad53708a 100644 (file)
@@ -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];
     }
index 0e57ba34487649adbee99fb4a2dfbcf9b34535fb..b6b79aa9aa0b58480f85e1b05b192d821fb05e5e 100644 (file)
@@ -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
+
index 21f8e7ac6d95d643e2f2006bdf4ded32d96e4c38..eb6e6646f7c504284fcf6bee304739f450081944 100644 (file)
@@ -10,7 +10,7 @@
 
 @interface HBThumbnailItemView ()
 
-@property (strong) NSImageView *imageView;
+@property (nonatomic, strong) NSImageView *imageView;
 
 @end
 
index b92a92065e95b69cd31c57b58aa3aa235f028bc1..6152e37d069ddd86e4cda98d56ed0e9f7a5b8453 100644 (file)
@@ -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)
index 401918d56051a5c785fdefa6a3436994f9eaa0af..9f7f0644e60fe9c13a17f6628cba6253bdf8caab 100644 (file)
@@ -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
+
index 1c35349ba4a83732bac9fab886d6d5ed4c28bfdb..c4fc5f0daf538abdb63e54dc1767cd96238fa6bc 100644 (file)
@@ -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;
index 937563575ccfb50d169648b43502c20132b4569d..369d2cc052c8de3870b6f40271841775cc72e0e4 100644 (file)
@@ -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
+
index ef64e890e47728c604482a574b487e2f5e2a5f80..f025c225f80b134dd3f292b951fb51f208f217b1 100644 (file)
@@ -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 */; };
                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; };
                                A95121E51B5F7BE700FD773D /* NSArray+HBAdditions.m */,
                                A943873F22ED911B005F701B /* HBJob+HBAdditions.h */,
                                A943874022ED911B005F701B /* HBJob+HBAdditions.m */,
-                               273F20BD14ADC09F0021BE6D /* main.mm */,
+                               273F20BD14ADC09F0021BE6D /* main.m */,
                        );
                        name = Others;
                        sourceTree = "<group>";
                                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 */,
                                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;
                                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;
                                        "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;
                                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;
                                        HBKitLocalizedString,
                                );
                                MACOSX_DEPLOYMENT_TARGET = 10.11;
-                               OTHER_CFLAGS = "";
+                               OTHER_CFLAGS = "-Wno-duplicate-decl-specifier ";
                                OTHER_LDFLAGS = (
                                        "-filelist",
                                        "$(EXTERNAL_BUILD)/macosx/osl.filelist.txt",
                                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;
                                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;
                                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;
                                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;
                                        HBKitLocalizedString,
                                );
                                MACOSX_DEPLOYMENT_TARGET = 10.11;
-                               OTHER_CFLAGS = "";
+                               OTHER_CFLAGS = "-Wno-duplicate-decl-specifier ";
                                OTHER_LDFLAGS = (
                                        "-filelist",
                                        "$(EXTERNAL_BUILD)/macosx/osl.filelist.txt",
                                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;
                                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;
                                        "$(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;
                                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;
                                        HBKitLocalizedString,
                                );
                                MACOSX_DEPLOYMENT_TARGET = 10.11;
-                               OTHER_CFLAGS = "";
+                               OTHER_CFLAGS = "-Wno-duplicate-decl-specifier ";
                                OTHER_LDFLAGS = (
                                        "-filelist",
                                        "$(EXTERNAL_BUILD)/macosx/osl.filelist.txt",
                                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;
                                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;
                                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;
                                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;
                                        HBKitLocalizedString,
                                );
                                MACOSX_DEPLOYMENT_TARGET = 10.11;
-                               OTHER_CFLAGS = "";
+                               OTHER_CFLAGS = "-Wno-duplicate-decl-specifier ";
                                OTHER_LDFLAGS = (
                                        "-filelist",
                                        "$(EXTERNAL_BUILD)/macosx/osl.filelist.txt",
index e55d1ee0491f3c7cca5afcc4f67ea2011439a7b9..15843007a31125fbd030c4a8ddb3bdf0b9d6893e 100644 (file)
@@ -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
+
index d7a084bd082cc6ae97577070d0f5a25cb39d86bf..7d645e60214cc5fe3f435696a0d22c253ca5d001 100644 (file)
@@ -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
+
index 366326b69f75f2ebd07d09fd463d34de6c3e5f44..8bae398456844aa9e53f95fcc3e40351d9599b54 100644 (file)
@@ -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)
index 7e7c8bce44f2c33465b83bdbb2745b4bd06153d0..ee7a6bdc20fa8cc61c52247b4191a3ac5b6e186a 100644 (file)
@@ -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
+
index 58bb47d9898d61d19bf4ed4968f90eb50318d720..c4938a1a23e3910afe2563d5c3b7aa6e981035ec 100644 (file)
@@ -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
 
index e7b981ce9db754712f05176b06f0e02b4b189d14..b0cb10a2f6646ee669485360d7e057955ba15d84 100644 (file)
@@ -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)
index ea13a9dccdec0aba2ca291ddea93493ad7518740..daf572bfaf30cc84376cac4822e0de3755fe869d 100644 (file)
@@ -73,7 +73,7 @@
     return center;
 }
 
-- (BOOL)HB_endEditing;
+- (BOOL)HB_endEditing
 {
     BOOL success;
     NSRange selectedRange = NSMakeRange(0, 0);
     return success;
 }
 
-- (void)HB_forceEndEditing;
+- (void)HB_forceEndEditing
 {
     [self endEditingFor:nil];
 }
similarity index 100%
rename from macosx/main.mm
rename to macosx/main.m