From 9f1eeb4a20bde4a52b2b00236f9c43b1bb0247fb Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Mon, 15 Jan 2024 18:19:59 +1100 Subject: [PATCH] Fix can't compile android/iOS projects due to PickedPosRenderer.c having been renamed to SelOutlineRenderer.c, less warnings when compiling with modern gcc --- android/app/CMakeLists.txt | 2 +- doc/modules.md | 2 +- ios/CCIOS.xcodeproj/project.pbxproj | 8 ++++---- src/Bitmap.c | 8 ++++---- src/Http_Worker.c | 9 +++++---- src/SelOutlineRenderer.c | 2 +- src/SelOutlineRenderer.h | 4 ++-- 7 files changed, 18 insertions(+), 17 deletions(-) diff --git a/android/app/CMakeLists.txt b/android/app/CMakeLists.txt index 9392363e3..d154013a5 100644 --- a/android/app/CMakeLists.txt +++ b/android/app/CMakeLists.txt @@ -47,7 +47,7 @@ add_library(classicube SHARED ../../src/Vorbis.c ../../src/Protocol.c ../../src/World.c - ../../src/PickedPosRenderer.c + ../../src/SelOutlineRenderer.c ../../src/Platform_Posix.c ../../src/Platform_Android.c ../../src/LScreens.c diff --git a/doc/modules.md b/doc/modules.md index 573072b1c..812b909f4 100644 --- a/doc/modules.md +++ b/doc/modules.md @@ -106,7 +106,7 @@ TODO: explain multiple backends for some Modules |EnvRenderer|Renders environment of the world (clouds, sky, skybox, world sides/edges, etc) |HeldBlockRenderer|Renders the block currently being held in bottom right corner |MapRenderer|Renders the blocks of the world by diving it into chunks, and manages sorting/updating these chunks -|PickedPosRenderer|Renders an outline around the block currently being looked at +|SelOutlineRenderer|Renders an outline around the block currently being looked at |SelectionBox|Renders and stores selection boxes ## Texture pack modules diff --git a/ios/CCIOS.xcodeproj/project.pbxproj b/ios/CCIOS.xcodeproj/project.pbxproj index bbdbd5fcb..01f5cf6a3 100644 --- a/ios/CCIOS.xcodeproj/project.pbxproj +++ b/ios/CCIOS.xcodeproj/project.pbxproj @@ -69,7 +69,7 @@ 9A89D57E27F802F600FF3F80 /* Resources.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A89D4BE27F802F600FF3F80 /* Resources.c */; }; 9A89D57F27F802F600FF3F80 /* LWeb.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A89D4C427F802F600FF3F80 /* LWeb.c */; }; 9A89D58027F802F600FF3F80 /* Formats.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A89D4C627F802F600FF3F80 /* Formats.c */; }; - 9A89D58127F802F600FF3F80 /* PickedPosRenderer.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A89D4C927F802F600FF3F80 /* PickedPosRenderer.c */; }; + 9A89D58127F802F600FF3F80 /* SelOutlineRenderer.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A89D4C927F802F600FF3F80 /* SelOutlineRenderer.c */; }; 9A89D58327F802F600FF3F80 /* EntityComponents.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A89D4CC27F802F600FF3F80 /* EntityComponents.c */; }; 9A89D58427F802F600FF3F80 /* Camera.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A89D4CF27F802F600FF3F80 /* Camera.c */; }; 9A89D58627F802F600FF3F80 /* Screens.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A89D4D127F802F600FF3F80 /* Screens.c */; }; @@ -153,7 +153,7 @@ 9A89D4BE27F802F600FF3F80 /* Resources.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Resources.c; sourceTree = ""; }; 9A89D4C427F802F600FF3F80 /* LWeb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = LWeb.c; sourceTree = ""; }; 9A89D4C627F802F600FF3F80 /* Formats.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Formats.c; sourceTree = ""; }; - 9A89D4C927F802F600FF3F80 /* PickedPosRenderer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = PickedPosRenderer.c; sourceTree = ""; }; + 9A89D4C927F802F600FF3F80 /* SelOutlineRenderer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SelOutlineRenderer.c; sourceTree = ""; }; 9A89D4CC27F802F600FF3F80 /* EntityComponents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = EntityComponents.c; sourceTree = ""; }; 9A89D4CF27F802F600FF3F80 /* Camera.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Camera.c; sourceTree = ""; }; 9A89D4D127F802F600FF3F80 /* Screens.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Screens.c; sourceTree = ""; }; @@ -263,7 +263,7 @@ 9A89D39C27F802F500FF3F80 /* PackedCol.c */, 9A89D39B27F802F500FF3F80 /* Particle.c */, 9A89D49B27F802F600FF3F80 /* Physics.c */, - 9A89D4C927F802F600FF3F80 /* PickedPosRenderer.c */, + 9A89D4C927F802F600FF3F80 /* SelOutlineRenderer.c */, 9A89D4AA27F802F600FF3F80 /* Picking.c */, 9A89D39227F802F500FF3F80 /* Platform_Posix.c */, 9A89D48127F802F600FF3F80 /* Program.c */, @@ -373,7 +373,7 @@ 9A89D58D27F802F600FF3F80 /* Options.c in Sources */, 9A89D57927F802F600FF3F80 /* Event.c in Sources */, 9A89D55B27F802F600FF3F80 /* _type1.c in Sources */, - 9A89D58127F802F600FF3F80 /* PickedPosRenderer.c in Sources */, + 9A89D58127F802F600FF3F80 /* SelOutlineRenderer.c in Sources */, 9A89D56027F802F600FF3F80 /* _ftbitmap.c in Sources */, 9A89D50327F802F600FF3F80 /* Platform_Posix.c in Sources */, 9A89D58027F802F600FF3F80 /* Formats.c in Sources */, diff --git a/src/Bitmap.c b/src/Bitmap.c index 042eea102..043423fae 100644 --- a/src/Bitmap.c +++ b/src/Bitmap.c @@ -341,10 +341,10 @@ cc_result Png_Decode(struct Bitmap* bmp, struct Stream* stream) { cc_result res; /* header variables */ - static const cc_uint32 samplesPerPixel[7] = { 1, 0, 3, 1, 2, 0, 4 }; - cc_uint8 col, bitsPerSample, bytesPerPixel; - Png_RowExpander rowExpander; - cc_uint32 scanlineSize, scanlineBytes; + static const cc_uint8 samplesPerPixel[] = { 1, 0, 3, 1, 2, 0, 4 }; + cc_uint8 col, bitsPerSample, bytesPerPixel = 0; + Png_RowExpander rowExpander = NULL; + cc_uint32 scanlineSize = 0, scanlineBytes = 0; /* palette data */ BitmapCol trnsCol; diff --git a/src/Http_Worker.c b/src/Http_Worker.c index 85d9867e0..4e0ed3cfb 100644 --- a/src/Http_Worker.c +++ b/src/Http_Worker.c @@ -899,8 +899,8 @@ static cc_result HttpClient_Process(struct HttpClientState* state, char* buffer, #define INPUT_BUFFER_LEN 8192 static cc_result HttpClient_ParseResponse(struct HttpClientState* state) { struct HttpRequest* req = state->req; - char buffer[INPUT_BUFFER_LEN]; - char* dst; + cc_uint8 buffer[INPUT_BUFFER_LEN]; + cc_uint8* dst; cc_uint32 total; cc_result res; @@ -915,9 +915,10 @@ static cc_result HttpClient_ParseResponse(struct HttpClientState* state) { /* When there is more than INPUT_BUFFER_LEN bytes of unread data/content, */ /* there is no need to run the HTTP client state machine - just read directly */ /* into the output buffer to avoid a pointless Mem_Copy call */ - Http_BufferExpanded(req, total); state->dataLeft -= total; + Http_BufferExpanded(req, total); + state->dataLeft -= total; } else { - res = HttpClient_Process(state, buffer, total); + res = HttpClient_Process(state, (char*)buffer, total); } if (res) return res; diff --git a/src/SelOutlineRenderer.c b/src/SelOutlineRenderer.c index e45ba6cb4..6333d620e 100644 --- a/src/SelOutlineRenderer.c +++ b/src/SelOutlineRenderer.c @@ -112,7 +112,7 @@ void SelOutlineRenderer_Render(struct RayTracer* selected, cc_bool dirty) { /*########################################################################################################################* -*-----------------------------------------------PickedPosRenderer component-----------------------------------------------* +*-----------------------------------------------SelOutlineRenderer component----------------------------------------------* *#########################################################################################################################*/ static void OnContextLost(void* obj) { Gfx_DeleteDynamicVb(&selOutline_vb); diff --git a/src/SelOutlineRenderer.h b/src/SelOutlineRenderer.h index 91e5f1a02..7a039be69 100644 --- a/src/SelOutlineRenderer.h +++ b/src/SelOutlineRenderer.h @@ -1,5 +1,5 @@ -#ifndef CC_PICKEDPOSRENDERER_H -#define CC_PICKEDPOSRENDERER_H +#ifndef CC_SELOUTLINERENDERER_H +#define CC_SELOUTLINERENDERER_H #include "Core.h" /* Renders an outline around the block the player is looking at. Copyright 2014-2023 ClassiCube | Licensed under BSD-3