Skip to content

Commit 5ea9de2

Browse files
authored
Merge pull request #517 from bobdel/Swift4-update
Swift4 update to Count Occurrences and Fixed Size Array
2 parents 910dfef + aff5a59 commit 5ea9de2

File tree

6 files changed

+39
-13
lines changed

6 files changed

+39
-13
lines changed

Diff for: Boyer-Moore/BoyerMoore.playground/Contents.swift

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
//: Playground - noun: a place where people can play
22

3+
// last checked with Xcode 9.0b4
4+
#if swift(>=4.0)
5+
print("Hello, Swift 4!")
6+
#endif
7+
38
/*
49
Boyer-Moore string search
510

Diff for: Boyer-Moore/Tests/Tests.xcodeproj/project.pbxproj

+21-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
7B2BBC801C779D720067B71D /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
1717
7B2BBC941C779E7B0067B71D /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; };
1818
7B80C3CD1C77A256003CECC7 /* BoyerMooreTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BoyerMooreTests.swift; sourceTree = SOURCE_ROOT; };
19-
9AED567B1E0ED6DE00958DCC /* BoyerMoore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BoyerMoore.swift; path = ../../BoyerMoore.swift; sourceTree = "<group>"; };
19+
9AED567B1E0ED6DE00958DCC /* BoyerMoore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BoyerMoore.swift; path = ../BoyerMoore.swift; sourceTree = SOURCE_ROOT; };
2020
9AED567F1E0EE60B00958DCC /* BoyerMooreHorspoolTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BoyerMooreHorspoolTests.swift; sourceTree = SOURCE_ROOT; };
2121
/* End PBXFileReference section */
2222

@@ -87,12 +87,12 @@
8787
isa = PBXProject;
8888
attributes = {
8989
LastSwiftUpdateCheck = 0720;
90-
LastUpgradeCheck = 0800;
90+
LastUpgradeCheck = 0900;
9191
ORGANIZATIONNAME = "Swift Algorithm Club";
9292
TargetAttributes = {
9393
7B2BBC7F1C779D720067B71D = {
9494
CreatedOnToolsVersion = 7.2;
95-
LastSwiftMigration = 0800;
95+
LastSwiftMigration = 0900;
9696
};
9797
};
9898
};
@@ -162,14 +162,20 @@
162162
CLANG_CXX_LIBRARY = "libc++";
163163
CLANG_ENABLE_MODULES = YES;
164164
CLANG_ENABLE_OBJC_ARC = YES;
165+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
165166
CLANG_WARN_BOOL_CONVERSION = YES;
167+
CLANG_WARN_COMMA = YES;
166168
CLANG_WARN_CONSTANT_CONVERSION = YES;
167169
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
168170
CLANG_WARN_EMPTY_BODY = YES;
169171
CLANG_WARN_ENUM_CONVERSION = YES;
170172
CLANG_WARN_INFINITE_RECURSION = YES;
171173
CLANG_WARN_INT_CONVERSION = YES;
174+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
175+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
172176
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
177+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
178+
CLANG_WARN_STRICT_PROTOTYPES = YES;
173179
CLANG_WARN_SUSPICIOUS_MOVE = YES;
174180
CLANG_WARN_UNREACHABLE_CODE = YES;
175181
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -197,6 +203,7 @@
197203
ONLY_ACTIVE_ARCH = YES;
198204
SDKROOT = macosx;
199205
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
206+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
200207
};
201208
name = Debug;
202209
};
@@ -208,14 +215,20 @@
208215
CLANG_CXX_LIBRARY = "libc++";
209216
CLANG_ENABLE_MODULES = YES;
210217
CLANG_ENABLE_OBJC_ARC = YES;
218+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
211219
CLANG_WARN_BOOL_CONVERSION = YES;
220+
CLANG_WARN_COMMA = YES;
212221
CLANG_WARN_CONSTANT_CONVERSION = YES;
213222
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
214223
CLANG_WARN_EMPTY_BODY = YES;
215224
CLANG_WARN_ENUM_CONVERSION = YES;
216225
CLANG_WARN_INFINITE_RECURSION = YES;
217226
CLANG_WARN_INT_CONVERSION = YES;
227+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
228+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
218229
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
230+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
231+
CLANG_WARN_STRICT_PROTOTYPES = YES;
219232
CLANG_WARN_SUSPICIOUS_MOVE = YES;
220233
CLANG_WARN_UNREACHABLE_CODE = YES;
221234
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -236,6 +249,7 @@
236249
MTL_ENABLE_DEBUG_INFO = NO;
237250
SDKROOT = macosx;
238251
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
252+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
239253
};
240254
name = Release;
241255
};
@@ -247,7 +261,8 @@
247261
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
248262
PRODUCT_BUNDLE_IDENTIFIER = swift.algorithm.club.Tests;
249263
PRODUCT_NAME = "$(TARGET_NAME)";
250-
SWIFT_VERSION = 3.0;
264+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
265+
SWIFT_VERSION = 4.0;
251266
};
252267
name = Debug;
253268
};
@@ -259,7 +274,8 @@
259274
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
260275
PRODUCT_BUNDLE_IDENTIFIER = swift.algorithm.club.Tests;
261276
PRODUCT_NAME = "$(TARGET_NAME)";
262-
SWIFT_VERSION = 3.0;
277+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
278+
SWIFT_VERSION = 4.0;
263279
};
264280
name = Release;
265281
};

Diff for: Boyer-Moore/Tests/Tests.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0800"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
<TestableReference
@@ -46,6 +47,7 @@
4647
buildConfiguration = "Debug"
4748
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4849
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
50+
language = ""
4951
launchStyle = "0"
5052
useCustomWorkingDirectory = "NO"
5153
ignoresPersistentStateOnLaunch = "NO"

Diff for: Count Occurrences/CountOccurrences.playground/Contents.swift

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
//: Playground - noun: a place where people can play
1+
// last checked with Xcode 9.0b4
2+
#if swift(>=4.0)
3+
print("Hello, Swift 4!")
4+
#endif
25

36
func countOccurrencesOfKey(_ key: Int, inArray a: [Int]) -> Int {
47
func leftBoundary() -> Int {

Diff for: Count Occurrences/CountOccurrences.playground/timeline.xctimeline

-6
This file was deleted.

Diff for: Fixed Size Array/FixedSizeArray.playground/Contents.swift

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
//: Playground - noun: a place where people can play
22

3+
// last checked with Xcode 9.0b4
4+
#if swift(>=4.0)
5+
print("Hello, Swift 4!")
6+
#endif
7+
38
/*
49
An unordered array with a maximum size.
510

@@ -53,3 +58,4 @@ array.append(2)
5358
array[1]
5459
array.removeAt(index: 0)
5560
array.removeAll()
61+

0 commit comments

Comments
 (0)