Don't use NULL

This commit is contained in:
Eelco Dolstra 2013-07-31 12:11:14 +02:00
parent e068f49f7d
commit 8ae6d55db1

View file

@ -310,9 +310,8 @@ inline Value * EvalState::lookupVar(Env * env, const VarRef & var, bool noEval)
if (var.fromWith) { if (var.fromWith) {
while (1) { while (1) {
if (env->values[0] == NULL) { if (!env->values[0]) {
if (noEval) if (noEval) return 0;
return NULL;
env->values[0] = allocValue(); env->values[0] = allocValue();
evalAttrs(*env->up, env->withAttrs, *env->values[0]); evalAttrs(*env->up, env->withAttrs, *env->values[0]);
} }
@ -830,7 +829,6 @@ void ExprWith::eval(EvalState & state, Env & env, Value & v)
Env & env2(state.allocEnv(1)); Env & env2(state.allocEnv(1));
env2.up = &env; env2.up = &env;
env2.prevWith = prevWith; env2.prevWith = prevWith;
env2.withAttrs = attrs; env2.withAttrs = attrs;
body->eval(state, env2, v); body->eval(state, env2, v);