aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2013-05-21 22:53:10 +0000
committerrowanbeentje <rowan@beent.je>2013-05-21 22:53:10 +0000
commit2737ac00c38513d976fda08104a5014221b0c99c (patch)
tree38829f7d5d9982b9648259cae0a269ef1640dd18 /Source
parent9432986de1d25527b133715ab12a8dffc2c5f6b6 (diff)
downloadsequelpro-2737ac00c38513d976fda08104a5014221b0c99c.tar.gz
sequelpro-2737ac00c38513d976fda08104a5014221b0c99c.tar.bz2
sequelpro-2737ac00c38513d976fda08104a5014221b0c99c.zip
- Fix all the Xcode 4.6.2 build warnings, and tweak warning settings to enable some more
Diffstat (limited to 'Source')
-rw-r--r--Source/DMLocalizedNibBundle.m6
-rw-r--r--Source/NoodleLineNumberView.m13
-rw-r--r--Source/QLPreviewPanel.h8
-rw-r--r--Source/SPBundleCommandTextView.m6
-rw-r--r--Source/SPBundleHTMLOutputController.m2
-rw-r--r--Source/SPCSVExporter.m2
-rw-r--r--Source/SPChooseMenuItemDialog.m12
-rw-r--r--Source/SPColorAdditions.m8
-rw-r--r--Source/SPConnectionController.m4
-rw-r--r--Source/SPConnectionControllerDataSource.m5
-rw-r--r--Source/SPConnectionControllerDelegate.m2
-rw-r--r--Source/SPConnectionControllerInitializer.m11
-rw-r--r--Source/SPCustomQuery.m17
-rw-r--r--Source/SPDataAdditions.m4
-rw-r--r--Source/SPDataImport.m1
-rw-r--r--Source/SPDataStorage.m14
-rw-r--r--Source/SPDatabaseDocument.m6
-rw-r--r--Source/SPDotExporter.m2
-rw-r--r--Source/SPExportFileUtilities.m2
-rw-r--r--Source/SPExtendedTableInfo.m1
-rw-r--r--Source/SPFavoriteTextFieldCell.m2
-rw-r--r--Source/SPFavoritesController.m4
-rw-r--r--Source/SPFieldEditorController.h1
-rw-r--r--Source/SPFieldEditorController.m12
-rw-r--r--Source/SPFieldMapperController.h1
-rw-r--r--Source/SPFieldMapperController.m29
-rw-r--r--Source/SPHTMLExporter.m2
-rw-r--r--Source/SPIndexesController.m2
-rw-r--r--Source/SPPDFExporter.m2
-rw-r--r--Source/SPQueryDocumentsController.m1
-rw-r--r--Source/SPSQLExporter.m2
-rw-r--r--Source/SPServerSupport.m2
-rw-r--r--Source/SPSingleton.m2
-rw-r--r--Source/SPSplitView.m4
-rw-r--r--Source/SPStringAdditions.m2
-rw-r--r--Source/SPTableContent.m5
-rw-r--r--Source/SPTableContentDelegate.m4
-rw-r--r--Source/SPTableContentFilter.m4
-rw-r--r--Source/SPTableData.m4
-rw-r--r--Source/SPTableFieldValidation.m2
-rw-r--r--Source/SPTableStructure.m1
-rw-r--r--Source/SPTableStructureDelegate.m6
-rw-r--r--Source/SPTableStructureLoading.m3
-rw-r--r--Source/SPTableTriggers.m2
-rw-r--r--Source/SPTablesList.m1
-rw-r--r--Source/SPTextView.m9
-rw-r--r--Source/SPWindowController.m1
-rw-r--r--Source/SPWindowControllerDelegate.h4
-rw-r--r--Source/SPXMLExporter.m2
49 files changed, 112 insertions, 130 deletions
diff --git a/Source/DMLocalizedNibBundle.m b/Source/DMLocalizedNibBundle.m
index 80274a29..2c25cea4 100644
--- a/Source/DMLocalizedNibBundle.m
+++ b/Source/DMLocalizedNibBundle.m
@@ -15,7 +15,7 @@
+ (BOOL)deliciousLocalizingLoadNibFile:(NSString *)fileName externalNameTable:(NSDictionary *)context withZone:(NSZone *)zone;
@end
-@interface NSBundle ()
+@interface NSBundle (DMLocalizedNibBundle_Private_API)
+ (void)_localizeStringsInObject:(id)object table:(NSString *)table;
+ (NSString *)_localizedStringForString:(NSString *)string table:(NSString *)table;
// localize particular attributes in objects
@@ -74,10 +74,12 @@ static NSMutableArray *deliciousBindingKeys = nil;
}
}
-
+@end
#pragma mark Private API
+@implementation NSBundle (DMLocalizedNibBundle_Private_API)
+
+ (void)_localizeStringsInObject:(id)object table:(NSString *)table;
{
if ([object isKindOfClass:[NSArray class]]) {
diff --git a/Source/NoodleLineNumberView.m b/Source/NoodleLineNumberView.m
index 007e5f0b..8307367f 100644
--- a/Source/NoodleLineNumberView.m
+++ b/Source/NoodleLineNumberView.m
@@ -79,11 +79,8 @@ typedef NSRange (*RangeOfLineIMP)(id object, SEL selector, NSRange range);
[self font], NSFontAttributeName,
[self textColor], NSForegroundColorAttributeName,
nil] retain];
-#ifndef SP_CODA
- NSSize s = [[NSString stringWithString:@"8"] sizeWithAttributes:textAttributes];
-#else
+
NSSize s = [@"8" sizeWithAttributes:textAttributes];
-#endif
maxWidthOfGlyph = s.width;
maxHeightOfGlyph = s.height;
[self updateGutterThicknessConstants];
@@ -135,11 +132,7 @@ typedef NSRange (*RangeOfLineIMP)(id object, SEL selector, NSRange range);
font, NSFontAttributeName,
[self textColor], NSForegroundColorAttributeName,
nil] retain];
-#ifndef SP_CODA
- NSSize s = [[NSString stringWithString:@"8"] sizeWithAttributes:textAttributes];
-#else
NSSize s = [@"8" sizeWithAttributes:textAttributes];
-#endif
maxWidthOfGlyph = s.width;
maxHeightOfGlyph = s.height;
[self updateGutterThicknessConstants];
@@ -165,11 +158,7 @@ typedef NSRange (*RangeOfLineIMP)(id object, SEL selector, NSRange range);
[self font], NSFontAttributeName,
textColor, NSForegroundColorAttributeName,
nil] retain];
-#ifndef SP_CODA
- NSSize s = [[NSString stringWithString:@"8"] sizeWithAttributes:textAttributes];
-#else
NSSize s = [@"8" sizeWithAttributes:textAttributes];
-#endif
maxWidthOfGlyph = s.width;
maxHeightOfGlyph = s.height;
[self updateGutterThicknessConstants];
diff --git a/Source/QLPreviewPanel.h b/Source/QLPreviewPanel.h
index 1c255f3f..04e4330d 100644
--- a/Source/QLPreviewPanel.h
+++ b/Source/QLPreviewPanel.h
@@ -37,7 +37,7 @@
+ (id)sharedPreviewPanel;
+ (id)_previewPanel;
+ (BOOL)isSharedPreviewPanelLoaded;
-- (id)initWithContentRect:(struct _NSRect)fp8 styleMask:(NSUInteger)fp24 backing:(NSUInteger)fp28 defer:(BOOL)fp32;
+- (id)initWithContentRect:(NSRect)fp8 styleMask:(NSUInteger)fp24 backing:(NSUInteger)fp28 defer:(BOOL)fp32;
- (id)initWithCoder:(id)fp8;
- (void)dealloc;
- (BOOL)isOpaque;
@@ -45,9 +45,9 @@
- (BOOL)canBecomeMainWindow;
- (BOOL)shouldIgnorePanelFrameChanges;
- (BOOL)isOpen;
-- (void)setFrame:(struct _NSRect)fp8 display:(BOOL)fp24 animate:(BOOL)fp28;
-- (id)_subEffectsForWindow:(id)fp8 itemFrame:(struct _NSRect)fp12 transitionWindow:(id *)fp28;
-- (id)_scaleEffectForItemFrame:(struct _NSRect)fp8 transitionWindow:(id *)fp24;
+- (void)setFrame:(NSRect)fp8 display:(BOOL)fp24 animate:(BOOL)fp28;
+- (id)_subEffectsForWindow:(id)fp8 itemFrame:(NSRect)fp12 transitionWindow:(id *)fp28;
+- (id)_scaleEffectForItemFrame:(NSRect)fp8 transitionWindow:(id *)fp24;
- (void)_invertCurrentEffect;
- (struct _NSRect)_currentItemFrame;
- (void)setAutosizesAndCenters:(BOOL)fp8;
diff --git a/Source/SPBundleCommandTextView.m b/Source/SPBundleCommandTextView.m
index 111ca2dc..566b244f 100644
--- a/Source/SPBundleCommandTextView.m
+++ b/Source/SPBundleCommandTextView.m
@@ -146,11 +146,11 @@
NSString *newString;
// check for line ending
if([textViewString characterAtIndex:NSMaxRange(firstLineRange)-1] == '\r')
- newString = [[NSString stringWithString:@"\t"] stringByAppendingString:
+ newString = [@"\t" stringByAppendingString:
[[textViewString substringWithRange:blockRange]
stringByReplacingOccurrencesOfString:@"\r" withString:@"\r\t"]];
else
- newString = [[NSString stringWithString:@"\t"] stringByAppendingString:
+ newString = [@"\t" stringByAppendingString:
[[textViewString substringWithRange:blockRange]
stringByReplacingOccurrencesOfString:@"\n" withString:@"\n\t"]];
@@ -375,7 +375,7 @@
NSInteger tabStopWidth = [prefs integerForKey:SPCustomQueryEditorTabStopWidth];
if(tabStopWidth < 1) tabStopWidth = 1;
- float tabWidth = NSSizeToCGSize([[NSString stringWithString:@" "] sizeWithAttributes:[NSDictionary dictionaryWithObject:tvFont forKey:NSFontAttributeName]]).width;
+ float tabWidth = NSSizeToCGSize([@" " sizeWithAttributes:[NSDictionary dictionaryWithObject:tvFont forKey:NSFontAttributeName]]).width;
tabWidth = (float)tabStopWidth * tabWidth;
NSInteger numberOfTabs = 256/tabStopWidth;
diff --git a/Source/SPBundleHTMLOutputController.m b/Source/SPBundleHTMLOutputController.m
index e9b4ec8c..d938f0e2 100644
--- a/Source/SPBundleHTMLOutputController.m
+++ b/Source/SPBundleHTMLOutputController.m
@@ -529,7 +529,7 @@
- (void)webView:(WebView *)webView exceptionWasRaised:(WebScriptCallFrame *)frame sourceId:(NSInteger)sid line:(NSInteger)lineno forWebFrame:(WebFrame *)webFrame
{
- NSString *mes = [NSString stringWithFormat:@"Exception:\nline = %ld\nfunction = %@\ncaller = %@\nexception = %@", lineno, [frame functionName], [frame caller], [frame userInfo], [frame exception]];
+ NSString *mes = [NSString stringWithFormat:@"Exception:\nline = %ld\nfunction = %@\ncaller = %@\nuserinfo = %@\nexception = %@", lineno, [frame functionName], [frame caller], [frame userInfo], [frame exception]];
if([self suppressExceptionAlerting]) {
NSLog(@"%@", mes);
diff --git a/Source/SPCSVExporter.m b/Source/SPCSVExporter.m
index 8657d766..a56ae789 100644
--- a/Source/SPCSVExporter.m
+++ b/Source/SPCSVExporter.m
@@ -58,7 +58,7 @@
*
* @return The initialised instance
*/
-- (id)initWithDelegate:(NSObject *)exportDelegate
+- (id)initWithDelegate:(NSObject<SPCSVExporterProtocol> *)exportDelegate
{
if ((self = [super init])) {
SPExportDelegateConformsToProtocol(exportDelegate, @protocol(SPCSVExporterProtocol));
diff --git a/Source/SPChooseMenuItemDialog.m b/Source/SPChooseMenuItemDialog.m
index 4bfdcbcb..770c1891 100644
--- a/Source/SPChooseMenuItemDialog.m
+++ b/Source/SPChooseMenuItemDialog.m
@@ -106,7 +106,7 @@
for (id item in theList)
{
- NSMenuItem *aMenuItem;
+ NSMenuItem *aMenuItem = nil;
if ([item isKindOfClass:[NSString class]]) {
aMenuItem = [[NSMenuItem alloc] initWithTitle:item action:@selector(menuItemHandler:) keyEquivalent:@""];
@@ -124,10 +124,12 @@
[aMenuItem setToolTip:[item objectForKey:@"tooltip"]];
}
}
-
- [aMenuItem setTag:cnt++];
- [theMenu addItem:aMenuItem];
- [aMenuItem release];
+
+ if (aMenuItem) {
+ [aMenuItem setTag:cnt++];
+ [theMenu addItem:aMenuItem];
+ [aMenuItem release];
+ }
}
[dialog setContextMenu:theMenu];
diff --git a/Source/SPColorAdditions.m b/Source/SPColorAdditions.m
index e3075c6e..92e9db31 100644
--- a/Source/SPColorAdditions.m
+++ b/Source/SPColorAdditions.m
@@ -46,10 +46,10 @@
if(aColor) {
[aColor getRed:&red green:&green blue:&blue alpha:&alpha];
- redHexValue = [NSString stringWithFormat:@"%02X", (NSInteger)(red * 255.0f)];
- greenHexValue = [NSString stringWithFormat:@"%02X", (NSInteger)(green * 255.0f)];
- blueHexValue = [NSString stringWithFormat:@"%02X", (NSInteger)(blue * 255.0f)];
- alphaHexValue = [NSString stringWithFormat:@"%02X", (NSInteger)(alpha * 255.0f)];
+ redHexValue = [NSString stringWithFormat:@"%02lX", (long)(red * 255.0f)];
+ greenHexValue = [NSString stringWithFormat:@"%02lX", (long)(green * 255.0f)];
+ blueHexValue = [NSString stringWithFormat:@"%02lX", (long)(blue * 255.0f)];
+ alphaHexValue = [NSString stringWithFormat:@"%02lX", (long)(alpha * 255.0f)];
if([alphaHexValue isEqualToString:@"FF"]) alphaHexValue = @"";
return [NSString stringWithFormat:@"#%@%@%@%@", redHexValue, greenHexValue, blueHexValue, alphaHexValue];
}
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index f68e2036..359e2488 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -1092,14 +1092,14 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2,
if (contextInfo == SPExportFavorites) {
SPFavoritesExporter *exporter = [[[SPFavoritesExporter alloc] init] autorelease];
- [exporter setDelegate:self];
+ [exporter setDelegate:(NSObject<SPFavoritesExportProtocol> *)self];
[exporter writeFavorites:[self selectedFavoriteNodes] toFile:[panel filename]];
}
else if (contextInfo == SPImportFavorites) {
SPFavoritesImporter *importer = [[SPFavoritesImporter alloc] init];
- [importer setDelegate:self];
+ [importer setDelegate:(NSObject<SPFavoritesImportProtocol> *)self];
[importer importFavoritesFromFileAtPath:[panel filename]];
}
diff --git a/Source/SPConnectionControllerDataSource.m b/Source/SPConnectionControllerDataSource.m
index 231737c7..3bee67e5 100644
--- a/Source/SPConnectionControllerDataSource.m
+++ b/Source/SPConnectionControllerDataSource.m
@@ -86,11 +86,6 @@
return NSArrayObjectAtIndex([node childNodes], childIndex);
}
-- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item
-{
- return [(SPTreeNode *)item isGroup];
-}
-
- (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item
{
SPTreeNode *node = (SPTreeNode *)item;
diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m
index 28dd8282..9c9d53ca 100644
--- a/Source/SPConnectionControllerDelegate.m
+++ b/Source/SPConnectionControllerDelegate.m
@@ -49,7 +49,7 @@ static NSString *SPQuickConnectImage = @"quick-connect-icon.pdf";
static NSString *SPQuickConnectImageWhite = @"quick-connect-icon-white.pdf";
#endif
-@interface SPConnectionController ()
+@interface SPConnectionController (SPConnectionControllerDelegate_Private_API)
// Privately redeclare as read/write to get the synthesized setter
@property (readwrite, assign) BOOL isEditingConnection;
diff --git a/Source/SPConnectionControllerInitializer.m b/Source/SPConnectionControllerInitializer.m
index 4bef6178..7ea615e5 100644
--- a/Source/SPConnectionControllerInitializer.m
+++ b/Source/SPConnectionControllerInitializer.m
@@ -50,12 +50,21 @@ static NSString *SPConnectionViewNibName = @"ConnectionView";
- (void)_reloadFavoritesViewData;
- (void)_selectNode:(SPTreeNode *)node;
- (void)_scrollToSelectedNode;
-- (void)_restoreOutlineViewStateNode:(SPTreeNode *)node;
+- (void)_documentWillClose:(NSNotification *)notification;
- (SPTreeNode *)_favoriteNodeForFavoriteID:(NSInteger)favoriteID;
+- (void)scrollViewFrameChanged:(NSNotification *)aNotification;
+
+@end
+
+@interface SPConnectionController (SPConnectionControllerInitializer_Private_API)
+
+- (void)_restoreOutlineViewStateNode:(SPTreeNode *)node;
+
@end
+
@implementation SPConnectionController (SPConnectionControllerInitializer)
/**
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index d2788cd9..686e700b 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -1663,11 +1663,10 @@
// Update font size on the table
#ifndef SP_CODA
NSFont *tableFont = [NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPGlobalResultTableFont]];
- [customQueryView setRowHeight:2.0f+NSSizeToCGSize([[NSString stringWithString:@"{ǞṶḹÜ∑zgyf"] sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height];
#else
NSFont *tableFont = [NSFont systemFontOfSize:[NSFont smallSystemFontSize]];
- [customQueryView setRowHeight:2.0f+NSSizeToCGSize([@"{ǞṶḹÜ∑zgyf" sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height];
#endif
+ [customQueryView setRowHeight:2.0f+NSSizeToCGSize([@"{ǞṶḹÜ∑zgyf" sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height];
// If there are no table columns to add, return
if (!cqColumnDefinition || ![cqColumnDefinition count]) return;
@@ -3167,7 +3166,7 @@
// Handle "see [...]" and "in [...]"-style 5.x links.
//look-behind won't work here because of the \s+
- [desc replaceOccurrencesOfRegex:@"(See|see|In|in|and)\\s+\\[(?:HELP\\s+)?([^\\]]*?)\\]" withString:[NSString stringWithFormat:@"$1 $2",[SPCustomQuery linkToHelpTopic:@"$2"]]];
+ [desc replaceOccurrencesOfRegex:@"(See|see|In|in|and)\\s+\\[(?:HELP\\s+)?([^\\]]*?)\\]" withString:[NSString stringWithFormat:@"$1 %@",[SPCustomQuery linkToHelpTopic:@"$2"]]];
[theHelp appendFormat:@"<pre class='description'>%@</pre>", desc];
}
@@ -3184,7 +3183,7 @@
if(![searchString isEqualToString:SP_HELP_TOC_SEARCH_STRING])
[theHelp appendFormat:@"<br><i>%@</i><br>", [NSString stringWithFormat:NSLocalizedString(@"Help topics for “%@”", @"MySQL Help Viewer : Results list : Page title"), searchString]];
else
- [theHelp appendFormat:@"<br><b>%@:</b><br>", NSLocalizedString(@"MySQL Help – Categories", @"mysql help categories"), searchString];
+ [theHelp appendFormat:@"<br><b>%@:</b><br>", NSLocalizedString(@"MySQL Help – Categories", @"mysql help categories")];
// iterate through all found rows and print them as HTML ul/li list
[theHelp appendString:@"<ul>"];
@@ -3535,7 +3534,7 @@
else if ([keyPath isEqualToString:SPGlobalResultTableFont]) {
NSFont *tableFont = [NSUnarchiver unarchiveObjectWithData:[change objectForKey:NSKeyValueChangeNewKey]];
#ifndef SP_CODA
- [customQueryView setRowHeight:2.0f+NSSizeToCGSize([[NSString stringWithString:@"{ǞṶḹÜ∑zgyf"] sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height];
+ [customQueryView setRowHeight:2.0f+NSSizeToCGSize([@"{ǞṶḹÜ∑zgyf" sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height];
#else
[customQueryView setRowHeight:2.0f+NSSizeToCGSize([@"{ǞṶḹÜ∑zgyf" sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height];
#endif
@@ -3723,11 +3722,7 @@
{
if ((self = [super init])) {
-#ifndef SP_CODA
- usedQuery = [[NSString stringWithString:@""] retain];
-#else
usedQuery = [@"" retain];
-#endif
lastExecutedQuery = nil;
fieldIDQueryString = nil;
sortField = nil;
@@ -3923,11 +3918,7 @@
if([control isKindOfClass:[SPCopyTable class]]) {
// Check firstly if SPCopyTable can handle command
-#ifndef SP_CODA
- if([customQueryView control:control textView:aTextView doCommandBySelector:(SEL)command])
-#else
if([customQueryView control:control textView:aTextView doCommandBySelector:command])
-#endif
return YES;
// Trap the escape key
diff --git a/Source/SPDataAdditions.m b/Source/SPDataAdditions.m
index 351ef4d8..9f973b8e 100644
--- a/Source/SPDataAdditions.m
+++ b/Source/SPDataAdditions.m
@@ -224,7 +224,7 @@
NSMutableString *retVal = [NSMutableString string];
// get the length of the longest location
- NSUInteger longest = [(NSString *)[NSString stringWithFormat:@"%X", totalLength - ( totalLength % bytesPerLine )] length];
+ NSUInteger longest = [(NSString *)[NSString stringWithFormat:@"%lX", totalLength - ( totalLength % bytesPerLine )] length];
for ( i = 0; i < totalLength; i += bytesPerLine ) {
@@ -235,7 +235,7 @@
NSUInteger buffLength = bytesPerLine;
// add hex value of location
- [location appendFormat:@"%X", i];
+ [location appendFormat:@"%llX", (unsigned long long)i];
// pad it
while( longest > [location length] ) {
diff --git a/Source/SPDataImport.m b/Source/SPDataImport.m
index d00e6023..729a7139 100644
--- a/Source/SPDataImport.m
+++ b/Source/SPDataImport.m
@@ -36,6 +36,7 @@
#import "SPDatabaseViewController.h"
#import "SPTablesList.h"
#import "SPTableStructure.h"
+#import "SPDatabaseStructure.h"
#import "SPTableContent.h"
#import "SPCustomQuery.h"
#import "SPGrowlController.h"
diff --git a/Source/SPDataStorage.m b/Source/SPDataStorage.m
index ec1ad493..1b3d1cba 100644
--- a/Source/SPDataStorage.m
+++ b/Source/SPDataStorage.m
@@ -59,7 +59,7 @@ static inline void SPDataStorageEnsureCapacityForAdditionalRowCount(SPDataStorag
{
// Throw an exception if the index is out of bounds
- if (index >= numRows) [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", index, numRows];
+ if (index >= numRows) [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", (unsigned long long)index, (unsigned long long)numRows];
// Construct the NSMutableArray
NSMutableArray *rowArray = [NSMutableArray arrayWithCapacity:numColumns];
@@ -79,7 +79,7 @@ static inline void SPDataStorageEnsureCapacityForAdditionalRowCount(SPDataStorag
{
// Throw an exception if the row or column index is out of bounds
- if (rowIndex >= numRows || columnIndex >= numColumns) [NSException raise:NSRangeException format:@"Requested storage index (row %llu, col %llu) beyond bounds (%llu, %llu)", rowIndex, columnIndex, numRows, numColumns];
+ if (rowIndex >= numRows || columnIndex >= numColumns) [NSException raise:NSRangeException format:@"Requested storage index (row %llu, col %llu) beyond bounds (%llu, %llu)", (unsigned long long)rowIndex, (unsigned long long)columnIndex, (unsigned long long)numRows, (unsigned long long)numColumns];
// Return the content
return dataStorage[rowIndex][columnIndex];
@@ -166,7 +166,7 @@ static inline void SPDataStorageEnsureCapacityForAdditionalRowCount(SPDataStorag
{
// Throw an exception if the index is out of bounds
- if (index > numRows) [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", index, numRows];
+ if (index > numRows) [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", (unsigned long long)index, (unsigned long long)numRows];
// If "inserting" at the end of the array just add a row
if (index == numRows) return SPDataStorageAddRow(self, row);
@@ -206,7 +206,7 @@ static inline void SPDataStorageEnsureCapacityForAdditionalRowCount(SPDataStorag
NSUInteger cellsProcessed = 0;
// Throw an exception if the index is out of bounds
- if (index >= numRows) [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", index, numRows];
+ if (index >= numRows) [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", (unsigned long long)index, (unsigned long long)numRows];
id *storageRow = dataStorage[index];
@@ -234,7 +234,7 @@ static inline void SPDataStorageEnsureCapacityForAdditionalRowCount(SPDataStorag
{
// Throw an exception of either index is out of bounds
- if (rowIndex >= numRows || columnIndex >= numColumns) [NSException raise:NSRangeException format:@"Requested storage index (row %llu, col %llu) beyond bounds (%llu, %llu)", rowIndex, columnIndex, numRows, numColumns];
+ if (rowIndex >= numRows || columnIndex >= numColumns) [NSException raise:NSRangeException format:@"Requested storage index (row %llu, col %llu) beyond bounds (%llu, %llu)", (unsigned long long)rowIndex, (unsigned long long)columnIndex, (unsigned long long)numRows, (unsigned long long)numColumns];
// Release the old object and retain the new one
if (dataStorage[rowIndex][columnIndex]) CFRelease(dataStorage[rowIndex][columnIndex]);
@@ -249,7 +249,7 @@ static inline void SPDataStorageEnsureCapacityForAdditionalRowCount(SPDataStorag
{
// Throw an exception if the index is out of bounds
- if (index >= numRows) [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", index, numRows];
+ if (index >= numRows) [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", (unsigned long long)index, (unsigned long long)numRows];
// Free the row
NSUInteger j = numColumns;
@@ -275,7 +275,7 @@ static inline void SPDataStorageEnsureCapacityForAdditionalRowCount(SPDataStorag
{
// Throw an exception if the range is out of bounds
- if (rangeToRemove.location + rangeToRemove.length > numRows) [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", (rangeToRemove.location + rangeToRemove.length), numRows];
+ if (rangeToRemove.location + rangeToRemove.length > numRows) [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", (unsigned long long)(rangeToRemove.location + rangeToRemove.length), (unsigned long long)numRows];
// Free rows in the range
NSUInteger i, j = numColumns;
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index ab321caa..10325374 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -45,6 +45,7 @@ enum {
#import "SPTablesList.h"
#import "SPTableStructure.h"
+#import "SPDatabaseStructure.h"
#ifndef SP_CODA /* headers */
#import "SPFileHandle.h"
#import "SPKeychain.h"
@@ -99,6 +100,7 @@ enum {
#endif
#import "SPThreadAdditions.h"
#import "RegexKitLite.h"
+#import "SPTextView.h"
#ifdef SP_CODA /* headers */
#import "SPAlertSheets.h"
@@ -4179,7 +4181,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase";
// Cancel autocompletion trigger
if([prefs boolForKey:SPCustomQueryAutoComplete])
#endif
- [NSObject cancelPreviousPerformRequestsWithTarget:[customQueryInstance valueForKeyPath:@"textView"]
+ [NSObject cancelPreviousPerformRequestsWithTarget:[customQueryInstance valueForKeyPath:@"textView"]
selector:@selector(doAutoCompletion)
object:nil];
#ifndef SP_CODA
@@ -5413,7 +5415,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase";
[fh writeData:[[[theResult fieldNames] componentsJoinedAsCSV] dataUsingEncoding:NSUTF8StringEncoding]];
else
[fh writeData:[[[theResult fieldNames] componentsJoinedByString:@"\t"] dataUsingEncoding:NSUTF8StringEncoding]];
- [fh writeData:[[NSString stringWithString:@"\n"] dataUsingEncoding:NSUTF8StringEncoding]];
+ [fh writeData:[@"\n" dataUsingEncoding:NSUTF8StringEncoding]];
NSArray *columnDefinition = [theResult fieldDefinitions];
diff --git a/Source/SPDotExporter.m b/Source/SPDotExporter.m
index 13bf13a5..5a655ca3 100644
--- a/Source/SPDotExporter.m
+++ b/Source/SPDotExporter.m
@@ -54,7 +54,7 @@
*
* @return The initialised instance
*/
-- (id)initWithDelegate:(NSObject *)exportDelegate
+- (id)initWithDelegate:(NSObject<SPDotExporterProtocol> *)exportDelegate
{
if ((self = [super init])) {
SPExportDelegateConformsToProtocol(exportDelegate, @protocol(SPDotExporterProtocol));
diff --git a/Source/SPExportFileUtilities.m b/Source/SPExportFileUtilities.m
index ea5bee2e..94b3e933 100644
--- a/Source/SPExportFileUtilities.m
+++ b/Source/SPExportFileUtilities.m
@@ -31,6 +31,7 @@
// More info at <http://code.google.com/p/sequel-pro/>
#import "SPExportFileUtilities.h"
+#import "SPExportInitializer.h"
#import "SPExporter.h"
#import "SPAlertSheets.h"
#import "SPExportFile.h"
@@ -50,6 +51,7 @@ SPExportErrorChoice;
@interface SPExportController (SPExportFileUtilitiesPrivateAPI)
- (void)_reopenExportSheet;
+- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;
@end
diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m
index ce9e6e7f..0e88d4e0 100644
--- a/Source/SPExtendedTableInfo.m
+++ b/Source/SPExtendedTableInfo.m
@@ -59,7 +59,6 @@ static NSString *SPMySQLDataFreeField = @"Data_free";
static NSString *SPMySQLAutoIncrementField = @"Auto_increment";
static NSString *SPMySQLCreateTimeField = @"Create_time";
static NSString *SPMySQLUpdateTimeField = @"Update_time";
-static NSString *SPMySQLCheckTimeField = @"Check_time";
static NSString *SPMySQLCollationField = @"Collation";
static NSString *SPMySQLCommentField = @"Comment";
diff --git a/Source/SPFavoriteTextFieldCell.m b/Source/SPFavoriteTextFieldCell.m
index 313fdc92..91ff1418 100644
--- a/Source/SPFavoriteTextFieldCell.m
+++ b/Source/SPFavoriteTextFieldCell.m
@@ -112,4 +112,4 @@
}
}
-@end \ No newline at end of file
+@end
diff --git a/Source/SPFavoritesController.m b/Source/SPFavoritesController.m
index 0985d680..e883d876 100644
--- a/Source/SPFavoritesController.m
+++ b/Source/SPFavoritesController.m
@@ -236,7 +236,7 @@ static SPFavoritesController *sharedFavoritesController = nil;
// If the favorites data file already exists use it, otherwise create an empty one
if ([fileManager fileExistsAtPath:favoritesFile]) {
- favoritesData = [[NSDictionary alloc] initWithContentsOfFile:favoritesFile];
+ favoritesData = [[NSMutableDictionary alloc] initWithContentsOfFile:favoritesFile];
}
else {
NSMutableDictionary *newFavorites = [NSMutableDictionary dictionaryWithObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Favorites", @"favorites label"), SPFavoritesGroupNameKey, [NSArray array], SPFavoriteChildrenKey, nil] forKey:SPFavoritesRootKey];
@@ -346,7 +346,7 @@ static SPFavoritesController *sharedFavoritesController = nil;
}
}
else {
- node = [[SPFavoriteNode alloc] initWithDictionary:nodeData];
+ node = [[SPFavoriteNode alloc] initWithDictionary:[NSMutableDictionary dictionaryWithDictionary:nodeData]];
treeNode = [[SPTreeNode alloc] initWithRepresentedObject:node];
diff --git a/Source/SPFieldEditorController.h b/Source/SPFieldEditorController.h
index a1cf0cee..4e6aac77 100644
--- a/Source/SPFieldEditorController.h
+++ b/Source/SPFieldEditorController.h
@@ -187,7 +187,6 @@
- (IBAction)dropImage:(id)sender;
- (IBAction)segmentControllerChanged:(id)sender;
- (IBAction)quickLookFormatButton:(id)sender;
-- (IBAction)dropImage:(id)sender;
- (IBAction)bitSheetSelectBit0:(id)sender;
- (IBAction)bitSheetBitButtonWasClicked:(id)sender;
diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m
index 87d2025b..386cdd0a 100644
--- a/Source/SPFieldEditorController.m
+++ b/Source/SPFieldEditorController.m
@@ -222,7 +222,7 @@
if([fieldType length])
[label appendString:fieldType];
if(maxTextLength > 0)
- [label appendFormat:@"(%ld) ", maxTextLength];
+ [label appendFormat:@"(%lld) ", maxTextLength];
if(!_allowNULL)
[label appendString:@"NOT NULL "];
if([fieldEncoding length])
@@ -293,7 +293,7 @@
[hexTextView setFont:[NSFont fontWithName:SPDefaultMonospacedFontName size:[NSFont smallSystemFontSize]]];
- [editSheetFieldName setStringValue:[NSString stringWithFormat:@"%@: %@%", NSLocalizedString(@"Field", @"Field"), label]];
+ [editSheetFieldName setStringValue:[NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"Field", @"Field"), label]];
// hide all views in editSheet
[hexTextView setHidden:YES];
@@ -809,7 +809,7 @@
// since QuickLook only works on files.
// Alternate the file name to suppress caching by using counter%2.
if (tmpFileName) [tmpFileName release];
- tmpFileName = [[NSString alloc] initWithFormat:@"%@SequelProQuickLook%d.%@", tmpDirPath, counter%2, type];
+ tmpFileName = [[NSString alloc] initWithFormat:@"%@SequelProQuickLook%ld.%@", tmpDirPath, counter%2, type];
// if data are binary
if ( [sheetEditData isKindOfClass:[NSData class]] && !isText) {
@@ -1153,7 +1153,7 @@
bitValue <<= 1;
}
[bitSheetIntegerTextField setStringValue:[[NSNumber numberWithUnsignedLongLong:intValue] stringValue]];
- [bitSheetHexTextField setStringValue:[NSString stringWithFormat:@"%qX", intValue]];
+ [bitSheetHexTextField setStringValue:[NSString stringWithFormat:@"%lX", (unsigned long)intValue]];
[bitSheetOctalTextField setStringValue:[NSString stringWithFormat:@"%jO", intValue]];
// free old data
if ( sheetEditData != nil ) {
@@ -1283,7 +1283,7 @@
for(i=0; i<maxBit; i++)
[[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] setState:NSOffState];
- [bitSheetHexTextField setStringValue:[NSString stringWithFormat:@"%qX", intValue]];
+ [bitSheetHexTextField setStringValue:[NSString stringWithFormat:@"%lX", (unsigned long)intValue]];
[bitSheetOctalTextField setStringValue:[NSString stringWithFormat:@"%jO", intValue]];
i = 0;
@@ -1308,7 +1308,7 @@
[[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] setState:NSOffState];
[bitSheetHexTextField setStringValue:[NSString stringWithFormat:@"%qX", intValue]];
- [bitSheetOctalTextField setStringValue:[NSString stringWithFormat:@"%jO", intValue]];
+ [bitSheetOctalTextField setStringValue:[NSString stringWithFormat:@"%llO", intValue]];
i = 0;
while( intValue && i < maxBit )
diff --git a/Source/SPFieldMapperController.h b/Source/SPFieldMapperController.h
index df4e00d2..cdfe77c8 100644
--- a/Source/SPFieldMapperController.h
+++ b/Source/SPFieldMapperController.h
@@ -195,7 +195,6 @@
- (IBAction)closeInfoSheet:(id)sender;
- (IBAction)addNewColumn:(id)sender;
- (IBAction)removeNewColumn:(id)sender;
-// - (IBAction)editColumn:(id)sender;
- (IBAction)setAllTypesTo:(id)sender;
// Others
diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m
index b31928d5..2e517852 100644
--- a/Source/SPFieldMapperController.m
+++ b/Source/SPFieldMapperController.m
@@ -1002,13 +1002,6 @@ static NSString *SPTableViewSqlColumnID = @"sql";
}
-// - (IBAction)editColumn:(id)sender
-// {
-// toBeEditedRowIndexes = [fieldMapperTableView selectedRow];
-// [fieldMapperTableView reloadData];
-// [fieldMapperTableView editColumn:3 row:[fieldMapperTableView selectedRow] withEvent:nil select:YES];
-// }
-
/*
* Set all table target field types to that one of the current selected type
*/
@@ -1124,14 +1117,14 @@ static NSString *SPTableViewSqlColumnID = @"sql";
for(id item in [fieldMappingImportArray objectAtIndex:0]) {
i++;
if ([item isNSNull]) {
- [insertPullDownButton addItemWithTitle:[NSString stringWithFormat:@"%i. <%@>", i, [prefs objectForKey:SPNullValue]]];
+ [insertPullDownButton addItemWithTitle:[NSString stringWithFormat:@"%li. <%@>", (long)i, [prefs objectForKey:SPNullValue]]];
} else if ([item isSPNotLoaded]) {
- [insertPullDownButton addItemWithTitle:[NSString stringWithFormat:@"%i. <%@>", i, @"DEFAULT"]];
+ [insertPullDownButton addItemWithTitle:[NSString stringWithFormat:@"%li. <%@>", (long)i, @"DEFAULT"]];
} else {
if([(NSString*)item length] > 20)
- [insertPullDownButton addItemWithTitle:[NSString stringWithFormat:@"%i. %@…", i, [item substringToIndex:20]]];
+ [insertPullDownButton addItemWithTitle:[NSString stringWithFormat:@"%li. %@…", (long)i, [item substringToIndex:20]]];
else
- [insertPullDownButton addItemWithTitle:[NSString stringWithFormat:@"%i. %@", i, item]];
+ [insertPullDownButton addItemWithTitle:[NSString stringWithFormat:@"%li. %@", (long)i, item]];
}
}
}
@@ -1520,20 +1513,20 @@ static NSString *SPTableViewSqlColumnID = @"sql";
[fieldMappingButtonOptions setArray:[fieldMappingImportArray objectAtIndex:fieldMappingCurrentRow]];
for (i = 0; i < [fieldMappingButtonOptions count]; i++) {
if ([[fieldMappingButtonOptions objectAtIndex:i] isNSNull])
- [fieldMappingButtonOptions replaceObjectAtIndex:i withObject:[NSString stringWithFormat:@"%i. <%@>", i+1, [prefs objectForKey:SPNullValue]]];
+ [fieldMappingButtonOptions replaceObjectAtIndex:i withObject:[NSString stringWithFormat:@"%li. <%@>", i+1, [prefs objectForKey:SPNullValue]]];
else if ([[fieldMappingButtonOptions objectAtIndex:i] isSPNotLoaded])
- [fieldMappingButtonOptions replaceObjectAtIndex:i withObject:[NSString stringWithFormat:@"%i. <%@>", i+1, @"DEFAULT"]];
+ [fieldMappingButtonOptions replaceObjectAtIndex:i withObject:[NSString stringWithFormat:@"%li. <%@>", i+1, @"DEFAULT"]];
else
- [fieldMappingButtonOptions replaceObjectAtIndex:i withObject:[NSString stringWithFormat:@"%i. %@", i+1, NSArrayObjectAtIndex(fieldMappingButtonOptions, i)]];
+ [fieldMappingButtonOptions replaceObjectAtIndex:i withObject:[NSString stringWithFormat:@"%li. %@", i+1, NSArrayObjectAtIndex(fieldMappingButtonOptions, i)]];
}
// Add global values if any
if((NSInteger)[fieldMappingGlobalValues count]>numberOfImportColumns)
for( ; i < [fieldMappingGlobalValues count]; i++) {
if ([NSArrayObjectAtIndex(fieldMappingGlobalValues, i) isNSNull])
- [fieldMappingButtonOptions addObject:[NSString stringWithFormat:@"%i. <%@>", i+1, [prefs objectForKey:SPNullValue]]];
+ [fieldMappingButtonOptions addObject:[NSString stringWithFormat:@"%li. <%@>", i+1, [prefs objectForKey:SPNullValue]]];
else
- [fieldMappingButtonOptions addObject:[NSString stringWithFormat:@"%i. %@", i+1, NSArrayObjectAtIndex(fieldMappingGlobalValues, i)]];
+ [fieldMappingButtonOptions addObject:[NSString stringWithFormat:@"%li. %@", i+1, NSArrayObjectAtIndex(fieldMappingGlobalValues, i)]];
}
[fieldMapperTableView reloadData];
@@ -1635,10 +1628,6 @@ static NSString *SPTableViewSqlColumnID = @"sql";
else if (!newTableMode && [menuItem action] == @selector(insertNULLValue:)) {
return ([[globalValuesTableView selectedRowIndexes] count] == 1) ? YES : NO;
}
- else if (!newTableMode && [menuItem action] == @selector(editColumn:)) {
- NSString *orgTitle = [[menuItem title] substringToIndex:[[menuItem title] rangeOfString:@":"].location];
- [menuItem setTitle:[NSString stringWithFormat:@"%@: %@", orgTitle, [fieldMappingTableColumnNames objectAtIndex:row]]];
- }
else if (!newTableMode && [menuItem action] == @selector(removeNewColumn:)) {
if([toBeEditedRowIndexes containsIndex:row]) {
NSString *orgTitle = [[menuItem title] substringToIndex:[[menuItem title] rangeOfString:@":"].location];
diff --git a/Source/SPHTMLExporter.m b/Source/SPHTMLExporter.m
index db7dc6de..63414644 100644
--- a/Source/SPHTMLExporter.m
+++ b/Source/SPHTMLExporter.m
@@ -44,7 +44,7 @@
*
* @return The initialised instance
*/
-- (id)initWithDelegate:(NSObject *)exportDelegate
+- (id)initWithDelegate:(NSObject<SPHTMLExporterProtocol> *)exportDelegate
{
if ((self = [super init])) {
SPExportDelegateConformsToProtocol(exportDelegate, @protocol(SPHTMLExporterProtocol));
diff --git a/Source/SPIndexesController.m b/Source/SPIndexesController.m
index 1ee45d52..08c1cdef 100644
--- a/Source/SPIndexesController.m
+++ b/Source/SPIndexesController.m
@@ -894,7 +894,7 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize";
// If supplied specify the index's key block size
if (indexKeyBlockSize) {
- [query appendFormat:@" KEY_BLOCK_SIZE = %d", [indexKeyBlockSize integerValue]];
+ [query appendFormat:@" KEY_BLOCK_SIZE = %ld", (long)[indexKeyBlockSize integerValue]];
}
// Execute the query
diff --git a/Source/SPPDFExporter.m b/Source/SPPDFExporter.m
index 61cdc6bd..cb54babb 100644
--- a/Source/SPPDFExporter.m
+++ b/Source/SPPDFExporter.m
@@ -44,7 +44,7 @@
*
* @return The initialised instance
*/
-- (id)initWithDelegate:(NSObject *)exportDelegate
+- (id)initWithDelegate:(NSObject<SPPDFExporterProtocol> *)exportDelegate
{
if ((self = [super init])) {
SPExportDelegateConformsToProtocol(exportDelegate, @protocol(SPPDFExporterProtocol));
diff --git a/Source/SPQueryDocumentsController.m b/Source/SPQueryDocumentsController.m
index 3557c75f..5bda1771 100644
--- a/Source/SPQueryDocumentsController.m
+++ b/Source/SPQueryDocumentsController.m
@@ -31,6 +31,7 @@
// More info at <http://code.google.com/p/sequel-pro/>
#import "SPQueryDocumentsController.h"
+#import "SPCustomQuery.h"
@implementation SPQueryController (SPQueryDocumentsController)
diff --git a/Source/SPSQLExporter.m b/Source/SPSQLExporter.m
index fa1df5d0..e578ebdf 100644
--- a/Source/SPSQLExporter.m
+++ b/Source/SPSQLExporter.m
@@ -70,7 +70,7 @@
*
* @return The initialised instance
*/
-- (id)initWithDelegate:(NSObject *)exportDelegate
+- (id)initWithDelegate:(NSObject<SPSQLExporterProtocol> *)exportDelegate
{
if ((self = [super init])) {
SPExportDelegateConformsToProtocol(exportDelegate, @protocol(SPSQLExporterProtocol));
diff --git a/Source/SPServerSupport.m b/Source/SPServerSupport.m
index 95120494..1446b978 100644
--- a/Source/SPServerSupport.m
+++ b/Source/SPServerSupport.m
@@ -229,7 +229,7 @@
- (NSString *)description
{
unsigned int i;
- NSMutableString *description = [NSMutableString stringWithFormat:@"<%@: Server is MySQL version %d.%d.%d. Supports:\n", [self className], serverMajorVersion, serverMinorVersion, serverReleaseVersion];
+ NSMutableString *description = [NSMutableString stringWithFormat:@"<%@: Server is MySQL version %ld.%ld.%ld. Supports:\n", [self className], (long)serverMajorVersion, (long)serverMinorVersion, (long)serverReleaseVersion];
Ivar *vars = class_copyIvarList([self class], &i);
diff --git a/Source/SPSingleton.m b/Source/SPSingleton.m
index 4db5d49b..265ad62e 100644
--- a/Source/SPSingleton.m
+++ b/Source/SPSingleton.m
@@ -58,6 +58,6 @@
return self;
}
-- (void)release { }
+- (oneway void)release { }
@end
diff --git a/Source/SPSplitView.m b/Source/SPSplitView.m
index 4930e171..f89e0dc9 100644
--- a/Source/SPSplitView.m
+++ b/Source/SPSplitView.m
@@ -1090,10 +1090,10 @@
}
// Check for a first responder to restore, using the "true" first responder for field editors
- NSResponder<NSTextDelegate> *firstResponderToRestore = [[self window] firstResponder];
+ NSResponder *firstResponderToRestore = [[self window] firstResponder];
if ([firstResponderToRestore respondsToSelector:@selector(isFieldEditor)] && [(NSText *)firstResponderToRestore isFieldEditor]) {
- firstResponderToRestore = [(NSText *)firstResponderToRestore delegate];
+ firstResponderToRestore = (NSResponder *)[(NSText *)firstResponderToRestore delegate];
}
if (![firstResponderToRestore isKindOfClass:[NSView class]] || ![(NSView *)firstResponderToRestore isDescendantOf:wrappedView]) {
firstResponderToRestore = nil;
diff --git a/Source/SPStringAdditions.m b/Source/SPStringAdditions.m
index 029330d0..dfc71fb3 100644
--- a/Source/SPStringAdditions.m
+++ b/Source/SPStringAdditions.m
@@ -186,7 +186,7 @@
theChar += 13;
}
- [holder appendFormat:@"%C", (char)theChar];
+ [holder appendFormat:@"%C", theChar];
}
else if (theChar <= 90 && theChar >= 65) {
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m
index 7f9c172e..f093f875 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -531,11 +531,10 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper
NSString *nullValue = [prefs objectForKey:SPNullValue];
#ifndef SP_CODA /* get font from prefs */
NSFont *tableFont = [NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPGlobalResultTableFont]];
- [tableContentView setRowHeight:2.0f+NSSizeToCGSize([[NSString stringWithString:@"{ǞṶḹÜ∑zgyf"] sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height];
#else
NSFont *tableFont = [NSFont systemFontOfSize:[NSFont smallSystemFontSize]];
- [tableContentView setRowHeight:2.0f+NSSizeToCGSize([@"{ǞṶḹÜ∑zgyf" sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height];
#endif
+ [tableContentView setRowHeight:2.0f+NSSizeToCGSize([@"{ǞṶḹÜ∑zgyf" sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height];
// Add the new columns to the table and filterTable
for ( i = 0 ; i < (NSInteger)[dataColumns count] ; i++ ) {
@@ -4213,7 +4212,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper
// Table font preference changed
else if ([keyPath isEqualToString:SPGlobalResultTableFont]) {
NSFont *tableFont = [NSUnarchiver unarchiveObjectWithData:[change objectForKey:NSKeyValueChangeNewKey]];
- [tableContentView setRowHeight:2.0f+NSSizeToCGSize([[NSString stringWithString:@"{ǞṶḹÜ∑zgyf"] sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height];
+ [tableContentView setRowHeight:2.0f+NSSizeToCGSize([@"{ǞṶḹÜ∑zgyf" sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height];
[tableContentView setFont:tableFont];
[tableContentView reloadData];
}
diff --git a/Source/SPTableContentDelegate.m b/Source/SPTableContentDelegate.m
index 018932cb..d2e7f2d5 100644
--- a/Source/SPTableContentDelegate.m
+++ b/Source/SPTableContentDelegate.m
@@ -758,12 +758,8 @@
*/
- (BOOL)control:(NSControl<NSControlTextEditingDelegate> *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command
{
-#ifndef SP_CODA
// Check firstly if SPCopyTable can handle command
- if ([control control:control textView:textView doCommandBySelector:(SEL)command])
-#else
if ([control control:control textView:textView doCommandBySelector:command])
-#endif
return YES;
// Trap the escape key
diff --git a/Source/SPTableContentFilter.m b/Source/SPTableContentFilter.m
index b8e1d72e..6d8c212a 100644
--- a/Source/SPTableContentFilter.m
+++ b/Source/SPTableContentFilter.m
@@ -87,8 +87,8 @@
for (NSInteger anIndex = 0; anIndex < numberOfCols; anIndex++)
{
- NSString *filterCell;
- NSDictionary *filterCellData = [NSDictionary dictionaryWithDictionary:[filterTableData objectForKey:[NSString stringWithFormat:@"%d", anIndex]]];
+ NSString *filterCell = nil;
+ NSDictionary *filterCellData = [NSDictionary dictionaryWithDictionary:[filterTableData objectForKey:[NSString stringWithFormat:@"%ld", (long)anIndex]]];
// Take filterTableData
if (!currentValue) {
diff --git a/Source/SPTableData.m b/Source/SPTableData.m
index 594d1df4..03ce039e 100644
--- a/Source/SPTableData.m
+++ b/Source/SPTableData.m
@@ -1127,7 +1127,7 @@
SPRowCountQueryUsageLevels rowCountLevel = SPRowCountFetchAlways;
NSInteger rowCountCheapBoundary = 5242880;
#ifndef SP_CODA
- rowCountLevel = [[[NSUserDefaults standardUserDefaults] objectForKey:SPTableRowCountQueryLevel] integerValue];
+ rowCountLevel = (SPRowCountQueryUsageLevels)[[[NSUserDefaults standardUserDefaults] objectForKey:SPTableRowCountQueryLevel] integerValue];
rowCountCheapBoundary = [[[NSUserDefaults standardUserDefaults] objectForKey:SPTableRowCountCheapSizeBoundary] integerValue];
#endif
@@ -1429,4 +1429,4 @@
#endif
-@end \ No newline at end of file
+@end
diff --git a/Source/SPTableFieldValidation.m b/Source/SPTableFieldValidation.m
index 3a465338..b18fba19 100644
--- a/Source/SPTableFieldValidation.m
+++ b/Source/SPTableFieldValidation.m
@@ -102,7 +102,7 @@
if (![fieldTypes containsObject:type]) return YES;
- return ((([fieldTypes indexOfObject:type] > 17) && ([fieldTypes indexOfObject:type] < 24) || (([fieldTypes indexOfObject:type] > 29) && ([fieldTypes indexOfObject:type] < 32))));
+ return (((([fieldTypes indexOfObject:type] > 17) && ([fieldTypes indexOfObject:type] < 24)) || (([fieldTypes indexOfObject:type] > 29) && ([fieldTypes indexOfObject:type] < 32))));
}
/**
diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m
index e79152bd..9d6b1fec 100644
--- a/Source/SPTableStructure.m
+++ b/Source/SPTableStructure.m
@@ -32,6 +32,7 @@
// More info at <http://code.google.com/p/sequel-pro/>
#import "SPTableStructure.h"
+#import "SPDatabaseStructure.h"
#import "SPDatabaseDocument.h"
#import "SPDatabaseViewController.h"
#import "SPTableInfo.h"
diff --git a/Source/SPTableStructureDelegate.m b/Source/SPTableStructureDelegate.m
index ec6e984f..c8d03aff 100644
--- a/Source/SPTableStructureDelegate.m
+++ b/Source/SPTableStructureDelegate.m
@@ -42,6 +42,12 @@
#import <SPMySQL/SPMySQL.h>
+@interface SPTableStructure (PrivateAPI)
+
+- (void)sheetDidEnd:(id)sheet returnCode:(NSInteger)returnCode contextInfo:(NSString *)contextInfo;
+
+@end
+
@implementation SPTableStructure (SPTableStructureDelegate)
#pragma mark -
diff --git a/Source/SPTableStructureLoading.m b/Source/SPTableStructureLoading.m
index 720f2692..bc90bc43 100644
--- a/Source/SPTableStructureLoading.m
+++ b/Source/SPTableStructureLoading.m
@@ -32,6 +32,7 @@
#import "SPTableData.h"
#import "SPAlertSheets.h"
#import "SPDatabaseData.h"
+#import "SPDatabaseStructure.h"
#import "SPTableFieldValidation.h"
#import "SPDatabaseViewController.h"
#import "SPIndexesController.h"
@@ -376,4 +377,4 @@
[tableSourceView reloadData];
}
-@end \ No newline at end of file
+@end
diff --git a/Source/SPTableTriggers.m b/Source/SPTableTriggers.m
index 22374e23..6a4b1b79 100644
--- a/Source/SPTableTriggers.m
+++ b/Source/SPTableTriggers.m
@@ -579,7 +579,7 @@ static const NSString *SPTriggerSQLMode = @"TriggerSQLMode";
}
NSArray *triggers = ([[tableDocumentInstance serverSupport] supportsTriggers]) ? [tableDataInstance triggers] : nil;
- NSCharacterSet *nulSet = [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat:@"%C", '\0']];
+ NSCharacterSet *nulSet = [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat:@"%C", (unsigned short)'\0']];
for (NSDictionary *trigger in triggers)
{
diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m
index ed228248..db3890ff 100644
--- a/Source/SPTablesList.m
+++ b/Source/SPTablesList.m
@@ -34,6 +34,7 @@
#import "SPTablesList.h"
#import "SPDatabaseDocument.h"
#import "SPTableStructure.h"
+#import "SPDatabaseStructure.h"
#import "SPDatabaseViewController.h"
#ifndef SP_CODA /* headers */
diff --git a/Source/SPTextView.m b/Source/SPTextView.m
index fe013503..3a6b2204 100644
--- a/Source/SPTextView.m
+++ b/Source/SPTextView.m
@@ -320,11 +320,8 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS
{
NSMutableArray *possibleCompletions = [[NSMutableArray alloc] initWithCapacity:32];
-#ifndef SP_CODA
- if(currentWord == nil) currentWord = [NSString stringWithString:@""];
-#else
if(currentWord == nil) currentWord = @"";
-#endif
+
// If caret is not inside backticks add keywords and all words coming from the view.
if(!dbBrowseMode)
{
@@ -2918,11 +2915,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS
#endif
if(tabStopWidth < 1) tabStopWidth = 1;
-#ifndef SP_CODA
- float tabWidth = NSSizeToCGSize([[NSString stringWithString:@" "] sizeWithAttributes:[NSDictionary dictionaryWithObject:tvFont forKey:NSFontAttributeName]]).width;
-#else
float tabWidth = NSSizeToCGSize([@" " sizeWithAttributes:[NSDictionary dictionaryWithObject:tvFont forKey:NSFontAttributeName]]).width;
-#endif
tabWidth = (float)tabStopWidth * tabWidth;
NSInteger numberOfTabs = 256/tabStopWidth;
diff --git a/Source/SPWindowController.m b/Source/SPWindowController.m
index bef7cbc1..aa208286 100644
--- a/Source/SPWindowController.m
+++ b/Source/SPWindowController.m
@@ -31,6 +31,7 @@
// More info at <http://code.google.com/p/sequel-pro/>
#import "SPWindowController.h"
+#import "SPWindowControllerDelegate.h"
#import "SPDatabaseDocument.h"
#import "SPDatabaseViewController.h"
#import "SPAppController.h"
diff --git a/Source/SPWindowControllerDelegate.h b/Source/SPWindowControllerDelegate.h
index 09b4a7bf..29029db2 100644
--- a/Source/SPWindowControllerDelegate.h
+++ b/Source/SPWindowControllerDelegate.h
@@ -34,4 +34,8 @@
@interface SPWindowController (SPWindowControllerDelegate)
+- (void)tabDragStarted:(id)sender;
+- (void)tabDragStopped:(id)sender;
+
+
@end
diff --git a/Source/SPXMLExporter.m b/Source/SPXMLExporter.m
index 7f976449..f159f129 100644
--- a/Source/SPXMLExporter.m
+++ b/Source/SPXMLExporter.m
@@ -54,7 +54,7 @@
*
* @return The initialised instance
*/
-- (id)initWithDelegate:(NSObject *)exportDelegate
+- (id)initWithDelegate:(NSObject<SPXMLExporterProtocol> *)exportDelegate
{
if ((self = [super init])) {
SPExportDelegateConformsToProtocol(exportDelegate, @protocol(SPXMLExporterProtocol));