diff --git a/lib/SILOptimizer/Transforms/DeadStoreElimination.cpp b/lib/SILOptimizer/Transforms/DeadStoreElimination.cpp index d9b8bb747c778..3c38e2e96e73b 100644 --- a/lib/SILOptimizer/Transforms/DeadStoreElimination.cpp +++ b/lib/SILOptimizer/Transforms/DeadStoreElimination.cpp @@ -165,7 +165,7 @@ namespace { constexpr unsigned MaxLSLocationBBMultiplicationNone = 256*256; /// we could run optimistic DSE on functions with less than 64 basic blocks -/// and 64 locations which is a sizeable function. +/// and 64 locations which is a sizable function. constexpr unsigned MaxLSLocationBBMultiplicationPessimistic = 64*64; /// forward declaration. diff --git a/lib/SILOptimizer/Transforms/RedundantLoadElimination.cpp b/lib/SILOptimizer/Transforms/RedundantLoadElimination.cpp index 3bfcef06027a0..91db3e2ae2b9b 100644 --- a/lib/SILOptimizer/Transforms/RedundantLoadElimination.cpp +++ b/lib/SILOptimizer/Transforms/RedundantLoadElimination.cpp @@ -179,7 +179,7 @@ namespace { constexpr unsigned MaxLSLocationBBMultiplicationNone = 128*128; /// we could run optimistic RLE on functions with less than 64 basic blocks -/// and 64 locations which is a sizeable function. +/// and 64 locations which is a sizable function. constexpr unsigned MaxLSLocationBBMultiplicationPessimistic = 64*64; /// forward declaration. diff --git a/stdlib/public/SDK/Dispatch/Data.swift b/stdlib/public/SDK/Dispatch/Data.swift index a78bf5bca1b6f..bfe8366b5fa90 100644 --- a/stdlib/public/SDK/Dispatch/Data.swift +++ b/stdlib/public/SDK/Dispatch/Data.swift @@ -231,7 +231,7 @@ public struct DispatchData : RandomAccessCollection, _ObjectiveCBridgeable { public struct DispatchDataIterator : IteratorProtocol, Sequence { - /// Create an iterator over the given DisaptchData + /// Create an iterator over the given DispatchData public init(_data: DispatchData) { var ptr: UnsafePointer? self._count = 0 diff --git a/stdlib/public/SDK/Foundation/AffineTransform.swift b/stdlib/public/SDK/Foundation/AffineTransform.swift index 64f21c30751d5..0940a359f313e 100644 --- a/stdlib/public/SDK/Foundation/AffineTransform.swift +++ b/stdlib/public/SDK/Foundation/AffineTransform.swift @@ -187,7 +187,7 @@ extension AffineTransform : ReferenceConvertible, Hashable, CustomStringConverti } /** - Inverts the transformation matrix if possible. Matricies with a determinant that is less than + Inverts the transformation matrix if possible. Matrices with a determinant that is less than the smallest valid representation of a double value greater than zero are considered to be invalid for representing as an inverse. If the input AffineTransform can potentially fall into this case then the inverted() method is suggested to be used instead since that will return diff --git a/stdlib/public/SDK/Foundation/Boxing.swift b/stdlib/public/SDK/Foundation/Boxing.swift index 7f75dfe6b0d81..5e7e5d7739270 100644 --- a/stdlib/public/SDK/Foundation/Boxing.swift +++ b/stdlib/public/SDK/Foundation/Boxing.swift @@ -144,7 +144,7 @@ internal protocol _MutablePairBoxing { extension _MutablePairBoxing { @inline(__always) func _mapUnmanaged(_ whatToDo : @noescape (WrappedSwiftNSType.ImmutableType) throws -> ReturnType) rethrows -> ReturnType { - // We are using Unmananged. Make sure that the owning container class + // We are using Unmanaged. Make sure that the owning container class // 'self' is guaranteed to be alive by extending the lifetime of 'self' // to the end of the scope of this function. // Note: At the time of this writing using withExtendedLifetime here @@ -169,7 +169,7 @@ extension _MutablePairBoxing { @inline(__always) mutating func _applyUnmanagedMutation(_ whatToDo : @noescape (WrappedSwiftNSType.MutableType) throws -> ReturnType) rethrows -> ReturnType { - // We are using Unmananged. Make sure that the owning container class + // We are using Unmanaged. Make sure that the owning container class // 'self' is guaranteed to be alive by extending the lifetime of 'self' // to the end of the scope of this function. // Note: At the time of this writing using withExtendedLifetime here @@ -182,7 +182,7 @@ extension _MutablePairBoxing { let _unmanagedHandle = Unmanaged.passUnretained(_wrapped) let wrapper = _unmanagedHandle._withUnsafeGuaranteedRef { $0.__wrapped } - // This check is done twice becaue: Value kept live for too long causing uniqueness check to fail + // This check is done twice because: Value kept live for too long causing uniqueness check to fail switch (wrapper) { case .Immutable(_): break diff --git a/stdlib/public/SDK/Foundation/Date.swift b/stdlib/public/SDK/Foundation/Date.swift index fbc2176cfae53..d03b4298880c1 100644 --- a/stdlib/public/SDK/Foundation/Date.swift +++ b/stdlib/public/SDK/Foundation/Date.swift @@ -114,7 +114,7 @@ public struct Date : ReferenceConvertible, Comparable, Equatable, CustomStringCo /// Return a new `Date` by adding a `TimeInterval` to this `Date`. /// /// - parameter timeInterval: The value to add, in seconds. - /// - warning: This only adjusts an absolute value. If you wish to add calendrical concepts like hours, days, months then you must use a `Calendar`. That will take into account complexites like daylight saving time, months with different numbers of days, and more. + /// - warning: This only adjusts an absolute value. If you wish to add calendrical concepts like hours, days, months then you must use a `Calendar`. That will take into account complexities like daylight saving time, months with different numbers of days, and more. public func addingTimeInterval(_ timeInterval : TimeInterval) -> Date { return self + timeInterval } @@ -122,7 +122,7 @@ public struct Date : ReferenceConvertible, Comparable, Equatable, CustomStringCo /// Add a `TimeInterval` to this `Date`. /// /// - parameter timeInterval: The value to add, in seconds. - /// - warning: This only adjusts an absolute value. If you wish to add calendrical concepts like hours, days, months then you must use a `Calendar`. That will take into account complexites like daylight saving time, months with different numbers of days, and more. + /// - warning: This only adjusts an absolute value. If you wish to add calendrical concepts like hours, days, months then you must use a `Calendar`. That will take into account complexities like daylight saving time, months with different numbers of days, and more. public mutating func addTimeInterval(_ timeInterval: TimeInterval) { self += timeInterval } @@ -215,14 +215,14 @@ public func -(lhs: Date, rhs: TimeInterval) -> Date { /// Add a `TimeInterval` to a `Date`. /// -/// - warning: This only adjusts an absolute value. If you wish to add calendrical concepts like hours, days, months then you must use a `Calendar`. That will take into account complexites like daylight saving time, months with different numbers of days, and more. +/// - warning: This only adjusts an absolute value. If you wish to add calendrical concepts like hours, days, months then you must use a `Calendar`. That will take into account complexities like daylight saving time, months with different numbers of days, and more. public func +=(lhs: inout Date, rhs: TimeInterval) { lhs = lhs + rhs } /// Subtract a `TimeInterval` from a `Date`. /// -/// - warning: This only adjusts an absolute value. If you wish to add calendrical concepts like hours, days, months then you must use a `Calendar`. That will take into account complexites like daylight saving time, months with different numbers of days, and more. +/// - warning: This only adjusts an absolute value. If you wish to add calendrical concepts like hours, days, months then you must use a `Calendar`. That will take into account complexities like daylight saving time, months with different numbers of days, and more. public func -=(lhs: inout Date, rhs: TimeInterval) { lhs = lhs - rhs } diff --git a/stdlib/public/SDK/Foundation/Measurement.swift b/stdlib/public/SDK/Foundation/Measurement.swift index 8a20e60be6532..818714bedcdee 100644 --- a/stdlib/public/SDK/Foundation/Measurement.swift +++ b/stdlib/public/SDK/Foundation/Measurement.swift @@ -135,7 +135,7 @@ public func *(lhs: Measurement, rhs: Double) -> Measu return Measurement(value: lhs.value * rhs, unit: lhs.unit) } -/// Multiply a scalar value by a measurment. +/// Multiply a scalar value by a measurement. /// - returns: A measurement of value `lhs * rhs.value` with the same unit as `rhs`. @available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *) public func *(lhs: Double, rhs: Measurement) -> Measurement { @@ -188,7 +188,7 @@ public func <(lhs: Measurement, rhs: Measurement(lhs: Measurement, rhs: Measurement) -> Bool { if lhs.unit == rhs.unit { @@ -210,7 +210,7 @@ public func >(lhs: Measurement, rhs: Measurement rhs.value`. Otherwise, converts `rhs` to the same unit as `lhs` and then compares the resulting values. -/// - returns: `true` if `lhs` is greater than than `rhs`. +/// - returns: `true` if `lhs` is greater than `rhs`. @available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *) public func >(lhs: Measurement, rhs: Measurement) -> Bool { if lhs.unit == rhs.unit { diff --git a/stdlib/public/SDK/Foundation/URLComponents.swift b/stdlib/public/SDK/Foundation/URLComponents.swift index b3e1d859e9a8c..e36f6ba6ea8c4 100644 --- a/stdlib/public/SDK/Foundation/URLComponents.swift +++ b/stdlib/public/SDK/Foundation/URLComponents.swift @@ -270,7 +270,7 @@ public struct URLComponents : ReferenceConvertible, Hashable, CustomStringConver /// /// The setter combines an array containing any number of `URLQueryItem`s, each of which represents a single key-value pair, into a query string and sets the `URLComponents` query property. Passing an empty array sets the query component of the `URLComponents` to an empty string. Passing nil removes the query component of the `URLComponents`. /// - /// - note: If a name-value pair in a query is empty (i.e. the query string starts with '&', ends with '&', or has "&&" within it), you get a `URLQueryItem` with a zero-length name and and a nil value. If a query's name-value pair has nothing before the equals sign, you get a zero-length name. If a query's name-value pair has nothing after the equals sign, you get a zero-length value. If a query's name-value pair has no equals sign, the query name-value pair string is the name and you get a nil value. + /// - note: If a name-value pair in a query is empty (i.e. the query string starts with '&', ends with '&', or has "&&" within it), you get a `URLQueryItem` with a zero-length name and a nil value. If a query's name-value pair has nothing before the equals sign, you get a zero-length name. If a query's name-value pair has nothing after the equals sign, you get a zero-length value. If a query's name-value pair has no equals sign, the query name-value pair string is the name and you get a nil value. @available(OSX 10.10, iOS 8.0, *) public var queryItems: [URLQueryItem]? { get { return _handle.map { $0.queryItems?.map { return $0 as URLQueryItem } } } diff --git a/stdlib/public/SDK/Foundation/URLRequest.swift b/stdlib/public/SDK/Foundation/URLRequest.swift index 7e64df1868cd4..59da1a3a22410 100644 --- a/stdlib/public/SDK/Foundation/URLRequest.swift +++ b/stdlib/public/SDK/Foundation/URLRequest.swift @@ -67,7 +67,7 @@ public struct URLRequest : ReferenceConvertible, CustomStringConvertible, Equata /// Returns the timeout interval of the receiver. /// - discussion: The timeout interval specifies the limit on the idle - /// interval alloted to a request in the process of loading. The "idle + /// interval allotted to a request in the process of loading. The "idle /// interval" is defined as the period of time that has passed since the /// last instance of load activity occurred for a request that is in the /// process of loading. Hence, when an instance of load activity occurs @@ -111,7 +111,7 @@ public struct URLRequest : ReferenceConvertible, CustomStringConvertible, Equata } /// `true` if the receiver is allowed to use the built in cellular radios to - /// satify the request, `false` otherwise. + /// satisfy the request, `false` otherwise. @available(OSX 10.8, iOS 6.0, *) public var allowsCellularAccess: Bool { get { diff --git a/stdlib/public/SDK/Foundation/UUID.swift b/stdlib/public/SDK/Foundation/UUID.swift index 93bcd001e045a..cab393a006834 100644 --- a/stdlib/public/SDK/Foundation/UUID.swift +++ b/stdlib/public/SDK/Foundation/UUID.swift @@ -52,7 +52,7 @@ public struct UUID : ReferenceConvertible, Hashable, Equatable, CustomStringConv self.uuid = uuid } - /// Returns a string created from the the UUID, such as "E621E1F8-C36C-495A-93FC-0C247A3E6E5F" + /// Returns a string created from the UUID, such as "E621E1F8-C36C-495A-93FC-0C247A3E6E5F" public var uuidString: String { var bytes: uuid_string_t = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) var localValue = uuid diff --git a/test/1_stdlib/TestAffineTransform.swift b/test/1_stdlib/TestAffineTransform.swift index 0ae337d583356..03c24cdbba382 100644 --- a/test/1_stdlib/TestAffineTransform.swift +++ b/test/1_stdlib/TestAffineTransform.swift @@ -315,7 +315,7 @@ class TestAffineTransform : TestAffineTransformSuper { } func test_hashing_values() { - // the transforms are made up and the values dont matter + // the transforms are made up and the values don't matter let values = [ AffineTransform(m11: 1.0, m12: 2.5, m21: 66.2, m22: 40.2, tX: -5.5, tY: 3.7), AffineTransform(m11: -55.66, m12: 22.7, m21: 1.5, m22: 0.0, tX: -22, tY: -33), diff --git a/test/1_stdlib/TestData.swift b/test/1_stdlib/TestData.swift index 840f9a571b2cb..0d29d7316e6ab 100644 --- a/test/1_stdlib/TestData.swift +++ b/test/1_stdlib/TestData.swift @@ -625,8 +625,8 @@ class TestData : TestDataSuper { free(underlyingBuffer) } - func expectOverride(_ convertable: T, _ selector: String) { - expectNotEqual(class_getMethodImplementation(T._ObjectiveCType.self, sel_getUid(selector)), class_getMethodImplementation(object_getClass(convertable._bridgeToObjectiveC()), sel_getUid(selector)), "The bridge of \(T.self) should override \(selector)") + func expectOverride(_ convertible: T, _ selector: String) { + expectNotEqual(class_getMethodImplementation(T._ObjectiveCType.self, sel_getUid(selector)), class_getMethodImplementation(object_getClass(convertible._bridgeToObjectiveC()), sel_getUid(selector)), "The bridge of \(T.self) should override \(selector)") } func test_bridgeOverrides() { diff --git a/test/1_stdlib/TestUserInfo.swift b/test/1_stdlib/TestUserInfo.swift index 4d6c710c2fcb7..cbbf4cc7ddeb6 100644 --- a/test/1_stdlib/TestUserInfo.swift +++ b/test/1_stdlib/TestUserInfo.swift @@ -33,13 +33,13 @@ struct SomeStructure { /* Notification and potentially other structures require a representation of a - userInfo dictionary. The objective-c counterparts are represented via + userInfo dictionary. The Objective-C counterparts are represented via NSDictionary which can only store a hashable key (actually NSObject *) and a value of AnyObject (actually NSObject *). However it is desired in swift to store Any in the value. These structure expositions in swift have an adapter that allows them to pass a specialized NSDictionary - subclass to the objective-c layer that can round trip the stored Any types back - out into swift. + subclass to the Objective-C layer that can round trip the stored Any types back + out into Swift. In this case NSNotification -> Notification bridging is suitable to verify that behavior.