Page MenuHomeWildfire Games

[CChart] Add a percentage format
ClosedPublic

Authored by Imarok on May 12 2019, 1:34 AM.

Details

Summary

Adds a new format so that axis values can have a percentage sign.

Test Plan

Agree

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 7446
Build 12119: Vulcan BuildJenkins
Build 12118: arc lint + arc unit

Event Timeline

Imarok created this revision.May 12 2019, 1:34 AM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/gui/CChart.cpp
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1373/display/redirect

Stan added a subscriber: Stan.May 12 2019, 1:37 AM
Stan added inline comments.
source/gui/CChart.cpp
286

Why 64 ? :)
Could it be contained in a smaller type like u8 ?

Imarok added inline comments.May 12 2019, 1:38 AM
source/gui/CChart.cpp
286

I just assumed vlad did a sane decision ;P

Imarok updated this revision to Diff 7981.May 12 2019, 1:39 AM

Make the License Bear happy ;)

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/differential/1374/display/redirect

bb accepted this revision.May 13 2019, 9:00 PM
bb added a subscriber: bb.

looks like all summary percentages have a symbol now

This revision is now accepted and ready to land.May 13 2019, 9:00 PM

The patch looks good for me.

source/gui/CChart.cpp
285

As far as I remember it was 64 because float fits into it with enough space (it costs 40+ bytes with a maximum number) and it's aligned by 4, though it doesn't have any advantage in comparison with 48.

286

Are you aware that static_cast<int>(99.999) is 99 and not 100?

Imarok updated this revision to Diff 8020.May 13 2019, 11:01 PM

Rounding for INTEGER and PERCENTAGE. Seems saner to me.

This revision was landed with ongoing or failed builds.May 13 2019, 11:23 PM
This revision was automatically updated to reflect the committed changes.

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/differential/1401/display/redirect