From 10990abb16783d89e5314549883fc1e5acc2e407 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Tue, 19 Oct 2010 21:43:02 +0000 Subject: Update indexes controller constants. --- Source/SPConstants.h | 7 +++++++ Source/SPIndexesController.h | 7 ------- Source/SPIndexesController.m | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'Source') 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 +/** + * 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) -- cgit v1.2.3