UnsafeMutablePointer.alloc(_:) => UnsafeMutablePointer(allocatingCapacity:)

This commit is contained in:
Dmitri Gribenko
2015-11-05 15:16:45 -08:00
committed by Max Moiseev
parent 4e8291fcfb
commit 1f70e25899
20 changed files with 42 additions and 42 deletions

View File

@@ -198,7 +198,7 @@ NSStringAPIs.test("init(withCString_:encoding:)") {
NSStringAPIs.test("init(UTF8String:)") {
var s = "foo あいう"
var up = UnsafeMutablePointer<UInt8>.alloc(100)
var up = UnsafeMutablePointer<UInt8>(allocatingCapacity: 100)
var i = 0
for b in s.utf8 {
up[i] = b
@@ -2144,7 +2144,7 @@ func getNullCString() -> UnsafeMutablePointer<CChar> {
}
func getASCIICString() -> (UnsafeMutablePointer<CChar>, dealloc: ()->()) {
let up = UnsafeMutablePointer<CChar>.alloc(100)
let up = UnsafeMutablePointer<CChar>(allocatingCapacity: 100)
up[0] = 0x61
up[1] = 0x62
up[2] = 0
@@ -2152,7 +2152,7 @@ func getASCIICString() -> (UnsafeMutablePointer<CChar>, dealloc: ()->()) {
}
func getNonASCIICString() -> (UnsafeMutablePointer<CChar>, dealloc: ()->()) {
let up = UnsafeMutablePointer<UInt8>.alloc(100)
let up = UnsafeMutablePointer<UInt8>(allocatingCapacity: 100)
up[0] = 0xd0
up[1] = 0xb0
up[2] = 0xd0
@@ -2163,7 +2163,7 @@ func getNonASCIICString() -> (UnsafeMutablePointer<CChar>, dealloc: ()->()) {
func getIllFormedUTF8String1(
) -> (UnsafeMutablePointer<CChar>, dealloc: ()->()) {
let up = UnsafeMutablePointer<UInt8>.alloc(100)
let up = UnsafeMutablePointer<UInt8>(allocatingCapacity: 100)
up[0] = 0x41
up[1] = 0xed
up[2] = 0xa0
@@ -2175,7 +2175,7 @@ func getIllFormedUTF8String1(
func getIllFormedUTF8String2(
) -> (UnsafeMutablePointer<CChar>, dealloc: ()->()) {
let up = UnsafeMutablePointer<UInt8>.alloc(100)
let up = UnsafeMutablePointer<UInt8>(allocatingCapacity: 100)
up[0] = 0x41
up[1] = 0xed
up[2] = 0xa0