about summary refs log tree commit diff
path: root/src/libexpr
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-08-04T17·07+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-08-04T17·07+0000
commit1854f84e830a5282ae1ad1d0c85ed641af6bcf33 (patch)
treea28dae68b698b6c2ebcf9d56937b26e108010b9c /src/libexpr
parentdcff8cdb76b37da8978fecee3398d3b541d11ccb (diff)
* Fix a few warnings.
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/eval.cc2
-rw-r--r--src/libexpr/nixexpr.cc4
-rw-r--r--src/libexpr/nixexpr.hh2
-rw-r--r--src/libexpr/parser.cc2
4 files changed, 5 insertions, 5 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 834b15cbdf76..ce38e2ab9213 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -87,7 +87,7 @@ static Expr substArgs(EvalState & state,
            arguments.  Find out which. */
         for (ATermIterator i(formals); i; ++i) {
             Expr name; ATerm d1, d2;
-            matchFormal(*i, name, d1, d2);
+            if (!matchFormal(*i, name, d1, d2)) abort();
             subs.remove(name);
         }
         throw TypeError(format("the function does not expect an argument named `%1%'")
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc
index 06ca8c928ea3..fac2c0e5c0b7 100644
--- a/src/libexpr/nixexpr.cc
+++ b/src/libexpr/nixexpr.cc
@@ -130,7 +130,7 @@ Expr substitute(const Substitution & subs, Expr e)
     /* In case of a function, filter out all variables bound by this
        function. */
     ATermList formals;
-    ATerm body, def;
+    ATerm body;
     if (matchFunction(e, formals, body, pos)) {
         ATermMap map(ATgetLength(formals));
         for (ATermIterator i(formals); i; ++i) {
@@ -227,7 +227,7 @@ static void checkVarDefs2(set<Expr> & done, const ATermMap & defs, Expr e)
         for (ATermIterator i(formals); i; ++i) {
             ATerm valids, deflt;
             set<Expr> done2;
-            matchFormal(*i, name, valids, deflt);
+            if (!matchFormal(*i, name, valids, deflt)) abort();
             checkVarDefs2(done, defs, valids);
             checkVarDefs2(done2, defs2, deflt);
         }
diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh
index 3fd22ecfed57..28ac35e604ec 100644
--- a/src/libexpr/nixexpr.hh
+++ b/src/libexpr/nixexpr.hh
@@ -50,7 +50,7 @@ struct Substitution
     {
         Expr x;
         for (const Substitution * s(this); s; s = s->prev)
-            if (x = s->map->get(name)) return x;
+            if ((x = s->map->get(name))) return x;
         return 0;
     }
 };
diff --git a/src/libexpr/parser.cc b/src/libexpr/parser.cc
index 7adbcb618e8c..9b3e9041dfc1 100644
--- a/src/libexpr/parser.cc
+++ b/src/libexpr/parser.cc
@@ -75,7 +75,7 @@ Expr unescapeStr(const char * s)
 {
     string t;
     char c;
-    while (c = *s++) {
+    while ((c = *s++)) {
         if (c == '\\') {
             assert(*s);
             c = *s++;