expr: fix a compiler warning about different signs in comparison
We know that variable is >=0, so we can just cast it to unsigned. Change-Id: I3792eeb3ca43e6a507cc44c1a70584d42b2acd7b
This commit is contained in:
parent
5ee1e6ea98
commit
50a63f8435
1 changed files with 5 additions and 3 deletions
|
@ -3275,10 +3275,12 @@ static RegisterPrimOp primop_all({
|
||||||
|
|
||||||
static void prim_genList(EvalState & state, const PosIdx pos, Value * * args, Value & v)
|
static void prim_genList(EvalState & state, const PosIdx pos, Value * * args, Value & v)
|
||||||
{
|
{
|
||||||
auto len = state.forceInt(*args[1], pos, "while evaluating the second argument passed to builtins.genList").value;
|
auto len_ = state.forceInt(*args[1], pos, "while evaluating the second argument passed to builtins.genList").value;
|
||||||
|
|
||||||
if (len < 0)
|
if (len_ < 0)
|
||||||
state.error<EvalError>("cannot create list of size %1%", len).atPos(pos).debugThrow();
|
state.error<EvalError>("cannot create list of size %1%", len_).atPos(pos).debugThrow();
|
||||||
|
|
||||||
|
size_t len = len_;
|
||||||
|
|
||||||
// More strict than striclty (!) necessary, but acceptable
|
// More strict than striclty (!) necessary, but acceptable
|
||||||
// as evaluating map without accessing any values makes little sense.
|
// as evaluating map without accessing any values makes little sense.
|
||||||
|
|
Loading…
Reference in a new issue