From 6789281386ef7ded5b6e31b534b463d760f1fc01 Mon Sep 17 00:00:00 2001 From: Peter0x44 Date: Sat, 12 Mar 2022 20:30:07 +0000 Subject: [PATCH] Fix gcc warning (by default an error) when using raygui from C++ (#183) In C, string literals have the type char*, but you cannot write to them. In C++, they have the type const char* --- src/raygui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raygui.h b/src/raygui.h index de715eb..36814ad 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -3147,7 +3147,7 @@ int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, co if (secretViewActive != NULL) { if (GuiTextBox(RAYGUI_CLITERAL(Rectangle){ textBoxBounds.x, textBoxBounds.y, textBoxBounds.width - 4 - RAYGUI_TEXTINPUTBOX_HEIGHT, textBoxBounds.height }, - ((*secretViewActive == 1) || textEditMode)? text : "****************", textMaxSize, textEditMode)) textEditMode = !textEditMode; + ((*secretViewActive == 1) || textEditMode)? text : (char *) "****************", textMaxSize, textEditMode)) textEditMode = !textEditMode; *secretViewActive = GuiToggle(RAYGUI_CLITERAL(Rectangle){ textBoxBounds.x + textBoxBounds.width - RAYGUI_TEXTINPUTBOX_HEIGHT, textBoxBounds.y, RAYGUI_TEXTINPUTBOX_HEIGHT, RAYGUI_TEXTINPUTBOX_HEIGHT }, (*secretViewActive == 1)? "#44#" : "#45#", *secretViewActive); }