Changeset - r28508:c5c88f815155
[Not reviewed]
master
0 1 0
Rubidium - 11 months ago 2024-01-18 21:08:22
rubidium@openttd.org
Codechange: use TO_LE16 directly when reading language file offsets
1 file changed with 1 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/strings.cpp
Show inline comments
 
@@ -1840,17 +1840,11 @@ bool ReadLanguagePack(const LanguageMeta
 
		return false;
 
	}
 

	
 
#if TTD_ENDIAN == TTD_BIG_ENDIAN
 
	for (uint i = 0; i < TEXT_TAB_END; i++) {
 
		lang_pack->offsets[i] = ReadLE16Aligned(&lang_pack->offsets[i]);
 
	}
 
#endif /* TTD_ENDIAN == TTD_BIG_ENDIAN */
 

	
 
	std::array<uint, TEXT_TAB_END> tab_start, tab_num;
 

	
 
	uint count = 0;
 
	for (uint i = 0; i < TEXT_TAB_END; i++) {
 
		uint16_t num = lang_pack->offsets[i];
 
		uint16_t num = FROM_LE16(lang_pack->offsets[i]);
 
		if (num > TAB_SIZE) return false;
 

	
 
		tab_start[i] = count;
0 comments (0 inline, 0 general)