Skip to content

Commit 0ea2b70

Browse files
committed
update for Swift 1.2, Xcode 6.3
1 parent ccf3460 commit 0ea2b70

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

bk2ch25p860mandelbrotNoThreading/ch38p1106mandelbrotNoThreading/MyMandelbrotView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ class MyMandelbrotView : UIView {
2727

2828
// create bitmap context
2929
func makeBitmapContext(size:CGSize) {
30-
var bitmapBytesPerRow : UInt = UInt(size.width * 4)
30+
var bitmapBytesPerRow = Int(size.width * 4)
3131
bitmapBytesPerRow += (16 - (bitmapBytesPerRow % 16)) % 16
3232
let colorSpace = CGColorSpaceCreateDeviceRGB()
3333
let prem = CGBitmapInfo(CGImageAlphaInfo.PremultipliedLast.rawValue)
34-
let context = CGBitmapContextCreate(nil, UInt(size.width), UInt(size.height), 8, bitmapBytesPerRow, colorSpace, prem)
34+
let context = CGBitmapContextCreate(nil, Int(size.width), Int(size.height), 8, bitmapBytesPerRow, colorSpace, prem)
3535
self.bitmapContext = context
3636
}
3737

bk2ch25p865mandelbrotOperation/ch38p1106mandelbrotNoThreading/MyMandelbrotOperation.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ class MyMandelbrotOperation : NSOperation {
1919

2020
// create instance variable
2121
func makeBitmapContext(size:CGSize) {
22-
var bitmapBytesPerRow : UInt = UInt(size.width * 4)
22+
var bitmapBytesPerRow = Int(size.width * 4)
2323
bitmapBytesPerRow += (16 - (bitmapBytesPerRow % 16)) % 16
2424
let colorSpace = CGColorSpaceCreateDeviceRGB()
2525
let prem : CGBitmapInfo = CGBitmapInfo(CGImageAlphaInfo.PremultipliedLast.rawValue)
26-
let context = CGBitmapContextCreate(nil, UInt(size.width), UInt(size.height), 8, bitmapBytesPerRow, colorSpace, prem)
26+
let context = CGBitmapContextCreate(nil, Int(size.width), Int(size.height), 8, bitmapBytesPerRow, colorSpace, prem)
2727
self.bitmapContext = context
2828
}
2929

bk2ch25p868mandelbrotGCD/ch38p1106mandelbrotNoThreading/MyMandelbrotView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ class MyMandelbrotView : UIView {
6161
func makeBitmapContext(size:CGSize) -> CGContext { // *
6262
self.assertOnBackgroundThread()
6363

64-
var bitmapBytesPerRow : UInt = UInt(size.width * 4)
64+
var bitmapBytesPerRow = Int(size.width * 4)
6565
bitmapBytesPerRow += (16 - (bitmapBytesPerRow % 16)) % 16
6666
let colorSpace = CGColorSpaceCreateDeviceRGB()
6767
let prem = CGBitmapInfo(CGImageAlphaInfo.PremultipliedLast.rawValue)
68-
let context = CGBitmapContextCreate(nil, UInt(size.width), UInt(size.height), 8, bitmapBytesPerRow, colorSpace, prem)
68+
let context = CGBitmapContextCreate(nil, Int(size.width), Int(size.height), 8, bitmapBytesPerRow, colorSpace, prem)
6969
return context
7070
}
7171

0 commit comments

Comments
 (0)