Changeset - r24433:05e89d8e369b
[Not reviewed]
master
0 2 0
frosch - 3 years ago 2020-12-14 21:25:07
frosch@openttd.org
Codechange: Apple LLVM fails to implement std::optional::value() also on pretty recent version. Use operator* instead.
2 files changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/base_media_func.h
Show inline comments
 
@@ -52,21 +52,21 @@ bool BaseSet<T, Tnum_files, Tsearch_in_t
 
		if (item->name.compare(0, 12, "description.") != 0) continue;
 

	
 
		this->description[item->name.substr(12)] = item->value.value_or("");
 
	}
 

	
 
	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");
 
	IniGroup *md5s   = ini->GetGroup("md5s");
 
	IniGroup *origin = ini->GetGroup("origin");
 
	for (uint i = 0; i < Tnum_files; i++) {
src/gfxinit.cpp
Show inline comments
 
@@ -354,17 +354,17 @@ bool GraphicsSet::FillSetDetails(IniFile
 
	bool ret = this->BaseSet<GraphicsSet, MAX_GFT, true>::FillSetDetails(ini, path, full_filename, false);
 
	if (ret) {
 
		IniGroup *metadata = ini->GetGroup("metadata");
 
		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;
 
}
 

	
 
/**
 
 * Calculate and check the MD5 hash of the supplied GRF.
0 comments (0 inline, 0 general)