Commit 0ece0421 authored by Mark Klara's avatar Mark Klara

Silenced unused variable warnings.

When built for release, builds were failing with unused
variable warnings, since they were only used in `assert()`
calls.

I added explicit void casting to any potentially unused variables.

Change-Id: I9947ba46891fdda5aa925caa950642dedd4e009f
parent 69a31b80
......@@ -90,12 +90,15 @@ int main(int /*argc*/, const char * /*argv*/[]) {
assert(weps->Get(i)->name()->str() == expected_weapon_names[i]);
assert(weps->Get(i)->damage() == expected_weapon_damages[i]);
}
(void)expected_weapon_names;
(void)expected_weapon_damages;
// Get and test the `Equipment` union (`equipped` field).
assert(monster->equipped_type() == Equipment_Weapon);
auto equipped = static_cast<const Weapon*>(monster->equipped());
assert(equipped->name()->str() == "Axe");
assert(equipped->damage() == 5);
(void)equipped;
printf("The FlatBuffer was successfully created and verified!\n");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment