aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/ninja/Ninja.hpp4
-rw-r--r--src/Ninja.cpp8
2 files changed, 7 insertions, 5 deletions
diff --git a/include/ninja/Ninja.hpp b/include/ninja/Ninja.hpp
index 095c959..1a5695d 100644
--- a/include/ninja/Ninja.hpp
+++ b/include/ninja/Ninja.hpp
@@ -89,12 +89,12 @@ namespace ninja
struct NinjaBuild
{
- const NinjaRule *rule;
+ const NinjaRule *rule = nullptr;
const std::vector<std::string> in;
const std::string out;
const std::vector<ninja::NinjaArgValue> additionalArgs;
const std::vector<NinjaBuild*> dependsOnBuilds;
- bool alwaysRun;
+ bool alwaysRun = false;
};
// Functions throw NinjaException on failure
diff --git a/src/Ninja.cpp b/src/Ninja.cpp
index 3b3356b..00d740d 100644
--- a/src/Ninja.cpp
+++ b/src/Ninja.cpp
@@ -47,6 +47,8 @@ namespace ninja
switch(argType)
{
+ case NinjaArg::Type::NONE:
+ break;
case NinjaArg::Type::VALUE:
{
result += escape_arg(arg.arg);
@@ -93,7 +95,7 @@ namespace ninja
if(!isAlpha(name[0]) && name[0] != '_')
return false;
- for(int i = 1; i < name.size(); ++i)
+ for(size_t i = 1; i < name.size(); ++i)
{
if(!isAlnum(name[i]) && name[i] != '_')
return false;
@@ -142,9 +144,9 @@ namespace ninja
}
NinjaRule::NinjaRule(NinjaBuildFile *_buildFile, const std::string &_name, const std::string &_command) :
- buildFile(_buildFile),
name(_name),
- command(_command)
+ command(_command),
+ buildFile(_buildFile)
{
assert(buildFile);
}