mirror of
https://github.com/apple/swift-nio-ssl
synced 2026-11-26 04:57:52 +00:00
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.