committed by
Nikolay Igotti
parent
e36b5d3476
commit
c1d9dc1cbb
@@ -11,7 +11,7 @@ fun main(args: Array<String>) {
|
||||
values[3].value = 13
|
||||
values[4].value = 8
|
||||
|
||||
cstdlib.qsort(values[0].ptr, count.toLong(), CInt32Var.size, staticCFunction(::comparator))
|
||||
cstdlib.qsort(values, count.toLong(), CInt32Var.size, staticCFunction(::comparator))
|
||||
|
||||
for (i in 0 .. count - 1) {
|
||||
print(values[i].value)
|
||||
|
||||
@@ -35,14 +35,14 @@ fun main(args: Array<String>) {
|
||||
.ensureUnixCallResult { it >= 0 }
|
||||
|
||||
while (true) {
|
||||
val length = read(commFd, buffer.ptr, bufferLength)
|
||||
val length = read(commFd, buffer, bufferLength)
|
||||
.ensureUnixCallResult { it >= 0 }
|
||||
|
||||
if (length == 0L) {
|
||||
break
|
||||
}
|
||||
|
||||
write(commFd, buffer.ptr, length)
|
||||
write(commFd, buffer, length)
|
||||
.ensureUnixCallResult { it >= 0 }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user