Fix clang warning.
authorThiago Farina <tfarina@chromium.org>
Tue, 27 Nov 2012 17:59:08 +0000 (15:59 -0200)
committerThiago Farina <tfarina@chromium.org>
Tue, 27 Nov 2012 18:01:31 +0000 (16:01 -0200)
The return type of CollectTarget() is Node, so we should return NULL in the
failure case instead of false.

src/ninja.cc:188:16: warning: initialization of pointer of type 'Node *' to null from a constant boolean expression [-Wbool-conversion]
        return false;
               ^~~~~

Signed-off-by: Thiago Farina <tfarina@chromium.org>
src/ninja.cc

index 560e7d41d7ea9718eaf33f86c2ad80227ef0638b..38f1d78ebf65044860c4f07adaa09b905abb4d19 100644 (file)
@@ -185,7 +185,7 @@ Node* CollectTarget(State* state, const char* cpath, string* err) {
     if (first_dependent) {
       if (node->out_edges().empty()) {
         *err = "'" + path + "' has no out edge";
-        return false;
+        return NULL;
       }
       Edge* edge = node->out_edges()[0];
       if (edge->outputs_.empty()) {