diff options
-rw-r--r-- | Source/SPConstants.h | 7 | ||||
-rw-r--r-- | Source/SPIndexesController.h | 7 | ||||
-rw-r--r-- | Source/SPIndexesController.m | 10 |
3 files changed, 12 insertions, 12 deletions
diff --git a/Source/SPConstants.h b/Source/SPConstants.h index 5cbfa463..0992cc1b 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -23,6 +23,13 @@ // // More info at <http://code.google.com/p/sequel-pro/> +/** + * This header should be used to define constants that are used globally (i.e. among multiple classes/files). + * Constants that need only be defined for a particular class should be done within the implementation file + * of said class. Try to avoid the use of macros to define constants as much as possible as they do not incur + * type checking when used and cannot be tested for equality. + */ + // View modes typedef enum { SPStructureViewMode = 1, diff --git a/Source/SPIndexesController.h b/Source/SPIndexesController.h index 4d23aa3d..02dade6c 100644 --- a/Source/SPIndexesController.h +++ b/Source/SPIndexesController.h @@ -25,13 +25,6 @@ @class SPDatabaseDocument, SPTablesList, SPTableData, SPTableStructure, MCPConnection, BWAnchoredButtonBar; -// Constants -extern NSString *SPNewIndexIndexName; -extern NSString *SPNewIndexIndexType; -extern NSString *SPNewIndexIndexedColumns; -extern NSString *SPNewIndexStorageType; -extern NSString *SPNewIndexKeyBlockSize; - @interface SPIndexesController : NSWindowController { // Controllers diff --git a/Source/SPIndexesController.m b/Source/SPIndexesController.m index 70796575..09f1a3d8 100644 --- a/Source/SPIndexesController.m +++ b/Source/SPIndexesController.m @@ -28,11 +28,11 @@ #import "SPServerSupport.h" // Constants -NSString *SPNewIndexIndexName = @"IndexName"; -NSString *SPNewIndexIndexType = @"IndexType"; -NSString *SPNewIndexIndexedColumns = @"IndexedColumns"; -NSString *SPNewIndexStorageType = @"IndexStorageType"; -NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; +static const NSString *SPNewIndexIndexName = @"IndexName"; +static const NSString *SPNewIndexIndexType = @"IndexType"; +static const NSString *SPNewIndexIndexedColumns = @"IndexedColumns"; +static const NSString *SPNewIndexStorageType = @"IndexStorageType"; +static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; @interface SPIndexesController (PrivateAPI) |