[stdlib] update for 'inout' adjustment (SE-0031)

This commit is contained in:
Daniel Duan
2016-02-26 12:02:29 -08:00
parent c9927f66f0
commit 2bc78b8c09
134 changed files with 499 additions and 499 deletions

View File

@@ -479,7 +479,7 @@ extension String {
// enumerateLinesUsingBlock:(void (^)(NSString *line, BOOL *stop))block
/// Enumerates all the lines in a string.
public func enumerateLines(body: (line: String, inout stop: Bool) -> ()) {
public func enumerateLines(body: (line: String, stop: inout Bool) -> ()) {
_ns.enumerateLinesUsingBlock {
(line: String, stop: UnsafeMutablePointer<ObjCBool>)
in
@@ -620,7 +620,7 @@ extension String {
///
/// - Note: will get a maximum of `min(buffer.count, maxLength)` bytes.
public func getBytes(
inout buffer: [UInt8],
buffer: inout [UInt8],
maxLength maxBufferCount: Int,
usedLength usedBufferCount: UnsafeMutablePointer<Int>,
encoding: NSStringEncoding,
@@ -649,7 +649,7 @@ extension String {
/// stores them in a buffer.
/// - Note: will store a maximum of `min(buffer.count, maxLength)` bytes.
public func getCString(
inout buffer: [CChar], maxLength: Int, encoding: NSStringEncoding
buffer: inout [CChar], maxLength: Int, encoding: NSStringEncoding
) -> Bool {
return _ns.getCString(&buffer, maxLength: min(buffer.count, maxLength),
encoding: encoding)
@@ -665,7 +665,7 @@ extension String {
/// - Note: will store a maximum of `min(buffer.count, maxLength)` bytes.
@available(*, unavailable, message="Use getFileSystemRepresentation on NSURL instead.")
public func getFileSystemRepresentation(
inout buffer: [CChar], maxLength: Int) -> Bool {
buffer: inout [CChar], maxLength: Int) -> Bool {
return _ns.getFileSystemRepresentation(
&buffer, maxLength: min(buffer.count, maxLength))
}