fix(registry): squash some warnings, try to get it to compile on mac

This commit is contained in:
phaneron 2025-03-31 16:04:36 -04:00
parent fde8ed8c0f
commit 191be1b111
3 changed files with 7 additions and 12 deletions

View file

@ -18,7 +18,7 @@ bool GetDefaultsAndKeyPath(const char* key, const char* name, uint32_t flags, NS
STORM_ASSERT(key); STORM_ASSERT(key);
STORM_ASSERT(*key); STORM_ASSERT(*key);
id nextcomponent = NextComponent(key, path, size); auto nextcomponent = NextComponent(key, path, size);
id prefix = @"com.blizzard"; id prefix = @"com.blizzard";
if ((flags & STORM_REGISTRY_BATTLENET)) { if ((flags & STORM_REGISTRY_BATTLENET)) {
@ -31,7 +31,7 @@ bool GetDefaultsAndKeyPath(const char* key, const char* name, uint32_t flags, NS
domain = prefix; domain = prefix;
} }
id sregstatic = SRegStatic::Get(); auto sregstatic = SRegStatic::Get();
id hive = sregstatic->hives[domain]; id hive = sregstatic->hives[domain];
*defaults = hive; *defaults = hive;
@ -62,7 +62,7 @@ bool GetDefaultsAndKeyPath(const char* key, const char* name, uint32_t flags, NS
STORM_VALIDATE(length < size); STORM_VALIDATE(length < size);
STORM_VALIDATE_END; STORM_VALIDATE_END;
for (id sep = path; ; *sep = '/') { for (auto sep = path; ; *sep = '/') {
sep = SStrChr(sep, '\\'); sep = SStrChr(sep, '\\');
if (!sep) { if (!sep) {
break; break;
@ -72,7 +72,7 @@ bool GetDefaultsAndKeyPath(const char* key, const char* name, uint32_t flags, NS
return false; return false;
} }
NSObject* GetObject(const char* keyname, const char* valuename, uint32_t flags) { id GetObject(const char* keyname, const char* valuename, uint32_t flags) {
NSUserDefaults* defaults; NSUserDefaults* defaults;
char path[STORM_MAX_PATH]; char path[STORM_MAX_PATH];
if (!GetDefaultsAndKeyPath(keyname, valuename, flags, &defaults, path, STORM_MAX_PATH)) { if (!GetDefaultsAndKeyPath(keyname, valuename, flags, &defaults, path, STORM_MAX_PATH)) {

View file

@ -9,13 +9,8 @@ public:
static SRegStatic Get(); static SRegStatic Get();
SRegStatic() { SRegStatic();
this->hives = [NSMutableDictionary init]; ~SRegStatic();
}
~SRegStatic() {
this->hives = nil;
}
}; };
#endif #endif

View file

@ -1,6 +1,6 @@
#include "storm/registry/mac/Static.hpp" #include "storm/registry/mac/Static.hpp"
static SRegStatic* SRegStatic::Get() { SRegStatic* SRegStatic::Get() {
static SRegStatic sregstatic; static SRegStatic sregstatic;
return &sregstatic; return &sregstatic;
} }