* Cleanup.

This commit is contained in:
Eelco Dolstra 2007-01-13 14:21:49 +00:00
parent 1b7840b949
commit 11158028be
6 changed files with 16 additions and 16 deletions

View File

@ -46,7 +46,7 @@ Expr findAlongAttrPath(EvalState & state, const string & attrPath,
if (apType == apAttr) {
ATermMap attrs(128);
ATermMap attrs;
if (!isAttrs(state, e, attrs))
throw TypeError(

View File

@ -37,7 +37,7 @@ static Expr substArgs(EvalState & state,
ATermMap subs(nrFormals);
/* Get the actual arguments and put them in the substitution. */
ATermMap args(128); /* !!! fix */
ATermMap args;
queryAllAttrs(arg, args);
for (ATermMap::const_iterator i = args.begin(); i != args.end(); ++i)
subs.set(i->key, i->value);
@ -151,7 +151,7 @@ static Expr updateAttrs(Expr e1, Expr e2)
{
/* Note: e1 and e2 should be in normal form. */
ATermMap attrs(128); /* !!! */
ATermMap attrs;
queryAllAttrs(e1, attrs, true);
queryAllAttrs(e2, attrs, true);
@ -343,7 +343,7 @@ Expr autoCallFunction(Expr e, const ATermMap & args)
ATerm body, pos;
if (matchFunction(e, formals, body, pos)) {
ATermMap actualArgs(128);
ATermMap actualArgs(ATgetLength(formals));
for (ATermIterator i(formals); i; ++i) {
Expr name, def, value; ATerm values, def2;
@ -496,7 +496,7 @@ Expr evalExpr2(EvalState & state, Expr e)
/* Withs. */
if (matchWith(e, e1, e2, pos)) {
ATermMap attrs(128); /* !!! */
ATermMap attrs;
try {
e1 = evalExpr(state, e1);
queryAllAttrs(e1, attrs);
@ -550,7 +550,7 @@ Expr evalExpr2(EvalState & state, Expr e)
/* Attribute existence test (?). */
if (matchOpHasAttr(e, e1, name)) {
ATermMap attrs(128); /* !!! */
ATermMap attrs;
queryAllAttrs(evalExpr(state, e1), attrs);
return makeBool(attrs.get(name) != 0);
}
@ -576,7 +576,7 @@ Expr evalExpr2(EvalState & state, Expr e)
if (matchAttrs(e1, as) && matchPath(e2, p)) {
static bool haveWarned = false;
warnOnce(haveWarned, format(
"concatenation of a derivation and a path is deprecated, "
"concatenation of a derivation and a path is deprecated; "
"you should write `drv + \"%1%\"' instead of `drv + %1%'")
% aterm2String(p));
PathSet context;

View File

@ -44,7 +44,7 @@ static void printTermAsXML(Expr e, XMLWriter & doc, PathSet & context)
else if (matchAttrs(e, as)) {
XMLOpenElement _(doc, "attrs");
ATermMap attrs(128);
ATermMap attrs;
queryAllAttrs(e, attrs);
StringSet names;
for (ATermMap::const_iterator i = attrs.begin(); i != attrs.end(); ++i)

View File

@ -43,7 +43,7 @@ MetaInfo DrvInfo::queryMetaInfo(EvalState & state) const
Expr a = attrs->get(toATerm("meta"));
if (!a) return meta; /* fine, empty meta information */
ATermMap attrs2(16); /* !!! */
ATermMap attrs2;
queryAllAttrs(evalExpr(state, a), attrs2);
for (ATermMap::const_iterator i = attrs2.begin(); i != attrs2.end(); ++i) {
@ -81,7 +81,7 @@ static bool getDerivation(EvalState & state, Expr e,
e = evalExpr(state, e);
if (!matchAttrs(e, es)) return true;
boost::shared_ptr<ATermMap> attrs(new ATermMap(32)); /* !!! */
boost::shared_ptr<ATermMap> attrs(new ATermMap());
queryAllAttrs(e, *attrs, false);
Expr a = attrs->get(toATerm("type"));

View File

@ -21,7 +21,7 @@ static Expr primBuiltins(EvalState & state, const ATermVector & args)
calling a primop `foo' directly, they could say `if builtins ?
foo then builtins.foo ... else ...'. */
ATermMap builtins(128);
ATermMap builtins(state.primOps.size());
for (ATermMap::const_iterator i = state.primOps.begin();
i != state.primOps.end(); ++i)
@ -133,7 +133,7 @@ static Expr primDerivationStrict(EvalState & state, const ATermVector & args)
{
startNest(nest, lvlVomit, "evaluating derivation");
ATermMap attrs(128); /* !!! */
ATermMap attrs;
queryAllAttrs(evalExpr(state, args[0]), attrs, true);
/* Figure out the name already (for stack backtraces). */
@ -303,7 +303,7 @@ static Expr primDerivationStrict(EvalState & state, const ATermVector & args)
static Expr primDerivationLazy(EvalState & state, const ATermVector & args)
{
Expr eAttrs = evalExpr(state, args[0]);
ATermMap attrs(128); /* !!! */
ATermMap attrs;
queryAllAttrs(eAttrs, attrs, true);
attrs.set(toATerm("type"),
@ -625,7 +625,7 @@ static Expr primGetEnv(EvalState & state, const ATermVector & args)
list of strings. */
static Expr primAttrNames(EvalState & state, const ATermVector & args)
{
ATermMap attrs(128); /* !!! */
ATermMap attrs;
queryAllAttrs(evalExpr(state, args[0]), attrs);
StringSet names;
@ -689,7 +689,7 @@ static Expr primHasAttr(EvalState & state, const ATermVector & args)
static Expr primRemoveAttrs(EvalState & state, const ATermVector & args)
{
ATermMap attrs(128); /* !!! */
ATermMap attrs;
queryAllAttrs(evalExpr(state, args[0]), attrs, true);
ATermList list = evalList(state, args[1]);

View File

@ -40,7 +40,7 @@ public:
/* Create a map. `expectedCount' is the number of elements the
map is expected to hold. */
ATermMap(unsigned int expectedCount);
ATermMap(unsigned int expectedCount = 16);
ATermMap(const ATermMap & map);