fixed breaking change (x5)
This commit is contained in:
parent
d2c47bb9a0
commit
c55ab5488f
1 changed files with 7 additions and 1 deletions
|
@ -280,7 +280,13 @@ proc zipfs_language_detector*(languages : ptr UncheckedArray[cstring],
|
||||||
let resultPairs = makeResult output
|
let resultPairs = makeResult output
|
||||||
length_output[] = cuint(resultPairs.high)
|
length_output[] = cuint(resultPairs.high)
|
||||||
successful[] = length_output[] == languages_count
|
successful[] = length_output[] == languages_count
|
||||||
result[] = createCStringArray(resultPairs.map(x=>x[0]))[0]
|
result[] = cast[ptr UncheckedArray[cstring]](create(cstring, sizeof(cstring)*resultPairs.high))
|
||||||
|
var i = 0
|
||||||
|
for (language, _) in resultPairs:
|
||||||
|
var newCstring = cast[cstring](create(byte, language.high))
|
||||||
|
copyMem(newCstring, addr language[0], language.len)
|
||||||
|
result[][i] = newCstring
|
||||||
|
i+=1
|
||||||
let floatsize = sizeof(float32)*(int(length_output[])+2)
|
let floatsize = sizeof(float32)*(int(length_output[])+2)
|
||||||
let floatResult = cast[ptr UncheckedArray[float32]](create(float32, floatsize))
|
let floatResult = cast[ptr UncheckedArray[float32]](create(float32, floatsize))
|
||||||
for x in 0 .. resultPairs.high:
|
for x in 0 .. resultPairs.high:
|
||||||
|
|
Loading…
Reference in a new issue