code review changes

This commit is contained in:
Madthijs
2021-05-14 21:40:56 +02:00
parent 0a9b5ded9b
commit bd61b23bde
11 changed files with 17 additions and 45 deletions

View File

@@ -20,7 +20,7 @@ void GpLogDriver_X::Init()
void GpLogDriver_X::VPrintf(Category category, const char *fmt, va_list args)
{
size_t fmtSize = 0;
size_t fmtSize = 0;
bool hasFormatting = false;
for (const char *fmtCheck = fmt; *fmtCheck; fmtCheck++)
{
@@ -64,9 +64,9 @@ void GpLogDriver_X::VPrintf(Category category, const char *fmt, va_list args)
}
else
{
//a copy is needed if using va_list multiple times (otherwise unexpected output)
va_list args_copy;
va_copy(args_copy, args);
//a copy is needed if using va_list multiple times (otherwise unexpected output)
va_list args_copy;
va_copy(args_copy, args);
int formattedSize = vsnprintf(nullptr, 0, fmt, args);
if (formattedSize <= 0)
@@ -77,7 +77,7 @@ void GpLogDriver_X::VPrintf(Category category, const char *fmt, va_list args)
return;
vsnprintf(charBuff, formattedSize + 1, fmt, args_copy);
va_end(args_copy);
va_end(args_copy);
if (m_stream)
m_stream->Write(charBuff, formattedSize);

View File

@@ -58,7 +58,7 @@ SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[])
drivers->SetDriver<GpDriverIDs::kFileSystem>(GpFileSystem_X::GetInstance());
drivers->SetDriver<GpDriverIDs::kSystemServices>(GpSystemServices_X::GetInstance());
drivers->SetDriver<GpDriverIDs::kLog>(GpLogDriver_X::GetInstance());
drivers->SetDriver<GpDriverIDs::kAlloc>(GpAllocator_C::GetInstance());
drivers->SetDriver<GpDriverIDs::kAlloc>(GpAllocator_C::GetInstance());
g_gpGlobalConfig.m_displayDriverType = EGpDisplayDriverType_SDL_GL2;
g_gpGlobalConfig.m_audioDriverType = EGpAudioDriverType_SDL2;
@@ -75,7 +75,7 @@ SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[])
g_gpGlobalConfig.m_osGlobals = &g_gpXGlobals;
g_gpGlobalConfig.m_logger = logger;
g_gpGlobalConfig.m_systemServices = GpSystemServices_X::GetInstance();
g_gpGlobalConfig.m_allocator = GpAllocator_C::GetInstance();
g_gpGlobalConfig.m_allocator = GpAllocator_C::GetInstance();
GpDisplayDriverFactory::RegisterDisplayDriverFactory(EGpDisplayDriverType_SDL_GL2, GpDriver_CreateDisplayDriver_SDL_GL2);
GpAudioDriverFactory::RegisterAudioDriverFactory(EGpAudioDriverType_SDL2, GpDriver_CreateAudioDriver_SDL);

View File

@@ -91,11 +91,7 @@ bool GpSystemServices_X::IsTextInputObstructive() const
}
bool GpSystemServices_X::IsFullscreenPreferred() const
{
#ifdef __MACOS__
return false;
#endif
{
return true;
}