Skip to content

Commit

Permalink
Fix conversion of signed constants to unsigned
Browse files Browse the repository at this point in the history
Signed integer constant cannot be automatically converted to unsigned
integer anymore after Kotlin 1.9.0.

See https://youtrack.jetbrains.com/issue/KT-56583 for detail
  • Loading branch information
sifmelcara committed Jun 21, 2023
1 parent bc00d92 commit 8d2e20c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions okio/src/nativeMain/kotlin/okio/SizetVariant.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ internal fun variantFread(
target: CPointer<ByteVarOf<Byte>>,
byteCount: UInt,
file: CPointer<FILE>,
): UInt = fread(target, 1, byteCount.convert(), file).convert()
): UInt = fread(target, 1u, byteCount.convert(), file).convert()

@OptIn(UnsafeNumber::class)
internal fun variantFwrite(
source: CPointer<ByteVar>,
byteCount: UInt,
file: CPointer<FILE>,
): UInt = fwrite(source, 1, byteCount.convert(), file).convert()
): UInt = fwrite(source, 1u, byteCount.convert(), file).convert()

0 comments on commit 8d2e20c

Please sign in to comment.