Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix couple of build warnings (#3218)
* Fix couple of build warnings

* revert scripts

* fix comment

* fix localize
  • Loading branch information
Kaspik committed Nov 2, 2018
1 parent 0d5d072 commit 81986f5
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Source/SPConnectionController.m
Expand Up @@ -2399,7 +2399,7 @@ - (void)failConnectionWithTitle:(NSString *)theTitle errorMessage:(NSString *)th

// Inform the delegate that the connection attempt failed
if (delegate && [delegate respondsToSelector:@selector(connectionControllerConnectAttemptFailed:)]) {
[[(NSObject *)delegate onMainThread] connectionControllerConnectAttemptFailed:self];
[[(id)delegate onMainThread] connectionControllerConnectAttemptFailed:self];
}

// Only display the connection error message if there is a window visible
Expand Down
2 changes: 1 addition & 1 deletion Source/SPEditorPreferencePane.m
Expand Up @@ -486,7 +486,7 @@ - (void)colorChanged:(id)sender
/**
* Sets the font panel's valid modes.
*/
- (NSUInteger)validModesForFontPanel:(NSFontPanel *)fontPanel
- (NSFontPanelModeMask)validModesForFontPanel:(NSFontPanel *)fontPanel
{
return (NSFontPanelSizeModeMask | NSFontPanelCollectionModeMask);
}
Expand Down
4 changes: 3 additions & 1 deletion Source/SPFilterTableController.m
Expand Up @@ -652,7 +652,9 @@ - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)aFieldEdit
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command
{
// Check firstly if SPCopyTable can handle command
if ([control control:control textView:textView doCommandBySelector:command]) return YES;
if ([control respondsToSelector:@selector(control:textView:doCommandBySelector:)]) {
if ([(id)control control:control textView:textView doCommandBySelector:command]) return YES;
}

// Trap the escape key
if ([[control window] methodForSelector:command] == [[control window] methodForSelector:@selector(cancelOperation:)]) {
Expand Down
2 changes: 2 additions & 0 deletions Source/SPNavigatorController.m
Expand Up @@ -936,6 +936,8 @@ - (id)outlineView:(id)outlineView objectValueForTableColumn:(NSTableColumn *)tab
case SPTableTypeFunc:
[[tableColumn dataCell] setImage:functionIcon];
break;
default:
break;
}
} else {
[[tableColumn dataCell] setImage:databaseIcon];
Expand Down
10 changes: 5 additions & 5 deletions Source/SPRuleFilterController.m
Expand Up @@ -376,13 +376,13 @@ - (NSInteger)ruleEditor:(NSRuleEditor *)editor numberOfChildrenForCriterion:(nul
// the child of an argument can only be the conjunction label if more arguments follow
else if(type == RuleNodeTypeArgument) {
ArgNode *node = (ArgNode *)criterion;
NSInteger numOfArgs = [[[node filter] objectForKey:@"NumberOfArguments"] integerValue];
NSUInteger numOfArgs = [[[node filter] objectForKey:@"NumberOfArguments"] unsignedIntegerValue];
return (numOfArgs > [node argIndex]+1) ? 1 : 0;
}
// the child of a conjunction is the next argument, if we have one
else if(type == RuleNodeTypeConnector) {
ConnectorNode *node = (ConnectorNode *)criterion;
NSInteger numOfArgs = [[[node filter] objectForKey:@"NumberOfArguments"] integerValue];
NSUInteger numOfArgs = [[[node filter] objectForKey:@"NumberOfArguments"] unsignedIntegerValue];
return (numOfArgs > [node labelIndex]+1) ? 1 : 0;
}
}
Expand Down Expand Up @@ -424,7 +424,7 @@ - (id)ruleEditor:(NSRuleEditor *)editor child:(NSInteger)index forCriterion:(nul
else if(type == RuleNodeTypeArgument) {
NSDictionary *filter = [(ArgNode *)criterion filter];
NSUInteger argIndex = [(ArgNode *)criterion argIndex];
if([[filter objectForKey:@"NumberOfArguments"] integerValue] > argIndex +1) {
if([[filter objectForKey:@"NumberOfArguments"] unsignedIntegerValue] > argIndex +1) {
ConnectorNode *node = [[ConnectorNode alloc] init];
[node setFilter:filter];
[node setLabelIndex:argIndex]; // label 0 follows argument 0
Expand All @@ -434,7 +434,7 @@ - (id)ruleEditor:(NSRuleEditor *)editor child:(NSInteger)index forCriterion:(nul
// the child of a conjunction is the next argument, if we have one
else if(type == RuleNodeTypeConnector) {
ConnectorNode *node = (ConnectorNode *)criterion;
NSInteger numOfArgs = [[[node filter] objectForKey:@"NumberOfArguments"] integerValue];
NSUInteger numOfArgs = [[[node filter] objectForKey:@"NumberOfArguments"] unsignedIntegerValue];
if(numOfArgs > [node labelIndex]+1) {
ArgNode *arg = [[ArgNode alloc] init];
[arg setFilter:[node filter]];
Expand Down Expand Up @@ -1141,7 +1141,7 @@ - (NSMutableDictionary *)_restoreSerializedFilter:(NSDictionary *)serialized
}

//now we have to create the argument node(s)
NSInteger numOfArgs = [[[op filter] objectForKey:@"NumberOfArguments"] integerValue];
NSUInteger numOfArgs = [[[op filter] objectForKey:@"NumberOfArguments"] unsignedIntegerValue];
//fail if the current op requires more arguments than we have stored values for
NSArray *values = [serialized objectForKey:SerFilterExprValues];
if(numOfArgs > [values count]) {
Expand Down
4 changes: 3 additions & 1 deletion Source/SPTextView.m
Expand Up @@ -535,6 +535,8 @@ - (NSArray *)suggestionsForSQLCompletionWith:(NSString *)currentWord dictMode:(B
[possibleCompletions addObject:[NSDictionary dictionaryWithObjectsAndKeys:[[table componentsSeparatedByString:SPUniqueSchemaDelimiter] lastObject], @"display", @"func-small", @"image", tablepath, @"path", @"", @"isRef", nil]];
breakFlag = YES;
break;
default:
break;
}
if(!breakFlag) {
NSArray *sortedFields = [allFields sortedArrayUsingDescriptors:@[desc]];
Expand Down Expand Up @@ -3421,7 +3423,7 @@ - (void)textStorageDidProcessEditing:(NSNotification *)notification
/**
* Set font panel's valid modes
*/
- (NSUInteger)validModesForFontPanel:(NSFontPanel *)fontPanel
- (NSFontPanelModeMask)validModesForFontPanel:(NSFontPanel *)fontPanel
{
return (NSFontPanelSizeModeMask|NSFontPanelCollectionModeMask);
}
Expand Down

0 comments on commit 81986f5

Please sign in to comment.