From 13fda4c626cfdecdc2ce8c3611439c9edc730cd7 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sun, 18 Oct 2020 12:31:19 +1100 Subject: [PATCH] remove old String typedef completely --- doc/plugin-dev.md | 2 +- src/Core.h | 3 +-- src/Input.h | 2 +- src/Options.h | 1 + 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/plugin-dev.md b/doc/plugin-dev.md index b689f1855..2e68035e0 100644 --- a/doc/plugin-dev.md +++ b/doc/plugin-dev.md @@ -49,7 +49,7 @@ Here's the idea for a basic plugin that shows "Hello world" in chat when the gam #endif static void TestPlugin_Init(void) { - String msg = String_FromConst("Hello world!"); + cc_string msg = String_FromConst("Hello world!"); Chat_Add(&msg); } diff --git a/src/Core.h b/src/Core.h index a744e2662..274d036d6 100644 --- a/src/Core.h +++ b/src/Core.h @@ -139,12 +139,11 @@ typedef cc_uint64 TimeMS; typedef struct Rect2D_ { int X, Y, Width, Height; } Rect2D; typedef struct TextureRec_ { float U1, V1, U2, V2; } TextureRec; -typedef struct String_ { +typedef struct cc_string_ { char* buffer; /* Pointer to characters, NOT NULL TERMINATED */ cc_uint16 length; /* Number of characters used */ cc_uint16 capacity; /* Max number of characters */ } cc_string; -typedef cc_string String; /* Indicates that a reference to the buffer in a string argument is persisted after the function has completed. Thus it is **NOT SAFE** to allocate a string on the stack. */ #define STRING_REF diff --git a/src/Input.h b/src/Input.h index 648f9ce63..c3d263961 100644 --- a/src/Input.h +++ b/src/Input.h @@ -6,6 +6,7 @@ Copyright 2014-2020 ClassiCube | Licensed under BSD-3 */ struct IGameComponent; +struct StringsBuffer; extern struct IGameComponent Input_Component; enum Key { @@ -159,6 +160,5 @@ void StoredHotkeys_Add(int trigger, cc_uint8 modifiers, cc_bool moreInput, const cc_bool InputHandler_SetFOV(int fov); void InputHandler_PickBlocks(void); -void InputHandler_Init(void); void InputHandler_OnScreensChanged(void); #endif diff --git a/src/Options.h b/src/Options.h index f77ce512e..b0d94cb84 100644 --- a/src/Options.h +++ b/src/Options.h @@ -69,6 +69,7 @@ #define OPT_CAMERA_MASS "cameramass" #define OPT_GRAB_CURSOR "win-grab-cursor" +struct StringsBuffer; extern struct StringsBuffer Options; /* Frees any memory allocated in storing options. */ void Options_Free(void);