Merge pull request #2434 from gruenich/feature/-actions-warning-upload-artifact
github actions: Update upload-artifact to version 4
diff --git a/src/build.cc b/src/build.cc
index fb29732..6587d1b 100644
--- a/src/build.cc
+++ b/src/build.cc
@@ -519,16 +519,14 @@
end = want_.end(); it != end; ++it) {
Edge* edge = it->first;
Plan::Want want = it->second;
- if (!(want == kWantToStart && edge->AllInputsReady())) {
- continue;
- }
-
- Pool* pool = edge->pool();
- if (pool->ShouldDelayEdge()) {
- pool->DelayEdge(edge);
- pools.insert(pool);
- } else {
- ScheduleWork(it);
+ if (want == kWantToStart && edge->AllInputsReady()) {
+ Pool* pool = edge->pool();
+ if (pool->ShouldDelayEdge()) {
+ pool->DelayEdge(edge);
+ pools.insert(pool);
+ } else {
+ ScheduleWork(it);
+ }
}
}
diff --git a/src/disk_interface.cc b/src/disk_interface.cc
index 5aba217..1259c61 100644
--- a/src/disk_interface.cc
+++ b/src/disk_interface.cc
@@ -161,8 +161,6 @@
RealDiskInterface::RealDiskInterface()
#ifdef _WIN32
: use_cache_(false), long_paths_enabled_(false) {
- setlocale(LC_ALL, "");
-
// Probe ntdll.dll for RtlAreLongPathsEnabled, and call it if it exists.
HINSTANCE ntdll_lib = ::GetModuleHandleW(L"ntdll");
if (ntdll_lib) {
diff --git a/src/dyndep.cc b/src/dyndep.cc
index a0d699d..112d1cb 100644
--- a/src/dyndep.cc
+++ b/src/dyndep.cc
@@ -43,9 +43,7 @@
// Update each edge that specified this node as its dyndep binding.
std::vector<Edge*> const& out_edges = node->out_edges();
- for (std::vector<Edge*>::const_iterator oe = out_edges.begin();
- oe != out_edges.end(); ++oe) {
- Edge* const edge = *oe;
+ for (Edge* edge : out_edges) {
if (edge->dyndep_ != node)
continue;
@@ -65,10 +63,9 @@
}
// Reject extra outputs in dyndep file.
- for (DyndepFile::const_iterator oe = ddf->begin(); oe != ddf->end();
- ++oe) {
- if (!oe->second.used_) {
- Edge* const edge = oe->first;
+ for (const auto& dyndep_output : *ddf) {
+ if (!dyndep_output.second.used_) {
+ Edge* const edge = dyndep_output.first;
*err = ("dyndep file '" + node->path() + "' mentions output "
"'" + edge->outputs_[0]->path() + "' whose build statement "
"does not have a dyndep binding for the file");
@@ -94,15 +91,13 @@
edge->implicit_outs_ += dyndeps->implicit_outputs_.size();
// Add this edge as incoming to each new output.
- for (std::vector<Node*>::const_iterator i =
- dyndeps->implicit_outputs_.begin();
- i != dyndeps->implicit_outputs_.end(); ++i) {
- if ((*i)->in_edge()) {
+ for (Node* node : dyndeps->implicit_outputs_) {
+ if (node->in_edge()) {
// This node already has an edge producing it.
- *err = "multiple rules generate " + (*i)->path();
+ *err = "multiple rules generate " + node->path();
return false;
}
- (*i)->set_in_edge(edge);
+ node->set_in_edge(edge);
}
// Add the dyndep-discovered inputs to the edge.
@@ -112,10 +107,8 @@
edge->implicit_deps_ += dyndeps->implicit_inputs_.size();
// Add this edge as outgoing from each new input.
- for (std::vector<Node*>::const_iterator i =
- dyndeps->implicit_inputs_.begin();
- i != dyndeps->implicit_inputs_.end(); ++i)
- (*i)->AddOutEdge(edge);
+ for (Node* node : dyndeps->implicit_inputs_)
+ node->AddOutEdge(edge);
return true;
}
diff --git a/src/dyndep_parser.cc b/src/dyndep_parser.cc
index 1b4dddd..f35f48d 100644
--- a/src/dyndep_parser.cc
+++ b/src/dyndep_parser.cc
@@ -88,7 +88,6 @@
if (major != 1 || minor != 0) {
return lexer_.Error(
string("unsupported 'ninja_dyndep_version = ") + version + "'", err);
- return false;
}
return true;
}
@@ -96,11 +95,7 @@
bool DyndepParser::ParseLet(string* key, EvalString* value, string* err) {
if (!lexer_.ReadIdent(key))
return lexer_.Error("expected variable name", err);
- if (!ExpectToken(Lexer::EQUALS, err))
- return false;
- if (!lexer_.ReadVarValue(value, err))
- return false;
- return true;
+ return (ExpectToken(Lexer::EQUALS, err) && lexer_.ReadVarValue(value, err));
}
bool DyndepParser::ParseEdge(string* err) {
@@ -200,8 +195,8 @@
}
dyndeps->implicit_inputs_.reserve(ins.size());
- for (vector<EvalString>::iterator i = ins.begin(); i != ins.end(); ++i) {
- string path = i->Evaluate(&env_);
+ for (const EvalString& in : ins) {
+ string path = in.Evaluate(&env_);
if (path.empty())
return lexer_.Error("empty path", err);
uint64_t slash_bits;
@@ -211,11 +206,10 @@
}
dyndeps->implicit_outputs_.reserve(outs.size());
- for (vector<EvalString>::iterator i = outs.begin(); i != outs.end(); ++i) {
- string path = i->Evaluate(&env_);
+ for (const EvalString& out : outs) {
+ string path = out.Evaluate(&env_);
if (path.empty())
return lexer_.Error("empty path", err);
- string path_err;
uint64_t slash_bits;
CanonicalizePath(&path, &slash_bits);
Node* n = state_->GetNode(path, slash_bits);