remove all remaining warnings when build nim (with -d:nimHasLibFFI) (#13084)
* cleanup deprecations in evalffi + elsewhere * remove dead code getOrdValue64
This commit is contained in:
parent
852170cc78
commit
3f78873898
3 changed files with 7 additions and 14 deletions
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
## This file implements the FFI part of the evaluator for Nim code.
|
## This file implements the FFI part of the evaluator for Nim code.
|
||||||
|
|
||||||
import ast, astalgo, ropes, types, options, tables, dynlib, msgs, os, lineinfos
|
import ast, types, options, tables, dynlib, msgs, lineinfos
|
||||||
import pkg/libffi
|
import pkg/libffi
|
||||||
|
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
|
|
@ -70,7 +70,7 @@ proc importcSymbol*(conf: ConfigRef, sym: PSym): PNode =
|
||||||
if theAddr.isNil: globalError(conf, sym.info, "cannot import: " & name)
|
if theAddr.isNil: globalError(conf, sym.info, "cannot import: " & name)
|
||||||
result.intVal = cast[ByteAddress](theAddr)
|
result.intVal = cast[ByteAddress](theAddr)
|
||||||
|
|
||||||
proc mapType(conf: ConfigRef, t: ast.PType): ptr libffi.TType =
|
proc mapType(conf: ConfigRef, t: ast.PType): ptr libffi.Type =
|
||||||
if t == nil: return addr libffi.type_void
|
if t == nil: return addr libffi.type_void
|
||||||
|
|
||||||
case t.kind
|
case t.kind
|
||||||
|
|
@ -415,7 +415,7 @@ proc callForeignFunction*(conf: ConfigRef, call: PNode): PNode =
|
||||||
internalAssert conf, call[0].kind == nkPtrLit
|
internalAssert conf, call[0].kind == nkPtrLit
|
||||||
|
|
||||||
var cif: TCif
|
var cif: TCif
|
||||||
var sig: TParamList
|
var sig: ParamList
|
||||||
# use the arguments' types for varargs support:
|
# use the arguments' types for varargs support:
|
||||||
for i in 1..<call.len:
|
for i in 1..<call.len:
|
||||||
sig[i-1] = mapType(conf, call[i].typ)
|
sig[i-1] = mapType(conf, call[i].typ)
|
||||||
|
|
@ -427,7 +427,7 @@ proc callForeignFunction*(conf: ConfigRef, call: PNode): PNode =
|
||||||
mapType(conf, typ[0]), sig) != OK:
|
mapType(conf, typ[0]), sig) != OK:
|
||||||
globalError(conf, call.info, "error in FFI call")
|
globalError(conf, call.info, "error in FFI call")
|
||||||
|
|
||||||
var args: TArgList
|
var args: ArgList
|
||||||
let fn = cast[pointer](call[0].intVal)
|
let fn = cast[pointer](call[0].intVal)
|
||||||
for i in 1..<call.len:
|
for i in 1..<call.len:
|
||||||
var t = call[i].typ
|
var t = call[i].typ
|
||||||
|
|
@ -455,7 +455,7 @@ proc callForeignFunction*(conf: ConfigRef, fn: PNode, fntyp: PType,
|
||||||
internalAssert conf, fn.kind == nkPtrLit
|
internalAssert conf, fn.kind == nkPtrLit
|
||||||
|
|
||||||
var cif: TCif
|
var cif: TCif
|
||||||
var sig: TParamList
|
var sig: ParamList
|
||||||
for i in 0..len-1:
|
for i in 0..len-1:
|
||||||
var aTyp = args[i+start].typ
|
var aTyp = args[i+start].typ
|
||||||
if aTyp.isNil:
|
if aTyp.isNil:
|
||||||
|
|
@ -469,7 +469,7 @@ proc callForeignFunction*(conf: ConfigRef, fn: PNode, fntyp: PType,
|
||||||
mapType(conf, fntyp[0]), sig) != OK:
|
mapType(conf, fntyp[0]), sig) != OK:
|
||||||
globalError(conf, info, "error in FFI call")
|
globalError(conf, info, "error in FFI call")
|
||||||
|
|
||||||
var cargs: TArgList
|
var cargs: ArgList
|
||||||
let fn = cast[pointer](fn.intVal)
|
let fn = cast[pointer](fn.intVal)
|
||||||
for i in 0..len-1:
|
for i in 0..len-1:
|
||||||
let t = args[i+start].typ
|
let t = args[i+start].typ
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ when defined(nimfix):
|
||||||
import nimfix/prettybase
|
import nimfix/prettybase
|
||||||
|
|
||||||
when not defined(leanCompiler):
|
when not defined(leanCompiler):
|
||||||
import spawn, semparallel
|
import spawn
|
||||||
|
|
||||||
# implementation
|
# implementation
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,13 +106,6 @@ proc getOrdValue*(n: PNode; onError = high(Int128)): Int128 =
|
||||||
# should therefore really be revisited.
|
# should therefore really be revisited.
|
||||||
onError
|
onError
|
||||||
|
|
||||||
proc getOrdValue64*(n: PNode): BiggestInt {.deprecated: "use getOrdvalue".} =
|
|
||||||
case n.kind
|
|
||||||
of nkCharLit..nkUInt64Lit: n.intVal
|
|
||||||
of nkNilLit: 0
|
|
||||||
of nkHiddenStdConv: getOrdValue64(n[1])
|
|
||||||
else: high(BiggestInt)
|
|
||||||
|
|
||||||
proc getFloatValue*(n: PNode): BiggestFloat =
|
proc getFloatValue*(n: PNode): BiggestFloat =
|
||||||
case n.kind
|
case n.kind
|
||||||
of nkFloatLiterals: n.floatVal
|
of nkFloatLiterals: n.floatVal
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue