MacGui: enable and fix more compiler warnings in the Xcode project.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6772 b64f7644-9d1e-0410-96f1-a4d463321fa5
This commit is contained in:
ritsuka 2015-01-19 15:35:35 +00:00
parent ea82134f61
commit 2e7330affa
13 changed files with 43 additions and 42 deletions

View File

@ -21,7 +21,6 @@
@class HBOutputPanelController; @class HBOutputPanelController;
@class HBPresetsViewController; @class HBPresetsViewController;
@class HBPresetsManager; @class HBPresetsManager;
@class HBDockTile;
@class HBJob; @class HBJob;

View File

@ -22,7 +22,7 @@
@property (nonatomic, readwrite) int bitRate; @property (nonatomic, readwrite) int bitRate;
@property (nonatomic, readwrite) int gain; @property (nonatomic, readwrite) int gain;
@property (nonatomic, readwrite) float drc; @property (nonatomic, readwrite) double drc;
/** /**
* Arrays of possible options for the track properties. * Arrays of possible options for the track properties.

View File

@ -212,7 +212,7 @@
[HBUtilities writeToActivityLog:"%s scan done", self.name.UTF8String]; [HBUtilities writeToActivityLog:"%s scan done", self.name.UTF8String];
return self.titles.count; return (self.titles.count > 0);
} }
- (void)cancelScan - (void)cancelScan

View File

@ -195,20 +195,20 @@ NSString *HBDistributedArraWrittenToDisk = @"HBDistributedArraWrittenToDisk";
*/ */
- (void)reload - (void)reload
{ {
NSMutableArray *temp = nil;; NSMutableArray *jobsArray = nil;;
@try @try
{ {
temp = [NSKeyedUnarchiver unarchiveObjectWithFile:self.fileURL.path]; jobsArray = [NSKeyedUnarchiver unarchiveObjectWithFile:self.fileURL.path];
} }
@catch (NSException *exception) @catch (NSException *exception)
{ {
temp = nil; jobsArray = nil;
} }
// Swap the proxy objects representation with the new // Swap the proxy objects representation with the new
// one read from disk // one read from disk
NSMutableArray *proxyArray = [NSMutableArray array]; NSMutableArray *proxyArray = [NSMutableArray array];
for (id anObject in temp) for (id anObject in jobsArray)
{ {
NSString *uuid = [anObject uuid]; NSString *uuid = [anObject uuid];

View File

@ -432,7 +432,7 @@ NSDictionary *_HandBrake_nlmeansTunesDict;
self.deblock = [preset[@"PictureDeblock"] intValue]; self.deblock = [preset[@"PictureDeblock"] intValue];
} }
self.grayscale = [preset[@"VideoGrayScale"] intValue]; self.grayscale = [preset[@"VideoGrayScale"] boolValue];
} }
self.notificationsEnabled = YES; self.notificationsEnabled = YES;

View File

@ -145,6 +145,7 @@ NSString *HBContainerChangedNotification = @"HBContainerChangedNotificatio
[_chapterTitles release]; [_chapterTitles release];
[_uuid release]; [_uuid release];
[_presetName release];
[super dealloc]; [super dealloc];
} }

View File

