@@ -315,8 +315,8 @@ void drawStringRenamed(const char *, int xPos, int yPos)
315
315
```swift
316
316
// C header imported in Swift.
317
317
318
- func drawString(_: UnsafePointer<CChar>!, _ xPos: Int , _ yPos: Int )
319
- func drawStringRenamed(_: UnsafePointer<CChar>!, x: Int , y: Int )
318
+ func drawString(_: UnsafePointer<CChar>!, _ xPos: CInt , _ yPos: CInt )
319
+ func drawStringRenamed(_: UnsafePointer<CChar>!, x: CInt , y: CInt )
320
320
321
321
drawString("hello", 10, 20)
322
322
drawStringRenamed("hello", x: 10, y: 20)
@@ -602,9 +602,9 @@ memory layout.
602
602
603
603
As discussed above, there are cases where bridging that adjusts memory layout is
604
604
not possible, for example, when importing pointers to function pointers. For
605
- example, while C's int ` (*)(char) ` can be imported as ` (Int8 ) -> Int ` (requires
605
+ example, while C's ` int (*)(char) ` can be imported as ` (CChar ) -> CInt ` (requires
606
606
an adjustment of memory layout), C's ` int (**)(char) ` can't be imported as
607
- ` UnsafePointer<(Int8 ) -> Int > ` , because the pointee must have identical memory
607
+ ` UnsafePointer<(CChar ) -> CInt > ` , because the pointee must have identical memory
608
608
layout in C and in Swift.
609
609
610
610
Therefore, we need a Swift type that has a memory layout identical to C function
@@ -800,9 +800,9 @@ union IntOrFloat {
800
800
801
801
struct IntOrFloat {
802
802
var i: CInt { get set } // Computed property.
803
- var f: Float { get set } // Computed property.
803
+ var f: CFloat { get set } // Computed property.
804
804
init (i : CInt )
805
- init (f : Float )
805
+ init (f : CFloat )
806
806
init ()
807
807
}
808
808
```
0 commit comments