Currently timer_DisplayClientTotals() only works a single time as it modifies some globals, this allows it to be called multiple times.
Details
Details
Verify that calling timer_DisplayClientTotals() multiple times does indeed work.
Diff Detail
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Checking XML files...
http://jw:8080/job/phabricator/1889/ for more details.
source/lib/timer.cpp | ||
---|---|---|
192 ↗ | (On Diff #3209) | Why was this removed? It looks like an additional check. Also if you removed the decreasing, this line is invalid: ENSURE(numClients != 0); Because numClients isn't changed in the function. |
Comment Actions
The check is unneeded, as the list is only modified in timer_AddClient. (and both clients / numClients are static, so will be zero-initialized).
Comment Actions
(Don't forget to assess correctness, completeness and improveability before a commit)
source/lib/timer.cpp | ||
---|---|---|
1 ↗ | (On Diff #5487) | 8 |
Comment Actions
According to the comment V it seems that the function had the wrong behaviour.
/** * display all clients' totals; does not reset them. * typically called at exit. **/ LIB_API void timer_DisplayClientTotals();
source/lib/timer.cpp | ||
---|---|---|
187 ↗ | (On Diff #5487) | for (TimerClient* tc = clients; tc; tc = tc->next) { // ... } |
source/lib/timer.cpp | ||
---|---|---|
1 ↗ | (On Diff #5487) | 9 |