diff --git a/stdlib/public/SDK/Dispatch/Data.swift b/stdlib/public/SDK/Dispatch/Data.swift index 4593d6a3f7390..2ad7b78e60b4c 100644 --- a/stdlib/public/SDK/Dispatch/Data.swift +++ b/stdlib/public/SDK/Dispatch/Data.swift @@ -29,7 +29,7 @@ public struct DispatchData : RandomAccessCollection, _ObjectiveCBridgeable { /// A custom deallocator case custom(DispatchQueue?, @convention(block) () -> Void) - private var _deallocator: (DispatchQueue?, @convention(block) () -> Void) { + fileprivate var _deallocator: (DispatchQueue?, @convention(block) () -> Void) { switch self { case .free: return (nil, _dispatch_data_destructor_free()) case .unmap: return (nil, _dispatch_data_destructor_munmap()) @@ -38,7 +38,7 @@ public struct DispatchData : RandomAccessCollection, _ObjectiveCBridgeable { } } - private var __wrapped: __DispatchData + fileprivate var __wrapped: __DispatchData /// Initialize a `Data` with copied memory content. /// diff --git a/stdlib/public/SDK/Dispatch/Queue.swift b/stdlib/public/SDK/Dispatch/Queue.swift index cb03e4acfaa7e..b4130a4857949 100644 --- a/stdlib/public/SDK/Dispatch/Queue.swift +++ b/stdlib/public/SDK/Dispatch/Queue.swift @@ -33,7 +33,7 @@ public extension DispatchQueue { @available(OSX 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *) public static let initiallyInactive = Attributes(rawValue: 1<<2) - private func _attr() -> __OS_dispatch_queue_attr? { + fileprivate func _attr() -> __OS_dispatch_queue_attr? { var attr: __OS_dispatch_queue_attr? = nil if self.contains(.concurrent) { diff --git a/stdlib/public/SDK/Dispatch/Time.swift b/stdlib/public/SDK/Dispatch/Time.swift index 2b31a771ddd12..357ff5a50b0ac 100644 --- a/stdlib/public/SDK/Dispatch/Time.swift +++ b/stdlib/public/SDK/Dispatch/Time.swift @@ -20,7 +20,7 @@ public struct DispatchTime : Comparable { public static let distantFuture = DispatchTime(rawValue: ~0) - private init(rawValue: dispatch_time_t) { + fileprivate init(rawValue: dispatch_time_t) { self.rawValue = rawValue } @@ -60,7 +60,7 @@ public struct DispatchWallTime : Comparable { public static let distantFuture = DispatchWallTime(rawValue: ~0) - private init(rawValue: dispatch_time_t) { + fileprivate init(rawValue: dispatch_time_t) { self.rawValue = rawValue } diff --git a/stdlib/public/SDK/Foundation/Boxing.swift b/stdlib/public/SDK/Foundation/Boxing.swift index 844f9dba092b2..a4542c9a51cb6 100644 --- a/stdlib/public/SDK/Foundation/Boxing.swift +++ b/stdlib/public/SDK/Foundation/Boxing.swift @@ -16,7 +16,7 @@ /// /// Note: This assumes that the result of calling copy() is mutable. The documentation says that classes which do not have a mutable/immutable distinction should just adopt NSCopying instead of NSMutableCopying. internal final class _MutableHandle { - private var _pointer : MutableType + fileprivate var _pointer : MutableType init(reference : MutableType) { _pointer = reference.copy() as! MutableType diff --git a/stdlib/public/SDK/Foundation/Calendar.swift b/stdlib/public/SDK/Foundation/Calendar.swift index af16d204ebc97..1f33e93d6c6fa 100644 --- a/stdlib/public/SDK/Foundation/Calendar.swift +++ b/stdlib/public/SDK/Foundation/Calendar.swift @@ -115,7 +115,7 @@ public struct Calendar : CustomStringConvertible, CustomDebugStringConvertible, // MARK: - // MARK: Bridging - private init(reference : NSCalendar) { + fileprivate init(reference : NSCalendar) { _handle = _MutableHandle(reference: reference) if __NSCalendarIsAutoupdating(reference) { _autoupdating = true diff --git a/stdlib/public/SDK/Foundation/CharacterSet.swift b/stdlib/public/SDK/Foundation/CharacterSet.swift index 1e9cfa623df40..05f8881548927 100644 --- a/stdlib/public/SDK/Foundation/CharacterSet.swift +++ b/stdlib/public/SDK/Foundation/CharacterSet.swift @@ -82,7 +82,7 @@ public struct CharacterSet : ReferenceConvertible, Equatable, Hashable, SetAlgeb // MARK: Init methods - private init(_bridged characterSet: NSCharacterSet) { + fileprivate init(_bridged characterSet: NSCharacterSet) { // We must copy the input because it might be mutable; just like storing a value type in ObjC _wrapped = _SwiftNSCharacterSet(immutableObject: characterSet.copy() as AnyObject) } diff --git a/stdlib/public/SDK/Foundation/Data.swift b/stdlib/public/SDK/Foundation/Data.swift index d7152447bc96c..dc44f6113df37 100644 --- a/stdlib/public/SDK/Foundation/Data.swift +++ b/stdlib/public/SDK/Foundation/Data.swift @@ -103,7 +103,7 @@ public struct Data : ReferenceConvertible, CustomStringConvertible, Equatable, H /// A custom deallocator. case custom((UnsafeMutablePointer, Int) -> Void) - private var _deallocator : ((UnsafeMutablePointer, Int) -> Void)? { + fileprivate var _deallocator : ((UnsafeMutablePointer, Int) -> Void)? { switch self { case .virtualMemory: return { __NSDataInvokeDeallocatorVM($0, $1) } diff --git a/stdlib/public/SDK/Foundation/Date.swift b/stdlib/public/SDK/Foundation/Date.swift index bbae2906ef024..ff7ec6ccacb27 100644 --- a/stdlib/public/SDK/Foundation/Date.swift +++ b/stdlib/public/SDK/Foundation/Date.swift @@ -21,7 +21,7 @@ import CoreFoundation public struct Date : ReferenceConvertible, Comparable, Equatable, CustomStringConvertible { public typealias ReferenceType = NSDate - private var _time : TimeInterval + fileprivate var _time : TimeInterval /// The number of seconds from 1 January 1970 to the reference date, 1 January 2001. public static let timeIntervalBetween1970AndReferenceDate : TimeInterval = 978307200.0 diff --git a/stdlib/public/SDK/Foundation/DateComponents.swift b/stdlib/public/SDK/Foundation/DateComponents.swift index ac8c92fa2f562..ecb0621745e2c 100644 --- a/stdlib/public/SDK/Foundation/DateComponents.swift +++ b/stdlib/public/SDK/Foundation/DateComponents.swift @@ -277,7 +277,7 @@ public struct DateComponents : ReferenceConvertible, Hashable, Equatable, _Mutab // MARK: - Bridging Helpers - private init(reference: NSDateComponents) { + fileprivate init(reference: NSDateComponents) { _handle = _MutableHandle(reference: reference) } diff --git a/stdlib/public/SDK/Foundation/IndexPath.swift b/stdlib/public/SDK/Foundation/IndexPath.swift index c6388b8730b97..3323ebdfb9b93 100644 --- a/stdlib/public/SDK/Foundation/IndexPath.swift +++ b/stdlib/public/SDK/Foundation/IndexPath.swift @@ -156,7 +156,7 @@ public struct IndexPath : ReferenceConvertible, Equatable, Hashable, MutableColl // MARK: - Bridging Helpers - private init(nsIndexPath: ReferenceType) { + fileprivate init(nsIndexPath: ReferenceType) { let count = nsIndexPath.length if count == 0 { _indexes = [] @@ -171,7 +171,7 @@ public struct IndexPath : ReferenceConvertible, Equatable, Hashable, MutableColl } } - private func makeReference() -> ReferenceType { + fileprivate func makeReference() -> ReferenceType { return _indexes.withUnsafeBufferPointer { return ReferenceType(indexes: $0.baseAddress, length: $0.count) } diff --git a/stdlib/public/SDK/Foundation/IndexSet.swift b/stdlib/public/SDK/Foundation/IndexSet.swift index 03f897eae3dad..730ab423e0887 100644 --- a/stdlib/public/SDK/Foundation/IndexSet.swift +++ b/stdlib/public/SDK/Foundation/IndexSet.swift @@ -101,12 +101,12 @@ public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollectio public let startIndex : Index public let endIndex : Index - private var indexSet : IndexSet + fileprivate var indexSet : IndexSet // Range of element values private var intersectingRange : Range? - private init(indexSet : IndexSet, intersecting range : Range?) { + fileprivate init(indexSet : IndexSet, intersecting range : Range?) { self.indexSet = indexSet self.intersectingRange = range @@ -170,12 +170,12 @@ public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollectio /// The mechanism for accessing the integers stored in an IndexSet. public struct Index : CustomStringConvertible, Comparable { - private var value : IndexSet.Element - private var extent : Range - private var rangeIndex : Int - private let rangeCount : Int + fileprivate var value : IndexSet.Element + fileprivate var extent : Range + fileprivate var rangeIndex : Int + fileprivate let rangeCount : Int - private init(value: Int, extent: Range, rangeIndex: Int, rangeCount: Int) { + fileprivate init(value: Int, extent: Range, rangeIndex: Int, rangeCount: Int) { self.value = value self.extent = extent self.rangeCount = rangeCount @@ -190,7 +190,7 @@ public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollectio public typealias ReferenceType = NSIndexSet public typealias Element = Int - private var _handle: _MutablePairHandle + fileprivate var _handle: _MutablePairHandle /// Initialize an `IndexSet` with a range of integers. public init(integersIn range: Range) { @@ -768,11 +768,11 @@ public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollectio // MARK: - Bridging Support - private var reference: NSIndexSet { + fileprivate var reference: NSIndexSet { return _handle.reference } - private init(reference: NSIndexSet) { + fileprivate init(reference: NSIndexSet) { _handle = _MutablePairHandle(reference) } } @@ -788,7 +788,7 @@ private struct IndexSetBoundaryIterator : IteratorProtocol { private var i1UsedLower : Bool private var i2UsedLower : Bool - private init(_ is1 : IndexSet, _ is2 : IndexSet) { + fileprivate init(_ is1 : IndexSet, _ is2 : IndexSet) { i1 = is1.rangeView.makeIterator() i2 = is2.rangeView.makeIterator() @@ -800,7 +800,7 @@ private struct IndexSetBoundaryIterator : IteratorProtocol { i2UsedLower = false } - private mutating func next() -> Element? { + fileprivate mutating func next() -> Element? { if i1Range == nil && i2Range == nil { return nil } @@ -900,7 +900,7 @@ private enum _MutablePair { /// /// a.k.a. Box private final class _MutablePairHandle { - private var _pointer: _MutablePair + fileprivate var _pointer: _MutablePair /// Initialize with an immutable reference instance. /// diff --git a/stdlib/public/SDK/Foundation/Locale.swift b/stdlib/public/SDK/Foundation/Locale.swift index 691a434a7bb4b..b92c3b61880f9 100644 --- a/stdlib/public/SDK/Foundation/Locale.swift +++ b/stdlib/public/SDK/Foundation/Locale.swift @@ -34,7 +34,7 @@ public struct Locale : CustomStringConvertible, CustomDebugStringConvertible, Ha public typealias LanguageDirection = NSLocale.LanguageDirection - private var _wrapped : NSLocale + fileprivate var _wrapped : NSLocale private var _autoupdating : Bool /// Returns a locale which tracks the user's current preferences. @@ -61,7 +61,7 @@ public struct Locale : CustomStringConvertible, CustomDebugStringConvertible, Ha _autoupdating = false } - private init(reference: NSLocale) { + fileprivate init(reference: NSLocale) { _wrapped = reference.copy() as! NSLocale if __NSLocaleIsAutoupdating(reference) { _autoupdating = true diff --git a/stdlib/public/SDK/Foundation/PersonNameComponents.swift b/stdlib/public/SDK/Foundation/PersonNameComponents.swift index dd76d4d149686..5aae334427369 100644 --- a/stdlib/public/SDK/Foundation/PersonNameComponents.swift +++ b/stdlib/public/SDK/Foundation/PersonNameComponents.swift @@ -21,7 +21,7 @@ public struct PersonNameComponents : ReferenceConvertible, Hashable, Equatable, _handle = _MutableHandle(adoptingReference: NSPersonNameComponents()) } - private init(reference: NSPersonNameComponents) { + fileprivate init(reference: NSPersonNameComponents) { _handle = _MutableHandle(reference: reference) } diff --git a/stdlib/public/SDK/Foundation/TimeZone.swift b/stdlib/public/SDK/Foundation/TimeZone.swift index 28572fece282a..eede5266c51df 100644 --- a/stdlib/public/SDK/Foundation/TimeZone.swift +++ b/stdlib/public/SDK/Foundation/TimeZone.swift @@ -33,7 +33,7 @@ internal func __NSTimeZoneCurrent() -> NSTimeZone public struct TimeZone : CustomStringConvertible, CustomDebugStringConvertible, Hashable, Equatable, ReferenceConvertible { public typealias ReferenceType = NSTimeZone - private var _wrapped : NSTimeZone + fileprivate var _wrapped : NSTimeZone private var _autoupdating : Bool /// The time zone currently used by the system. @@ -100,7 +100,7 @@ public struct TimeZone : CustomStringConvertible, CustomDebugStringConvertible, } } - private init(reference: NSTimeZone) { + fileprivate init(reference: NSTimeZone) { if __NSTimeZoneIsAutoupdating(reference) { // we can't copy this or we lose its auto-ness (27048257) // fortunately it's immutable diff --git a/stdlib/public/SDK/Foundation/URL.swift b/stdlib/public/SDK/Foundation/URL.swift index 8d37e084db4e2..aa2c61e32380f 100644 --- a/stdlib/public/SDK/Foundation/URL.swift +++ b/stdlib/public/SDK/Foundation/URL.swift @@ -36,15 +36,15 @@ public struct URLThumbnailSizeKey : RawRepresentable, Hashable { As a convenience, volume resource values can be requested from any file system URL. The value returned will reflect the property value for the volume on which the resource is located. */ public struct URLResourceValues { - private var _values: [URLResourceKey: Any] - private var _keys: Set + fileprivate var _values: [URLResourceKey: Any] + fileprivate var _keys: Set public init() { _values = [:] _keys = [] } - private init(keys: Set, values: [URLResourceKey: Any]) { + fileprivate init(keys: Set, values: [URLResourceKey: Any]) { _values = values _keys = keys } @@ -477,7 +477,7 @@ public struct URLResourceValues { */ public struct URL : ReferenceConvertible, CustomStringConvertible, Equatable { public typealias ReferenceType = NSURL - private var _url : NSURL + fileprivate var _url : NSURL public typealias BookmarkResolutionOptions = NSURL.BookmarkResolutionOptions public typealias BookmarkCreationOptions = NSURL.BookmarkCreationOptions @@ -1130,7 +1130,7 @@ public struct URL : ReferenceConvertible, CustomStringConvertible, Equatable { } } - private init(reference: NSURL) { + fileprivate init(reference: NSURL) { _url = URL._converted(from: reference).copy() as! NSURL } diff --git a/stdlib/public/SDK/Foundation/URLComponents.swift b/stdlib/public/SDK/Foundation/URLComponents.swift index 8236217a51da0..110d95bfc5c7a 100644 --- a/stdlib/public/SDK/Foundation/URLComponents.swift +++ b/stdlib/public/SDK/Foundation/URLComponents.swift @@ -305,7 +305,7 @@ public struct URLComponents : ReferenceConvertible, Hashable, CustomStringConver // MARK: - Bridging - private init(reference: NSURLComponents) { + fileprivate init(reference: NSURLComponents) { _handle = _MutableHandle(reference: reference) } @@ -349,14 +349,14 @@ extension URLComponents : _ObjectiveCBridgeable { public struct URLQueryItem : ReferenceConvertible, Hashable, Equatable, CustomStringConvertible { public typealias ReferenceType = NSURLQueryItem - private var _queryItem : NSURLQueryItem + fileprivate var _queryItem : NSURLQueryItem public init(name: String, value: String?) { _queryItem = NSURLQueryItem(name: name, value: value) } - private init(reference: NSURLQueryItem) { _queryItem = reference.copy() as! NSURLQueryItem } - private var reference : NSURLQueryItem { return _queryItem } + fileprivate init(reference: NSURLQueryItem) { _queryItem = reference.copy() as! NSURLQueryItem } + fileprivate var reference : NSURLQueryItem { return _queryItem } public var name : String { get { return _queryItem.name } diff --git a/stdlib/public/SDK/Foundation/URLRequest.swift b/stdlib/public/SDK/Foundation/URLRequest.swift index ab08b4d47cf6a..d292a58564965 100644 --- a/stdlib/public/SDK/Foundation/URLRequest.swift +++ b/stdlib/public/SDK/Foundation/URLRequest.swift @@ -41,7 +41,7 @@ public struct URLRequest : ReferenceConvertible, CustomStringConvertible, Equata _handle = _MutableHandle(adoptingReference: NSMutableURLRequest(url: url, cachePolicy: cachePolicy, timeoutInterval: timeoutInterval)) } - private init(_bridged request: NSURLRequest) { + fileprivate init(_bridged request: NSURLRequest) { _handle = _MutableHandle(reference: request.mutableCopy() as! NSMutableURLRequest) } diff --git a/stdlib/public/SDK/Foundation/UUID.swift b/stdlib/public/SDK/Foundation/UUID.swift index fb3bebf6435b5..5ab083c25013d 100644 --- a/stdlib/public/SDK/Foundation/UUID.swift +++ b/stdlib/public/SDK/Foundation/UUID.swift @@ -27,7 +27,7 @@ public struct UUID : ReferenceConvertible, Hashable, Equatable, CustomStringConv } } - private init(reference: NSUUID) { + fileprivate init(reference: NSUUID) { var bytes: uuid_t = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) withUnsafeMutablePointer(&bytes) { reference.getBytes(unsafeBitCast($0, to: UnsafeMutablePointer.self)) @@ -79,7 +79,7 @@ public struct UUID : ReferenceConvertible, Hashable, Equatable, CustomStringConv // MARK: - Bridging Support - private var reference: NSUUID { + fileprivate var reference: NSUUID { var bytes = uuid return withUnsafePointer(&bytes) { return NSUUID(uuidBytes: unsafeBitCast($0, to: UnsafePointer.self)) diff --git a/stdlib/public/SDK/Foundation/UserInfo.swift b/stdlib/public/SDK/Foundation/UserInfo.swift index f6800a110e9a2..a9f8b8ed5fbd5 100644 --- a/stdlib/public/SDK/Foundation/UserInfo.swift +++ b/stdlib/public/SDK/Foundation/UserInfo.swift @@ -46,8 +46,8 @@ internal class _NSUserInfoDictionaryKeyEnumerator : NSEnumerator { } internal class _NSUserInfoDictionary : NSMutableDictionary { - private var _objc = [NSObject : AnyObject]() - private var _swift = [NSObject : Any]() + fileprivate var _objc = [NSObject : AnyObject]() + fileprivate var _swift = [NSObject : Any]() /// Note: these two init methods are the only proper method of construction and must be marked as "convenience" and call super.init() because the overlay has required init methods in extensions private convenience init(objc: [NSObject : AnyObject], swift: [NSObject : Any]) {