2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-06-16 15:53:29 +00:00

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

View File

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