Update of obipcr and homogenization of logging

Former-commit-id: 46abf47c19ace5248042c02cf1f81d9f6c12eb10
This commit is contained in:
Eric Coissac
2024-05-16 15:18:30 +02:00
parent 61be8a55b1
commit 55ce36f329
27 changed files with 345 additions and 58 deletions

View File

@ -1,7 +1,7 @@
package obilua
import (
"log"
log "github.com/sirupsen/logrus"
lua "github.com/yuin/gopher-lua"
)
@ -67,13 +67,13 @@ func Table2ByteSlice(interpreter *lua.LState, table *lua.LTable) []byte {
v := table.RawGetInt(i)
switch v.Type() {
case lua.LTNumber:
if x:=float64(v.(lua.LNumber)); x <=255 {
if x := float64(v.(lua.LNumber)); x <= 255 {
val[i-1] = byte(x)
} else {
log.Fatalf("LUA: Value %f at index %d is to large to be converted to byte", x,i)
log.Fatalf("LUA: Value %f at index %d is to large to be converted to byte", x, i)
}
default:
log.Fatalf("LUA: Value %v at index %d cannot be converted to byte", v,i)
log.Fatalf("LUA: Value %v at index %d cannot be converted to byte", v, i)
}
}