hecl/hecl: Remove pointer casts from GetTmpDir()

We can just make the pointers point to const data, eliminating the need
to cast away const.
This commit is contained in:
Lioncash 2019-08-24 16:04:28 -04:00
parent 40b2e3edde
commit e5a0d657b3
1 changed files with 5 additions and 5 deletions

View File

@ -690,16 +690,16 @@ int RecursiveMakeDir(const SystemChar* dir) {
const SystemChar* GetTmpDir() {
#ifdef _WIN32
#if WINDOWS_STORE
wchar_t* TMPDIR = nullptr;
const wchar_t* TMPDIR = nullptr;
#else
wchar_t* TMPDIR = _wgetenv(L"TEMP");
const wchar_t* TMPDIR = _wgetenv(L"TEMP");
if (!TMPDIR)
TMPDIR = (wchar_t*)L"\\Temp";
TMPDIR = L"\\Temp";
#endif
#else
char* TMPDIR = getenv("TMPDIR");
const char* TMPDIR = getenv("TMPDIR");
if (!TMPDIR)
TMPDIR = (char*)"/tmp";
TMPDIR = "/tmp";
#endif
return TMPDIR;
}