Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use CInt and CUnsignedInt when calling C APIs (#128)
Motivation: On different platforms C may define `int` and `unsigned` to be different types. When writing C interop code in Swift it's preferable to use the `CInt` and `CUnsignedInt` typealiases as they will resolve to the correct C type on all supported platforms. If the imported C API is a definite-sized type, like `uint32_t` we leave the Swift type as definitely-sized. Modifications: Use `CInt` instead of `Int32` for C `int` parameters and `CUnsignedInt` instead of `UInt32` for C `unsigned` parameters. Result: Code is more portable and definite-sized types stand out.
- Loading branch information
Showing
6 changed files
with
25 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters