(When I switch Platform from x64 to x86, VS2017)
I have this simple ReadTextFile(full_path) function:
std::wstring CEngine::load_text_file(std::wstring &full_path)
{
std::wstring buffer = m_text_file_cache[full_path];
if (buffer.empty()) // Load file:
{
std::wifstream wif(full_path);
wif.seekg(0, std::ios::end);
buffer.resize(wif.tellg()); // On Debug/Release x86: Warning C4244: 'argument': conversion from 'std::streamoff' to 'const unsigned int', possible loss of data
wif.seekg(0);
wif.read(buffer.data() , buffer.size()); // On Debug/Release x86: Error C2664: 'std::basic_istream<wchar_t,std::char_traits<wchar_t>> &std::basic_istream<wchar_t,std::char_traits<wchar_t>>::read(_Elem *,std::streamsize)': cannot convert argument 1 from 'const wchar_t *' to 'wchar_t *'
m_text_file_cache[full_path] = buffer;
}
return buffer;
}
m_text_file_cache
is just a std::map cache to reduce disk I/O. Ignore it.
When I compile to x64 (main track) there are no issues, but when I compile to x86 (for curiosity) there are 2 issues that I marked with comments in the code: Warning C4244 & Error C2664.