Lossy conversion from Int64/UInt64 to Int32/UInt32

This commit is contained in:
david-swift 2024-08-25 11:13:18 +02:00
parent 901e19c052
commit 018d21ee65
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ extension Int: Identifiable {
public var id: Int { self }
/// The C integer.
public var cInt: Int32 {
.init(self)
.init(truncatingIfNeeded: self)
}
}

View File

@ -9,7 +9,7 @@ extension UInt {
/// Convert an unsigned integer into the C form.
public var cInt: UInt32 {
.init(self)
.init(truncatingIfNeeded: self)
}
}