Skip to content

Commit

Permalink
Avoid GCC warnings about empty loops.
Browse files Browse the repository at this point in the history
This construct leads to warnings: for (...);
Do this instead:                  for (...) { /*Empty. */ }
  • Loading branch information
eeide committed Aug 13, 2011
1 parent 60de822 commit 91faaa7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/FactPointTo.cpp
Expand Up @@ -283,7 +283,9 @@ FactPointTo::abstract_fact_for_assign(const std::vector<const Fact*>& facts, con
for (size_t i=0; i<lvars.size(); i++) {
const Variable* v = lvars[i];
if (v->is_inside_union_field()) {
for (; v && v->type->eType != eUnion; v = v->field_var_of);
for (; v && v->type->eType != eUnion; v = v->field_var_of) {
/* Empty. */
}
assert(v && v->type->eType == eUnion);
}
vector<const Variable*> pointers;
Expand Down
4 changes: 3 additions & 1 deletion src/FactUnion.cpp
Expand Up @@ -178,7 +178,9 @@ bool
FactUnion::is_nonreadable_field(const Variable *v, const std::vector<const Fact*>& facts)
{
if (v->is_inside_union_field()) {
for (; v && !v->is_union_field(); v = v->field_var_of);
for (; v && !v->is_union_field(); v = v->field_var_of) {
/* Empty */
}
assert(v->is_union_field());
FactUnion tmp(v->field_var_of, v->get_field_id());
const FactUnion* fu = dynamic_cast<const FactUnion*>(find_related_fact(facts, &tmp));
Expand Down
4 changes: 3 additions & 1 deletion src/Variable.cpp
Expand Up @@ -299,7 +299,9 @@ const Variable*
Variable::get_top_container(void) const
{
const Variable* v = this;
for (; v && v->field_var_of; v = v->field_var_of);
for (; v && v->field_var_of; v = v->field_var_of) {
/* Empty */
}
return v;
}

Expand Down

0 comments on commit 91faaa7

Please sign in to comment.