aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rw-r--r--build/algorithm.cxx2
-rw-r--r--build/algorithm.txx2
-rw-r--r--build/context.cxx4
-rw-r--r--build/cxx/rule.cxx6
-rw-r--r--build/lexer.cxx6
-rw-r--r--build/parser.cxx15
-rw-r--r--build/process.cxx2
7 files changed, 19 insertions, 18 deletions
diff --git a/build/algorithm.cxx b/build/algorithm.cxx
index 16bc1bc..4c3ae08 100644
--- a/build/algorithm.cxx
+++ b/build/algorithm.cxx
@@ -213,7 +213,7 @@ namespace build
// the prerequisite was updated in this run which means the
// target must be out of date.
//
- if (mt < mp || mt == mp && ts == target_state::updated)
+ if (mt < mp || (mt == mp && ts == target_state::updated))
u = true;
}
else
diff --git a/build/algorithm.txx b/build/algorithm.txx
index 9086bfe..20817d2 100644
--- a/build/algorithm.txx
+++ b/build/algorithm.txx
@@ -37,7 +37,7 @@ namespace build
// the prerequisite was updated in this run which means the
// target must be out of date.
//
- if (mt < mp || mt == mp && ts == target_state::updated)
+ if (mt < mp || (mt == mp && ts == target_state::updated))
u = true;
}
else
diff --git a/build/context.cxx b/build/context.cxx
index 79753ec..f7c9650 100644
--- a/build/context.cxx
+++ b/build/context.cxx
@@ -43,8 +43,8 @@ namespace build
// If work is a sub-path of {src,out}_root and this path is also a
// sub-bath of it, then use '..' to form a relative path.
//
- if (work.sub (src_root) && p.sub (src_root) ||
- work.sub (out_root) && p.sub (out_root)) // @@ cache
+ if ((work.sub (src_root) && p.sub (src_root)) ||
+ (work.sub (out_root) && p.sub (out_root))) // @@ cache
return p.relative (work);
return p;
diff --git a/build/cxx/rule.cxx b/build/cxx/rule.cxx
index 94433b9..eb61bd1 100644
--- a/build/cxx/rule.cxx
+++ b/build/cxx/rule.cxx
@@ -451,9 +451,9 @@ namespace build
// Ignore some known target types (headers).
//
if (p.type.id == typeid (h) ||
- cp.type.id == typeid (cxx) && (p.type.id == typeid (hxx) ||
- p.type.id == typeid (ixx) ||
- p.type.id == typeid (txx)))
+ (cp.type.id == typeid (cxx) && (p.type.id == typeid (hxx) ||
+ p.type.id == typeid (ixx) ||
+ p.type.id == typeid (txx))))
continue;
if (p.type.id == typeid (cxx))
diff --git a/build/lexer.cxx b/build/lexer.cxx
index c2f98f2..2870620 100644
--- a/build/lexer.cxx
+++ b/build/lexer.cxx
@@ -62,10 +62,10 @@ namespace build
{
xchar c (get ());
- if (!is_eos (c))
- return c;
+ if (is_eos (c))
+ fail (c) << "unterminated escape sequence";
- fail (c) << "unterminated escape sequence";
+ return c;
}
void lexer::
diff --git a/build/parser.cxx b/build/parser.cxx
index 16be5da..d887d5f 100644
--- a/build/parser.cxx
+++ b/build/parser.cxx
@@ -748,13 +748,14 @@ namespace build
{
switch (t.type ())
{
- case token_type::eos: os << "<end-of-stream>"; break;
- case token_type::newline: os << "<newline>"; break;
- case token_type::colon: os << ":"; break;
- case token_type::lcbrace: os << "{"; break;
- case token_type::rcbrace: os << "}"; break;
- case token_type::equal: os << "="; break;
- case token_type::name: os << t.name (); break;
+ case token_type::eos: os << "<end-of-stream>"; break;
+ case token_type::newline: os << "<newline>"; break;
+ case token_type::colon: os << ":"; break;
+ case token_type::lcbrace: os << "{"; break;
+ case token_type::rcbrace: os << "}"; break;
+ case token_type::equal: os << "="; break;
+ case token_type::plus_equal: os << "+="; break;
+ case token_type::name: os << t.name (); break;
}
return os;
diff --git a/build/process.cxx b/build/process.cxx
index 09b8d36..f561000 100644
--- a/build/process.cxx
+++ b/build/process.cxx
@@ -79,7 +79,7 @@ namespace build
{
// Parent. Close the other ends of the pipes.
//
- if ((in && close (out_fd[0])) == -1 ||
+ if ((in && close (out_fd[0]) == -1) ||
(err && close (in_efd[1]) == -1) ||
(out && close (in_ofd[1]) == -1))
throw process_error (errno, false);