remove old String typedef completely

This commit is contained in:
UnknownShadow200 2020-10-18 12:31:19 +11:00
parent 88d1d9513a
commit 13fda4c626
4 changed files with 4 additions and 4 deletions

View File

@ -49,7 +49,7 @@ Here's the idea for a basic plugin that shows "Hello world" in chat when the gam
#endif #endif
static void TestPlugin_Init(void) { static void TestPlugin_Init(void) {
String msg = String_FromConst("Hello world!"); cc_string msg = String_FromConst("Hello world!");
Chat_Add(&msg); Chat_Add(&msg);
} }

View File

@ -139,12 +139,11 @@ typedef cc_uint64 TimeMS;
typedef struct Rect2D_ { int X, Y, Width, Height; } Rect2D; typedef struct Rect2D_ { int X, Y, Width, Height; } Rect2D;
typedef struct TextureRec_ { float U1, V1, U2, V2; } TextureRec; typedef struct TextureRec_ { float U1, V1, U2, V2; } TextureRec;
typedef struct String_ { typedef struct cc_string_ {
char* buffer; /* Pointer to characters, NOT NULL TERMINATED */ char* buffer; /* Pointer to characters, NOT NULL TERMINATED */
cc_uint16 length; /* Number of characters used */ cc_uint16 length; /* Number of characters used */
cc_uint16 capacity; /* Max number of characters */ cc_uint16 capacity; /* Max number of characters */
} cc_string; } cc_string;
typedef cc_string String;
/* Indicates that a reference to the buffer in a string argument is persisted after the function has completed. /* 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. */ Thus it is **NOT SAFE** to allocate a string on the stack. */
#define STRING_REF #define STRING_REF

View File

@ -6,6 +6,7 @@
Copyright 2014-2020 ClassiCube | Licensed under BSD-3 Copyright 2014-2020 ClassiCube | Licensed under BSD-3
*/ */
struct IGameComponent; struct IGameComponent;
struct StringsBuffer;
extern struct IGameComponent Input_Component; extern struct IGameComponent Input_Component;
enum Key { enum Key {
@ -159,6 +160,5 @@ void StoredHotkeys_Add(int trigger, cc_uint8 modifiers, cc_bool moreInput, const
cc_bool InputHandler_SetFOV(int fov); cc_bool InputHandler_SetFOV(int fov);
void InputHandler_PickBlocks(void); void InputHandler_PickBlocks(void);
void InputHandler_Init(void);
void InputHandler_OnScreensChanged(void); void InputHandler_OnScreensChanged(void);
#endif #endif

View File

@ -69,6 +69,7 @@
#define OPT_CAMERA_MASS "cameramass" #define OPT_CAMERA_MASS "cameramass"
#define OPT_GRAB_CURSOR "win-grab-cursor" #define OPT_GRAB_CURSOR "win-grab-cursor"
struct StringsBuffer;
extern struct StringsBuffer Options; extern struct StringsBuffer Options;
/* Frees any memory allocated in storing options. */ /* Frees any memory allocated in storing options. */
void Options_Free(void); void Options_Free(void);