aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-02-24 14:33:01 +0100
committerEelco Dolstra <edolstra@gmail.com>2021-11-04 15:03:45 +0100
commitbcf47800067243b124569da9019077c81bf71cd5 (patch)
treeda4e296f2a3c3b152e94f54eccb61912ac6b32ff /src/libexpr/eval.cc
parent81e7c40264520b387358917987d101f5f5ae4705 (diff)
Add level / displacement types
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index b4b4f7b5c..641687f2a 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -787,7 +787,7 @@ void mkPath(Value & v, const char * s)
inline Value * EvalState::lookupVar(Env * env, const ExprVar & var, bool noEval)
{
- for (size_t l = var.level; l; --l, env = env->up) ;
+ for (auto l = var.level; l; --l, env = env->up) ;
if (!var.fromWith) return env->values[var.displ];
@@ -1060,7 +1060,7 @@ void ExprAttrs::eval(EvalState & state, Env & env, Value & v)
/* The recursive attributes are evaluated in the new
environment, while the inherited attributes are evaluated
in the original environment. */
- size_t displ = 0;
+ Displacement displ = 0;
for (auto & i : attrs) {
Value * vAttr;
if (hasOverrides && !i.second.inherited) {
@@ -1136,7 +1136,7 @@ void ExprLet::eval(EvalState & state, Env & env, Value & v)
/* The recursive attributes are evaluated in the new environment,
while the inherited attributes are evaluated in the original
environment. */
- size_t displ = 0;
+ Displacement displ = 0;
for (auto & i : attrs->attrs)
env2.values[displ++] = i.second.e->maybeThunk(state, i.second.inherited ? env : env2);
@@ -1283,7 +1283,7 @@ void EvalState::callFunction(Value & fun, size_t nrArgs, Value * * args, Value &
Env & env2(allocEnv(size));
env2.up = vCur.lambda.env;
- size_t displ = 0;
+ Displacement displ = 0;
if (!lambda.hasFormals())
env2.values[displ++] = args[0];