From 18dcbd710fc8e101eea64de766ac76e261d5d063 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 7 Oct 2020 00:10:26 +1100 Subject: [PATCH] one less incompatibility with c89 --- src/Platform.c | 9 +++------ src/Screens.c | 3 ++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Platform.c b/src/Platform.c index 4c0424fcd..67bc231f4 100644 --- a/src/Platform.c +++ b/src/Platform.c @@ -205,13 +205,11 @@ void Platform_Log(const char* msg, int len) { WriteFile(conHandle, msg, len, &wrote, NULL); WriteFile(conHandle, "\n", 1, &wrote, NULL); } + if (!hasDebugger) return; - len = min(len, 2048); - Mem_Copy(tmp, msg, len); - tmp[len] = '\0'; + Mem_Copy(tmp, msg, len); tmp[len] = '\0'; - /* TODO: This reads past the end of the buffer */ OutputDebugStringA(tmp); OutputDebugStringA("\n"); } @@ -263,8 +261,7 @@ void Platform_Log(const char* msg, int len) { char tmp[2048 + 1]; len = min(len, 2048); - Mem_Copy(tmp, msg, len); - tmp[len] = '\0'; + Mem_Copy(tmp, msg, len); tmp[len] = '\0'; __android_log_write(ANDROID_LOG_DEBUG, "ClassiCube", tmp); } #else diff --git a/src/Screens.c b/src/Screens.c index 77d3d7dce..455a23392 100644 --- a/src/Screens.c +++ b/src/Screens.c @@ -1028,10 +1028,11 @@ static void ChatScreen_BuildMesh(void* screen) { } static void ChatScreen_Layout(void* screen) { struct ChatScreen* s = (struct ChatScreen*)screen; + int yOffset; /* See comment in ChatScreen_UpdateChatYOffsets */ HUDScreen_Layout(Gui_HUD); - int yOffset = Gui_HUD->hotbar.height + 15; /* TODO: This should be DPI scaled?? */ + yOffset = Gui_HUD->hotbar.height + 15; /* TODO: This should be DPI scaled?? */ if (ChatScreen_ChatUpdateFont(s)) ChatScreen_Redraw(s); s->paddingX = Display_ScaleX(5);