mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 12:05:50 +00:00
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
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user