1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-02 13:31:48 +02:00

Remove non-method mk<X> functions

This commit is contained in:
Eelco Dolstra 2022-01-04 18:40:39 +01:00
parent cc08364315
commit 263a8d293c
9 changed files with 99 additions and 121 deletions

View file

@ -17,7 +17,7 @@ static void prim_hasContext(EvalState & state, const Pos & pos, Value * * args,
{
PathSet context;
state.forceString(*args[0], context, pos);
mkBool(v, !context.empty());
v.mkBool(!context.empty());
}
static RegisterPrimOp primop_hasContext("__hasContext", 1, prim_hasContext);
@ -109,9 +109,9 @@ static void prim_getContext(EvalState & state, const Pos & pos, Value * * args,
for (const auto & info : contextInfos) {
auto infoAttrs = state.buildBindings(3);
if (info.second.path)
mkBool(infoAttrs.alloc(sPath), true);
infoAttrs.alloc(sPath).mkBool(true);
if (info.second.allOutputs)
mkBool(infoAttrs.alloc(sAllOutputs), true);
infoAttrs.alloc(sAllOutputs).mkBool(true);
if (!info.second.outputs.empty()) {
auto & outputsVal = infoAttrs.alloc(state.sOutputs);
state.mkList(outputsVal, info.second.outputs.size());

View file

@ -43,13 +43,13 @@ static void prim_fromTOML(EvalState & state, const Pos & pos, Value * * args, Va
}
break;;
case toml::value_t::boolean:
mkBool(v, toml::get<bool>(t));
v.mkBool(toml::get<bool>(t));
break;;
case toml::value_t::integer:
mkInt(v, toml::get<int64_t>(t));
v.mkInt(toml::get<int64_t>(t));
break;;
case toml::value_t::floating:
mkFloat(v, toml::get<NixFloat>(t));
v.mkFloat(toml::get<NixFloat>(t));
break;;
case toml::value_t::string:
v.mkString(toml::get<std::string>(t));
@ -62,7 +62,7 @@ static void prim_fromTOML(EvalState & state, const Pos & pos, Value * * args, Va
throw std::runtime_error("Dates and times are not supported");
break;;
case toml::value_t::empty:
mkNull(v);
v.mkNull();
break;;
}