@ -179,13 +179,12 @@
/*Opens the app browse window*/ /*Opens the app browse window*/
- (IBAction) browseSendToApp: (id) sender - (IBAction) browseSendToApp: (id) sender
{ {
NSOpenPanel * panel; NSOpenPanel *panel = [NSOpenPanel openPanel];
[panel setAllowsMultipleSelection:NO];
[panel setCanChooseFiles:YES];
[panel setCanChooseDirectories:NO];
panel = [NSOpenPanel openPanel]; NSString *sendToAppDirectory;
[panel setAllowsMultipleSelection: NO];
[panel setCanChooseFiles: YES];
[panel setCanChooseDirectories: NO ];
NSString * sendToAppDirectory;
if ([[NSUserDefaults standardUserDefaults] stringForKey:@"LastSendToAppDirectory"]) if ([[NSUserDefaults standardUserDefaults] stringForKey:@"LastSendToAppDirectory"])
{ {
sendToAppDirectory = [[NSUserDefaults standardUserDefaults] stringForKey:@"LastSendToAppDirectory"]; sendToAppDirectory = [[NSUserDefaults standardUserDefaults] stringForKey:@"LastSendToAppDirectory"];
@ -200,8 +199,8 @@
if (result == NSOKButton) if (result == NSOKButton)
{ {
NSURL *sendToAppURL = [panel URL]; NSURL *sendToAppURL = [panel URL];
NSURL *sendToAppDirectory = [sendToAppURL URLByDeletingLastPathComponent]; NSURL *sendToAppDirectoryURL = [sendToAppURL URLByDeletingLastPathComponent];
[[NSUserDefaults standardUserDefaults] setObject:[sendToAppDirectory path] forKey:@"LastSendToAppDirectory"]; [[NSUserDefaults standardUserDefaults] setObject:[sendToAppDirectoryURL path] forKey:@"LastSendToAppDirectory"];
NSString *sendToAppName = [[sendToAppURL lastPathComponent] stringByDeletingPathExtension]; NSString *sendToAppName = [[sendToAppURL lastPathComponent] stringByDeletingPathExtension];
/* we set the name of the app to send to in the display field */ /* we set the name of the app to send to in the display field */

View File

@ -35,17 +35,17 @@
{ {
QTTime time = [self currentTime]; QTTime time = [self currentTime];
double timeInSeconds = (double)time.timeValue / time.timeScale; double timeInSeconds = (double)time.timeValue / time.timeScale;
UInt16 seconds = fmod(timeInSeconds, 60.0); UInt16 seconds = (UInt16)fmod(timeInSeconds, 60.0);
UInt16 minutes = fmod(timeInSeconds / 60.0, 60.0); UInt16 minutes = (UInt16)fmod(timeInSeconds / 60.0, 60.0);
UInt16 hours = timeInSeconds / (60.0 * 60.0); UInt16 hours = (UInt16)(timeInSeconds / (60.0 * 60.0));
UInt16 milliseconds = (timeInSeconds - (int) timeInSeconds) * 1000; UInt16 milliseconds = (UInt16)(timeInSeconds - (int) timeInSeconds) * 1000;
return [NSString stringWithFormat:@"%02d:%02d:%02d.%03d", hours, minutes, seconds, milliseconds]; return [NSString stringWithFormat:@"%02d:%02d:%02d.%03d", hours, minutes, seconds, milliseconds];
} }
- (void) setCurrentTimeDouble: (double) value - (void) setCurrentTimeDouble: (double) value
{ {
long timeScale = [[self attributeForKey:QTMovieTimeScaleAttribute] longValue]; long timeScale = [[self attributeForKey:QTMovieTimeScaleAttribute] longValue];
[self setCurrentTime:QTMakeTime(value * timeScale, timeScale)]; [self setCurrentTime:QTMakeTime((long long)value * timeScale, timeScale)];
} }
@end @end
@ -370,8 +370,8 @@ typedef enum ViewMode : NSUInteger {
NSRect frame = [[self window] frame]; NSRect frame = [[self window] frame];
// Calculate border around content region of the frame // Calculate border around content region of the frame
int borderX = frame.size.width - currentSize.width; int borderX = (int)(frame.size.width - currentSize.width);
int borderY = frame.size.height - currentSize.height; int borderY = (int)(frame.size.height - currentSize.height);
// Make sure the frame is smaller than the screen // Make sure the frame is smaller than the screen
NSSize maxSize = [[[self window] screen] visibleFrame].size; NSSize maxSize = [[[self window] screen] visibleFrame].size;

View File

@ -7,18 +7,11 @@
#import "HBPreviewGenerator.h" #import "HBPreviewGenerator.h"
#import "HBUtilities.h" #import "HBUtilities.h"
#import "Controller.h"
#import "HBCore.h" #import "HBCore.h"
#import "HBJob.h" #import "HBJob.h"
#import "HBJob+HBJobConversion.h" #import "HBJob+HBJobConversion.h"
typedef enum EncodeState : NSUInteger {
EncodeStateIdle,
EncodeStateWorking,
EncodeStateCancelled,
} EncodeState;
@interface HBPreviewGenerator () @interface HBPreviewGenerator ()
@property (nonatomic, readonly, retain) NSMutableDictionary *picturePreviews; @property (nonatomic, readonly, retain) NSMutableDictionary *picturePreviews;
@ -271,8 +264,6 @@ typedef enum EncodeState : NSUInteger {
} }
} }
completationHandler:^(BOOL success) { completationHandler:^(BOOL success) {
self.core = nil;
// Encode done, call the delegate and close libhb handle // Encode done, call the delegate and close libhb handle
if (success) if (success)
{ {
@ -282,6 +273,7 @@ typedef enum EncodeState : NSUInteger {
{ {
[self.delegate didCancelMovieCreation]; [self.delegate didCancelMovieCreation];
} }
self.core = nil;
}]; }];
return YES; return YES;

View File

@ -404,7 +404,7 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification";
encodeBool(_twoPass); encodeBool(_twoPass);
encodeBool(_turboTwoPass); encodeBool(_turboTwoPass);
encodeInt(_advancedOptions); encodeBool(_advancedOptions);
encodeObject(_preset); encodeObject(_preset);
encodeObject(_tune); encodeObject(_tune);
encodeObject(_profile); encodeObject(_profile);
@ -434,7 +434,7 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification";
decodeBool(_twoPass); decodeBool(_twoPass);
decodeBool(_turboTwoPass); decodeBool(_turboTwoPass);
decodeInt(_advancedOptions); decodeBool(_advancedOptions);
decodeObject(_preset); decodeObject(_preset);
decodeObject(_tune); decodeObject(_tune);
decodeObject(_profile); decodeObject(_profile);
@ -624,10 +624,10 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification";
self.frameRate = intValue; self.frameRate = intValue;
// 2 Pass Encoding. // 2 Pass Encoding.
self.twoPass = [preset[@"VideoTwoPass"] intValue]; self.twoPass = [preset[@"VideoTwoPass"] boolValue];
// Turbo 1st pass for 2 Pass Encoding. // Turbo 1st pass for 2 Pass Encoding.
self.turboTwoPass = [preset[@"VideoTurboTwoPass"] intValue]; self.turboTwoPass = [preset[@"VideoTurboTwoPass"] boolValue];
self.notificationsEnabled = YES; self.notificationsEnabled = YES;
} }

View File

@ -190,13 +190,13 @@ static void *HBVideoControllerContext = &HBVideoControllerContext;
granularity = [[NSUserDefaults standardUserDefaults] granularity = [[NSUserDefaults standardUserDefaults]
floatForKey:@"x264CqSliderFractional"]; floatForKey:@"x264CqSliderFractional"];
} }
[fVidQualitySlider setNumberOfTickMarks:((maxValue - minValue) * [fVidQualitySlider setNumberOfTickMarks:(int)((maxValue - minValue) *
(1.0f / granularity)) + 1]; (1.0f / granularity)) + 1];
// Replace the slider transformer with a new one, // Replace the slider transformer with a new one,
// configured with the new max/min/direction values. // configured with the new max/min/direction values.
[fVidQualitySlider unbind:@"value"]; [fVidQualitySlider unbind:@"value"];
HBQualityTransformer *transformer = [[[HBQualityTransformer alloc] initWithReversedDirection:direction min:minValue max:maxValue] autorelease]; HBQualityTransformer *transformer = [[[HBQualityTransformer alloc] initWithReversedDirection:(direction != 0) min:minValue max:maxValue] autorelease];
[fVidQualitySlider bind:@"value" toObject:self withKeyPath:@"self.video.quality" options:@{NSValueTransformerBindingOption: transformer}]; [fVidQualitySlider bind:@"value" toObject:self withKeyPath:@"self.video.quality" options:@{NSValueTransformerBindingOption: transformer}];
} }

View File

@ -1427,9 +1427,11 @@
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
@ -1447,13 +1449,16 @@
); );
GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_SHADOW = NO; GCC_WARN_SHADOW = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.6; MACOSX_DEPLOYMENT_TARGET = 10.6;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
@ -1473,9 +1478,11 @@
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES; COPY_PHASE_STRIP = YES;
@ -1489,13 +1496,16 @@
GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_SHADOW = NO; GCC_WARN_SHADOW = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.6; MACOSX_DEPLOYMENT_TARGET = 10.6;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (

View File

@ -35,7 +35,7 @@ int main(int argc, const char **argv)
// Tell sigaction to ignore the SIGINT signal // Tell sigaction to ignore the SIGINT signal
// because we handle it already with gcd. // because we handle it already with gcd.
struct sigaction action = { 0 }; struct sigaction action = { {0}, 0, 0 };
action.sa_handler = SIG_IGN; action.sa_handler = SIG_IGN;
sigaction(SIGINT, &action, NULL); sigaction(SIGINT, &action, NULL);