Warning was reported by GCC 7 only:
cmdlib.cpp:550:13: warning: ‘info.stat::st_mode’ may be used uninitialized in this function [-Wmaybe-uninitialized]
b_game.cpp:537:27: warning: more '%' conversions than data arguments [-Wformat]
g_game.cpp:2982:40: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'long' [-Wsign-compare]
These functions are: DCanvas::DrawTextCommon, V_BreakLines and FFont::StringWidth.
This will allow strings from UTF-8 encoded assets to display properly, but also handle the OpenAL device name on international systems, as this will be returned as an UTF-8 string.
Due to backwards compatibility needs the decoding function is rather lax to allow both UTF-8 and ISO 8859-1 to pass through correctly - and this also implies that it will allow mixed encodings which may happen if strings from different sources get concatenated.
* do not use the global temp directory. Instead create one in the AppData folder.
* removed lots of unneeded code from tmpfileplus.
* use C++ strings in there.
This should not interfere with the global one which can be explicitly seeded.
It also seems a bit pointless to constantly re-seed the RNG for something this inconsequential.
Since this is a non-standard function it's better kept to as few places as possible, so now DirEntryExists returns an additional flag to say what type an entry is and is being used nearly everywhere where stat was used, excluding a few low level parts in the POSIX code.
- let FScanner::OpenFile return an error instead of throwing an exception. The exception was never used anyway aside from being caught right away to be ignored.
This is for an eventual implementation of UTF-8 handling. On Windows this will require replacement of fopen with _wfopen so let's try to keep the number of fopen calls low.
d_net.cpp:2874:25: warning: format specifies type 'int' but the argument has type 'unsigned long long' [-Wformat]
gl/utility/gl_clock.cpp:240:38: warning: format specifies type 'int' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
v_video.cpp:883:71: warning: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
v_video.cpp:883:80: warning: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]