diff --git a/Circle.xcodeproj/project.pbxproj b/Circle.xcodeproj/project.pbxproj index 370ef9e..b70e8a9 100644 --- a/Circle.xcodeproj/project.pbxproj +++ b/Circle.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 1F8FDCC0211CDDD500A76988 /* CircleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C2A7A1D3154F50D300940C81 /* CircleTests.m */; }; C20335DE157BDEC9003A6733 /* CircleSimpleCycleFinder.m in Sources */ = {isa = PBXBuildFile; fileRef = C20335DD157BDEC9003A6733 /* CircleSimpleCycleFinder.m */; }; C23AF6EE1579162000D2DF2E /* CircleIVarLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = C23AF6ED1579162000D2DF2E /* CircleIVarLayout.m */; }; C2A7A1AA154F50D200940C81 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2A7A1A9154F50D200940C81 /* Cocoa.framework */; }; @@ -15,14 +16,10 @@ C2A7A1BA154F50D200940C81 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = C2A7A1B8154F50D200940C81 /* Credits.rtf */; }; C2A7A1BD154F50D200940C81 /* MAAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C2A7A1BC154F50D200940C81 /* MAAppDelegate.m */; }; C2A7A1C0154F50D300940C81 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = C2A7A1BE154F50D300940C81 /* MainMenu.xib */; }; - C2A7A1C8154F50D300940C81 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2A7A1C7154F50D300940C81 /* SenTestingKit.framework */; }; - C2A7A1C9154F50D300940C81 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2A7A1A9154F50D200940C81 /* Cocoa.framework */; }; - C2A7A1D1154F50D300940C81 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C2A7A1CF154F50D300940C81 /* InfoPlist.strings */; }; - C2A7A1D4154F50D300940C81 /* CircleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C2A7A1D3154F50D300940C81 /* CircleTests.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - C2A7A1CA154F50D300940C81 /* PBXContainerItemProxy */ = { + 1F8FDCBB211CDD7400A76988 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = C2A7A19C154F50D200940C81 /* Project object */; proxyType = 1; @@ -32,6 +29,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 1F8FDCB6211CDD7400A76988 /* CircleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CircleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 1F8FDCBA211CDD7400A76988 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; C20335DC157BDEC9003A6733 /* CircleSimpleCycleFinder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CircleSimpleCycleFinder.h; sourceTree = ""; }; C20335DD157BDEC9003A6733 /* CircleSimpleCycleFinder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CircleSimpleCycleFinder.m; sourceTree = ""; }; C23AF6EC1579162000D2DF2E /* CircleIVarLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CircleIVarLayout.h; sourceTree = ""; }; @@ -49,40 +48,45 @@ C2A7A1BB154F50D200940C81 /* MAAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MAAppDelegate.h; sourceTree = ""; }; C2A7A1BC154F50D200940C81 /* MAAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MAAppDelegate.m; sourceTree = ""; }; C2A7A1BF154F50D300940C81 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; - C2A7A1C6154F50D300940C81 /* CircleTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CircleTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; C2A7A1C7154F50D300940C81 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; - C2A7A1CE154F50D300940C81 /* CircleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CircleTests-Info.plist"; sourceTree = ""; }; - C2A7A1D0154F50D300940C81 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; C2A7A1D2154F50D300940C81 /* CircleTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CircleTests.h; sourceTree = ""; }; C2A7A1D3154F50D300940C81 /* CircleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CircleTests.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - C2A7A1A2154F50D200940C81 /* Frameworks */ = { + 1F8FDCB3211CDD7400A76988 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C2A7A1AA154F50D200940C81 /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - C2A7A1C2154F50D300940C81 /* Frameworks */ = { + C2A7A1A2154F50D200940C81 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C2A7A1C8154F50D300940C81 /* SenTestingKit.framework in Frameworks */, - C2A7A1C9154F50D300940C81 /* Cocoa.framework in Frameworks */, + C2A7A1AA154F50D200940C81 /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 1F8FDCB7211CDD7400A76988 /* CircleTests */ = { + isa = PBXGroup; + children = ( + C2A7A1D2154F50D300940C81 /* CircleTests.h */, + C2A7A1D3154F50D300940C81 /* CircleTests.m */, + 1F8FDCBA211CDD7400A76988 /* Info.plist */, + ); + path = CircleTests; + sourceTree = ""; + }; C2A7A19A154F50D200940C81 = { isa = PBXGroup; children = ( C2A7A1AF154F50D200940C81 /* Circle */, - C2A7A1CC154F50D300940C81 /* CircleTests */, + 1F8FDCB7211CDD7400A76988 /* CircleTests */, C2A7A1A8154F50D200940C81 /* Frameworks */, C2A7A1A6154F50D200940C81 /* Products */, ); @@ -92,7 +96,7 @@ isa = PBXGroup; children = ( C2A7A1A5154F50D200940C81 /* Circle.app */, - C2A7A1C6154F50D300940C81 /* CircleTests.octest */, + 1F8FDCB6211CDD7400A76988 /* CircleTests.xctest */, ); name = Products; sourceTree = ""; @@ -144,28 +148,27 @@ name = "Supporting Files"; sourceTree = ""; }; - C2A7A1CC154F50D300940C81 /* CircleTests */ = { - isa = PBXGroup; - children = ( - C2A7A1D2154F50D300940C81 /* CircleTests.h */, - C2A7A1D3154F50D300940C81 /* CircleTests.m */, - C2A7A1CD154F50D300940C81 /* Supporting Files */, - ); - path = CircleTests; - sourceTree = ""; - }; - C2A7A1CD154F50D300940C81 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - C2A7A1CE154F50D300940C81 /* CircleTests-Info.plist */, - C2A7A1CF154F50D300940C81 /* InfoPlist.strings */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 1F8FDCB5211CDD7400A76988 /* CircleTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1F8FDCBD211CDD7400A76988 /* Build configuration list for PBXNativeTarget "CircleTests" */; + buildPhases = ( + 1F8FDCB2211CDD7400A76988 /* Sources */, + 1F8FDCB3211CDD7400A76988 /* Frameworks */, + 1F8FDCB4211CDD7400A76988 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 1F8FDCBC211CDD7400A76988 /* PBXTargetDependency */, + ); + name = CircleTests; + productName = CircleTests; + productReference = 1F8FDCB6211CDD7400A76988 /* CircleTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; C2A7A1A4154F50D200940C81 /* Circle */ = { isa = PBXNativeTarget; buildConfigurationList = C2A7A1D7154F50D300940C81 /* Build configuration list for PBXNativeTarget "Circle" */; @@ -183,25 +186,6 @@ productReference = C2A7A1A5154F50D200940C81 /* Circle.app */; productType = "com.apple.product-type.application"; }; - C2A7A1C5154F50D300940C81 /* CircleTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = C2A7A1DA154F50D300940C81 /* Build configuration list for PBXNativeTarget "CircleTests" */; - buildPhases = ( - C2A7A1C1154F50D300940C81 /* Sources */, - C2A7A1C2154F50D300940C81 /* Frameworks */, - C2A7A1C3154F50D300940C81 /* Resources */, - C2A7A1C4154F50D300940C81 /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - C2A7A1CB154F50D300940C81 /* PBXTargetDependency */, - ); - name = CircleTests; - productName = CircleTests; - productReference = C2A7A1C6154F50D300940C81 /* CircleTests.octest */; - productType = "com.apple.product-type.bundle"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -209,8 +193,15 @@ isa = PBXProject; attributes = { CLASSPREFIX = MA; - LastUpgradeCheck = 0440; + LastUpgradeCheck = 0940; ORGANIZATIONNAME = "Michael Ash"; + TargetAttributes = { + 1F8FDCB5211CDD7400A76988 = { + CreatedOnToolsVersion = 9.4.1; + ProvisioningStyle = Manual; + TestTargetID = C2A7A1A4154F50D200940C81; + }; + }; }; buildConfigurationList = C2A7A19F154F50D200940C81 /* Build configuration list for PBXProject "Circle" */; compatibilityVersion = "Xcode 3.2"; @@ -225,49 +216,40 @@ projectRoot = ""; targets = ( C2A7A1A4154F50D200940C81 /* Circle */, - C2A7A1C5154F50D300940C81 /* CircleTests */, + 1F8FDCB5211CDD7400A76988 /* CircleTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - C2A7A1A3154F50D200940C81 /* Resources */ = { + 1F8FDCB4211CDD7400A76988 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C2A7A1B4154F50D200940C81 /* InfoPlist.strings in Resources */, - C2A7A1BA154F50D200940C81 /* Credits.rtf in Resources */, - C2A7A1C0154F50D300940C81 /* MainMenu.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; - C2A7A1C3154F50D300940C81 /* Resources */ = { + C2A7A1A3154F50D200940C81 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C2A7A1D1154F50D300940C81 /* InfoPlist.strings in Resources */, + C2A7A1B4154F50D200940C81 /* InfoPlist.strings in Resources */, + C2A7A1BA154F50D200940C81 /* Credits.rtf in Resources */, + C2A7A1C0154F50D300940C81 /* MainMenu.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - C2A7A1C4154F50D300940C81 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; +/* Begin PBXSourcesBuildPhase section */ + 1F8FDCB2211CDD7400A76988 /* Sources */ = { + isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - ); - inputPaths = ( - ); - outputPaths = ( + 1F8FDCC0211CDDD500A76988 /* CircleTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ C2A7A1A1154F50D200940C81 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -279,21 +261,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - C2A7A1C1154F50D300940C81 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - C2A7A1D4154F50D300940C81 /* CircleTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - C2A7A1CB154F50D300940C81 /* PBXTargetDependency */ = { + 1F8FDCBC211CDD7400A76988 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = C2A7A1A4154F50D200940C81 /* Circle */; - targetProxy = C2A7A1CA154F50D300940C81 /* PBXContainerItemProxy */; + targetProxy = 1F8FDCBB211CDD7400A76988 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -322,29 +296,106 @@ name = MainMenu.xib; sourceTree = ""; }; - C2A7A1CF154F50D300940C81 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - C2A7A1D0154F50D300940C81 /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 1F8FDCBE211CDD7400A76988 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_STYLE = Manual; + COMBINE_HIDPI_IMAGES = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = ""; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = CircleTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.mikeash.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Circle.app/Contents/MacOS/Circle"; + }; + name = Debug; + }; + 1F8FDCBF211CDD7400A76988 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_STYLE = Manual; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DEVELOPMENT_TEAM = ""; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = CircleTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "com.mikeash.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Circle.app/Contents/MacOS/Circle"; + }; + name = Release; + }; C2A7A1D5154F50D300940C81 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -354,7 +405,9 @@ GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.7; ONLY_ACTIVE_ARCH = YES; @@ -366,18 +419,37 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_NO_COMMON_BLOCKS = YES; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.7; SDKROOT = macosx; @@ -390,6 +462,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Circle/Circle-Prefix.pch"; INFOPLIST_FILE = "Circle/Circle-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "com.mikeash.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -401,65 +474,38 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Circle/Circle-Prefix.pch"; INFOPLIST_FILE = "Circle/Circle-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "com.mikeash.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Release; }; - C2A7A1DB154F50D300940C81 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Circle.app/Contents/MacOS/Circle"; - FRAMEWORK_SEARCH_PATHS = "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\""; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Circle/Circle-Prefix.pch"; - INFOPLIST_FILE = "CircleTests/CircleTests-Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUNDLE_LOADER)"; - WRAPPER_EXTENSION = octest; - }; - name = Debug; - }; - C2A7A1DC154F50D300940C81 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Circle.app/Contents/MacOS/Circle"; - FRAMEWORK_SEARCH_PATHS = "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\""; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Circle/Circle-Prefix.pch"; - INFOPLIST_FILE = "CircleTests/CircleTests-Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUNDLE_LOADER)"; - WRAPPER_EXTENSION = octest; - }; - name = Release; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - C2A7A19F154F50D200940C81 /* Build configuration list for PBXProject "Circle" */ = { + 1F8FDCBD211CDD7400A76988 /* Build configuration list for PBXNativeTarget "CircleTests" */ = { isa = XCConfigurationList; buildConfigurations = ( - C2A7A1D5154F50D300940C81 /* Debug */, - C2A7A1D6154F50D300940C81 /* Release */, + 1F8FDCBE211CDD7400A76988 /* Debug */, + 1F8FDCBF211CDD7400A76988 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C2A7A1D7154F50D300940C81 /* Build configuration list for PBXNativeTarget "Circle" */ = { + C2A7A19F154F50D200940C81 /* Build configuration list for PBXProject "Circle" */ = { isa = XCConfigurationList; buildConfigurations = ( - C2A7A1D8154F50D300940C81 /* Debug */, - C2A7A1D9154F50D300940C81 /* Release */, + C2A7A1D5154F50D300940C81 /* Debug */, + C2A7A1D6154F50D300940C81 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C2A7A1DA154F50D300940C81 /* Build configuration list for PBXNativeTarget "CircleTests" */ = { + C2A7A1D7154F50D300940C81 /* Build configuration list for PBXNativeTarget "Circle" */ = { isa = XCConfigurationList; buildConfigurations = ( - C2A7A1DB154F50D300940C81 /* Debug */, - C2A7A1DC154F50D300940C81 /* Release */, + C2A7A1D8154F50D300940C81 /* Debug */, + C2A7A1D9154F50D300940C81 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Circle/Circle-Info.plist b/Circle/Circle-Info.plist index 7a0fd09..b7bee22 100644 --- a/Circle/Circle-Info.plist +++ b/Circle/Circle-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - com.mikeash.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Circle/CircleIVarLayout.m b/Circle/CircleIVarLayout.m index d65821f..084a0e7 100644 --- a/Circle/CircleIVarLayout.m +++ b/Circle/CircleIVarLayout.m @@ -50,8 +50,25 @@ // Dictionarys to cache the layout and classification of a class. -static CFMutableDictionaryRef gLayoutCache; -static CFMutableDictionaryRef gClassificationCache; + +static CFMutableDictionaryRef getClassificationCache() { + static CFMutableDictionaryRef gClassificationCache; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + // When the layout cache doesn't exist, create it now. We'll be adding an entry. + gClassificationCache = CFDictionaryCreateMutable(NULL, 0, NULL, NULL); + }); + return gClassificationCache; +} +static CFMutableDictionaryRef getLayoutCache() { + static dispatch_once_t onceToken; + static CFMutableDictionaryRef gLayoutCache; + dispatch_once(&onceToken, ^{ + // If the classification cache doesn't exist, create it. + gLayoutCache = CFDictionaryCreateMutable(NULL, 0, NULL, &kCFTypeDictionaryValueCallBacks); + }); + return gLayoutCache; +} // This class detects releases sent to it and makes that information available to @@ -170,10 +187,17 @@ static BOOL IsBlock(void *obj) { // Fetch the selector for the ARC destructor. SEL destructorSEL = sel_getUid(".cxx_destruct"); + + // `@selector(doNotImplementThisItDoesNotExistReally)` doesn't exist, obviously. Let clang know we + // don't care so we don't get a warning. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundeclared-selector" // Fetch the IMP for the destructor. Also fetch the IMP for a known unimplemented selector. void (*Destruct)(void *, SEL) = (__typeof__(Destruct))class_getMethodImplementation(c, destructorSEL); void (*Forward)(void *, SEL) = (__typeof__(Forward))class_getMethodImplementation([NSObject class], @selector(doNotImplementThisItDoesNotExistReally)); + +#pragma clang diagnostic pop // If the ARC destructor is not implemented (IMP equals that of an unimplemented selector) // then the class contains no strong references. We can just bail out now. @@ -202,13 +226,12 @@ static BOOL IsBlock(void *obj) // Fetch the strong ivar layout for a class, pulling from the cache when possible. static NSIndexSet *GetClassStrongLayout(Class c) { - // If the layout cache doesn't exist, create it now. We'll be adding an entry. - if(!gLayoutCache) - gLayoutCache = CFDictionaryCreateMutable(NULL, 0, NULL, &kCFTypeDictionaryValueCallBacks); - + + CFMutableDictionaryRef gLayoutCache = getLayoutCache(); + // Fetch the layout from the cache. NSIndexSet *layout = (__bridge NSIndexSet *)CFDictionaryGetValue(gLayoutCache, (__bridge void *)c); - + // If the layout doesn't exist in the cache, then compute it and cache it. if(!layout) { @@ -238,15 +261,13 @@ static BOOL IsBlock(void *obj) void (*dispose_helper)(void *src) = descriptor->rest[1]; - // If the layout cache doesn't exist, create it now. We'll add an entry to it. - if(!gLayoutCache) - gLayoutCache = CFDictionaryCreateMutable(NULL, 0, NULL, NULL); - + CFMutableDictionaryRef gLayoutCache = getLayoutCache(); + // See if the layout already exists. We can't use the block isa as a key, since different // blocks can share an isa. Instead, we use the address of the destructor function as the // key, since that destructor will always result in the same layout. NSIndexSet *layout = (__bridge NSIndexSet *)CFDictionaryGetValue(gLayoutCache, dispose_helper); - + // If the layout doesn't exist in the cache, calculate it using this block's isa, the block's // size as pulled from its descriptor, and a destructor that just calls the block destructor. if(!layout) @@ -263,9 +284,7 @@ static BOOL IsBlock(void *obj) // Classify an object into one of the listed classifications. static enum Classification Classify(void *obj) { - // If the classification cache doesn't exist, create it. - if(!gClassificationCache) - gClassificationCache = CFDictionaryCreateMutable(NULL, 0, NULL, NULL); + CFMutableDictionaryRef gClassificationCache = getClassificationCache(); // Key classifications off the object's class. void *key = (__bridge void *)object_getClass((__bridge id)obj); diff --git a/CircleTests/CircleTests.h b/CircleTests/CircleTests.h index 18de833..6335e5c 100644 --- a/CircleTests/CircleTests.h +++ b/CircleTests/CircleTests.h @@ -6,8 +6,8 @@ // Copyright (c) 2012 Michael Ash. All rights reserved. // -#import +#import -@interface CircleTests : SenTestCase +@interface CircleTests : XCTestCase @end diff --git a/CircleTests/CircleTests.m b/CircleTests/CircleTests.m index 2ca291f..81969f8 100644 --- a/CircleTests/CircleTests.m +++ b/CircleTests/CircleTests.m @@ -48,10 +48,10 @@ - (void)testSimpleCycle } @autoreleasepool { - STAssertNotNil(weakObj, @"Weak pointer to cycle should not be nil before running the collector"); + XCTAssertNotNil(weakObj, @"Weak pointer to cycle should not be nil before running the collector"); } [collector collect]; - STAssertNil(weakObj, @"Collector didn't collect a cycle"); + XCTAssertNil(weakObj, @"Collector didn't collect a cycle"); } - (void)testSingleObjectCycle @@ -68,10 +68,10 @@ - (void)testSingleObjectCycle } @autoreleasepool { - STAssertNotNil(weakObj, @"Weak pointer to cycle should not be nil before running the collector"); + XCTAssertNotNil(weakObj, @"Weak pointer to cycle should not be nil before running the collector"); } [collector collect]; - STAssertNil(weakObj, @"Collector didn't collect a cycle"); + XCTAssertNil(weakObj, @"Collector didn't collect a cycle"); } - (void)testBlockCycle @@ -89,10 +89,10 @@ - (void)testBlockCycle } @autoreleasepool { - STAssertNotNil(weakObj, @"Weak pointer to cycle should not be nil before running the collector"); + XCTAssertNotNil(weakObj, @"Weak pointer to cycle should not be nil before running the collector"); } [collector collect]; - STAssertNil(weakObj, @"Collector didn't collect a cycle"); + XCTAssertNil(weakObj, @"Collector didn't collect a cycle"); } - (void)testComplexCycle @@ -118,10 +118,10 @@ - (void)testComplexCycle } @autoreleasepool { - STAssertNotNil(weakObj, @"Weak pointer to cycle should not be nil before running the collector"); + XCTAssertNotNil(weakObj, @"Weak pointer to cycle should not be nil before running the collector"); } [collector collect]; - STAssertNil(weakObj, @"Collector didn't collect a cycle"); + XCTAssertNil(weakObj, @"Collector didn't collect a cycle"); } - (void)testReachableCycle @@ -142,10 +142,10 @@ - (void)testReachableCycle } @autoreleasepool { - STAssertNotNil(weakObj, @"Weak pointer to cycle should not be nil before running the collector"); + XCTAssertNotNil(weakObj, @"Weak pointer to cycle should not be nil before running the collector"); } [collector collect]; - STAssertNotNil(weakObj, @"Collector collected a referenced cycle"); + XCTAssertNotNil(weakObj, @"Collector collected a referenced cycle"); } - (void)testNSObject @@ -190,7 +190,7 @@ - (void)testManyCollections @autoreleasepool { for(int i = 0; i < COUNT; i++) - STAssertNotNil(weakObjs[i], @"Weak pointer to cycle should not be nil before running the collector"); + XCTAssertNotNil(weakObjs[i], @"Weak pointer to cycle should not be nil before running the collector"); } for(int i = 0; i < COUNT; i++) @@ -202,7 +202,7 @@ - (void)testManyCollections } for(int i = 0; i < COUNT; i++) - STAssertNil(weakObjs[i], @"Collector failed to collect a cycle"); + XCTAssertNil(weakObjs[i], @"Collector failed to collect a cycle"); } - (void)testArrayCycle @@ -220,10 +220,10 @@ - (void)testArrayCycle } @autoreleasepool { - STAssertNotNil(weakObj, @"Weak pointer to cycle should not be nil before running the collector"); + XCTAssertNotNil(weakObj, @"Weak pointer to cycle should not be nil before running the collector"); } [collector collect]; - STAssertNil(weakObj, @"Collector didn't collect a cycle"); + XCTAssertNil(weakObj, @"Collector didn't collect a cycle"); } - (void)testSetCycle @@ -241,10 +241,10 @@ - (void)testSetCycle } @autoreleasepool { - STAssertNotNil(weakObj, @"Weak pointer to cycle should not be nil before running the collector"); + XCTAssertNotNil(weakObj, @"Weak pointer to cycle should not be nil before running the collector"); } [collector collect]; - STAssertNil(weakObj, @"Collector didn't collect a cycle"); + XCTAssertNil(weakObj, @"Collector didn't collect a cycle"); } - (void)testDictionaryCycle @@ -262,10 +262,10 @@ - (void)testDictionaryCycle } @autoreleasepool { - STAssertNotNil(weakObj, @"Weak pointer to cycle should not be nil before running the collector"); + XCTAssertNotNil(weakObj, @"Weak pointer to cycle should not be nil before running the collector"); } [collector collect]; - STAssertNil(weakObj, @"Collector didn't collect a cycle"); + XCTAssertNil(weakObj, @"Collector didn't collect a cycle"); } - (void)test__blockReference @@ -295,10 +295,10 @@ - (void)testSimpleSubclassCycle } @autoreleasepool { - STAssertNotNil(weakObj, @"Weak pointer to cycle should not be nil before running the collector"); + XCTAssertNotNil(weakObj, @"Weak pointer to cycle should not be nil before running the collector"); } [collector collect]; - STAssertNil(weakObj, @"Collector didn't collect a cycle"); + XCTAssertNil(weakObj, @"Collector didn't collect a cycle"); } @end diff --git a/CircleTests/CircleTests-Info.plist b/CircleTests/Info.plist similarity index 73% rename from CircleTests/CircleTests-Info.plist rename to CircleTests/Info.plist index d44ddc6..6c40a6c 100644 --- a/CircleTests/CircleTests-Info.plist +++ b/CircleTests/Info.plist @@ -3,19 +3,19 @@ CFBundleDevelopmentRegion - en + $(DEVELOPMENT_LANGUAGE) CFBundleExecutable - ${EXECUTABLE_NAME} + $(EXECUTABLE_NAME) CFBundleIdentifier - com.mikeash.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 + CFBundleName + $(PRODUCT_NAME) CFBundlePackageType BNDL CFBundleShortVersionString 1.0 - CFBundleSignature - ???? CFBundleVersion 1 diff --git a/CircleTests/en.lproj/InfoPlist.strings b/CircleTests/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28f..0000000 --- a/CircleTests/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ -