diff options
author | frosch <frosch@openttd.org> | 2020-12-14 22:25:07 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2020-12-14 23:50:50 +0100 |
commit | cc1679e3171bf6982164c4072a773fdd687ea885 (patch) | |
tree | 8b8bc07d6721237450951bf34193e4b737a5b820 /src | |
parent | 484ea62a62d7e09ea550a40ea3ded24dcab8a6d0 (diff) | |
download | openttd-cc1679e3171bf6982164c4072a773fdd687ea885.tar.xz |
Codechange: Apple LLVM fails to implement std::optional::value() also on pretty recent version. Use operator* instead.
Diffstat (limited to 'src')
-rw-r--r-- | src/base_media_func.h | 6 | ||||
-rw-r--r-- | src/gfxinit.cpp | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/base_media_func.h b/src/base_media_func.h index 02c445c21..c5e2a6da2 100644 --- a/src/base_media_func.h +++ b/src/base_media_func.h @@ -55,15 +55,15 @@ bool BaseSet<T, Tnum_files, Tsearch_in_tars>::FillSetDetails(IniFile *ini, const } fetch_metadata("shortname"); - for (uint i = 0; item->value.value()[i] != '\0' && i < 4; i++) { - this->shortname |= ((uint8)item->value.value()[i]) << (i * 8); + for (uint i = 0; (*item->value)[i] != '\0' && i < 4; i++) { + this->shortname |= ((uint8)(*item->value)[i]) << (i * 8); } fetch_metadata("version"); this->version = atoi(item->value->c_str()); item = metadata->GetItem("fallback", false); - this->fallback = (item != nullptr && item->value && item->value.value() != "0" && item->value.value() != "false"); + this->fallback = (item != nullptr && item->value && *item->value != "0" && *item->value != "false"); /* For each of the file types we want to find the file, MD5 checksums and warning messages. */ IniGroup *files = ini->GetGroup("files"); diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp index d1d05f4bd..95c954095 100644 --- a/src/gfxinit.cpp +++ b/src/gfxinit.cpp @@ -357,11 +357,11 @@ bool GraphicsSet::FillSetDetails(IniFile *ini, const char *path, const char *ful IniItem *item; fetch_metadata("palette"); - this->palette = (item->value.value()[0] == 'D' || item->value.value()[0] == 'd') ? PAL_DOS : PAL_WINDOWS; + this->palette = ((*item->value)[0] == 'D' || (*item->value)[0] == 'd') ? PAL_DOS : PAL_WINDOWS; /* Get optional blitter information. */ item = metadata->GetItem("blitter", false); - this->blitter = (item != nullptr && item->value.value()[0] == '3') ? BLT_32BPP : BLT_8BPP; + this->blitter = (item != nullptr && (*item->value)[0] == '3') ? BLT_32BPP : BLT_8BPP; } return ret; } |