1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-29 09:44:52 +01:00

Fix #12402: Refactor MEASUREMENT_FORMAT to use strong enum (#12642)

* Fix #12402: Refactor MEASUREMENT_FORMAT to use strong enum

* Remove redundant default branches

Co-authored-by: Matt Thomson <matt-thomson@users.noreply.github.com>
This commit is contained in:
Matt Thomson
2020-08-13 21:51:28 +01:00
committed by GitHub
parent 5e09ecc904
commit a8f8f06e2d
12 changed files with 41 additions and 42 deletions

View File

@@ -308,23 +308,23 @@ uint8_t platform_get_locale_currency()
return platform_get_currency_value(currCode);
}
uint8_t platform_get_locale_measurement_format()
MeasurementFormat platform_get_locale_measurement_format()
{
UINT measurement_system;
if (GetLocaleInfo(
LOCALE_USER_DEFAULT, LOCALE_IMEASURE | LOCALE_RETURN_NUMBER, (LPSTR)&measurement_system, sizeof(measurement_system))
== 0)
{
return MEASUREMENT_FORMAT_METRIC;
return MeasurementFormat::Metric;
}
switch (measurement_system)
{
case 1:
return MEASUREMENT_FORMAT_IMPERIAL;
return MeasurementFormat::Imperial;
case 0:
default:
return MEASUREMENT_FORMAT_METRIC;
return MeasurementFormat::Metric;
}
}