From 5c16082773d2589c69fe4d7920e56fa66a96fc2b Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 16 Jul 2012 22:23:00 +0300 Subject: [PATCH] Rename create_targets to prepare_build and make it return bool --- source/builder.cpp | 10 +++++----- source/builder.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source/builder.cpp b/source/builder.cpp index c86c5da..122e1b9 100644 --- a/source/builder.cpp +++ b/source/builder.cpp @@ -274,7 +274,7 @@ int Builder::main() if(conf_only) return 0; - if(create_targets()) + if(!prepare_build()) return 1; logger.log("environment", format("Building on %s, for %s%s", native_arch.get_name(), @@ -395,7 +395,7 @@ int Builder::load_build_file(const FS::Path &fn) return 0; } -int Builder::create_targets() +bool Builder::prepare_build() { Target *world = new VirtualTarget(*this, "world"); @@ -422,7 +422,7 @@ int Builder::create_targets() if(!tgt) { IO::print("I don't know anything about %s\n", *i); - return -1; + return false; } cmdline->add_depend(*tgt); @@ -437,7 +437,7 @@ int Builder::create_targets() if(!tgt) { IO::print(IO::cerr, "Unknown what-if target %s\n", *i); - return -1; + return false; } tgt->touch(); } @@ -456,7 +456,7 @@ int Builder::create_targets() i->second->save_caches(); } - return 0; + return true; } int Builder::do_build() diff --git a/source/builder.h b/source/builder.h index 943c851..9f792f8 100644 --- a/source/builder.h +++ b/source/builder.h @@ -128,10 +128,10 @@ public: int load_build_file(const Msp::FS::Path &); private: - /** Creates targets for all packages and prepares them for building. - Returns 0 if everything went ok, -1 if something bad happened and a build - shouldn't be attempted. */ - int create_targets(); + /** Prepares packages and targets for building. Returns true if everything + went ok, or false if something bad happened and a build shouldn't be + attempted. */ + bool prepare_build(); /** Supervises the build process, starting new actions when slots become available. */ -- 2.43.0