From 4e8d08523fb7c62bce68cd0a2e11d926bf632e79 Mon Sep 17 00:00:00 2001 From: JohnnyCena123 Date: Tue, 2 Sep 2025 19:58:39 +0300 Subject: [PATCH] add const qualifier to the first arg of TextJoin (#5166) * add const qualifier to the first arg of TextJoin * Update raylib_api.* by CI * Update raylib.h --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Ray --- src/raylib.h | 2 +- src/rtext.c | 2 +- tools/parser/output/raylib_api.json | 2 +- tools/parser/output/raylib_api.lua | 2 +- tools/parser/output/raylib_api.txt | 2 +- tools/parser/output/raylib_api.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 41bc1926e..fa08ed9c0 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1515,7 +1515,7 @@ RLAPI const char *TextFormat(const char *text, ...); RLAPI const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string RLAPI char *TextReplace(const char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!) RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!) -RLAPI char *TextJoin(char **textList, int count, const char *delimiter); // Join text strings with delimiter +RLAPI char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter RLAPI char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor! RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string, -1 if not found diff --git a/src/rtext.c b/src/rtext.c index 009a264f3..8bccf0e15 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1714,7 +1714,7 @@ char *TextInsert(const char *text, const char *insert, int position) // Join text strings with delimiter // REQUIRES: memset(), memcpy() -char *TextJoin(char **textList, int count, const char *delimiter) +char *TextJoin(const char **textList, int count, const char *delimiter) { static char buffer[MAX_TEXT_BUFFER_LENGTH] = { 0 }; memset(buffer, 0, MAX_TEXT_BUFFER_LENGTH); diff --git a/tools/parser/output/raylib_api.json b/tools/parser/output/raylib_api.json index 4ce190714..20101ed9f 100644 --- a/tools/parser/output/raylib_api.json +++ b/tools/parser/output/raylib_api.json @@ -9754,7 +9754,7 @@ "returnType": "char *", "params": [ { - "type": "char **", + "type": "const char **", "name": "textList" }, { diff --git a/tools/parser/output/raylib_api.lua b/tools/parser/output/raylib_api.lua index e52fda62d..da669c801 100644 --- a/tools/parser/output/raylib_api.lua +++ b/tools/parser/output/raylib_api.lua @@ -6933,7 +6933,7 @@ return { description = "Join text strings with delimiter", returnType = "char *", params = { - {type = "char **", name = "textList"}, + {type = "const char **", name = "textList"}, {type = "int", name = "count"}, {type = "const char *", name = "delimiter"} } diff --git a/tools/parser/output/raylib_api.txt b/tools/parser/output/raylib_api.txt index b164b7e88..bb8c52408 100644 --- a/tools/parser/output/raylib_api.txt +++ b/tools/parser/output/raylib_api.txt @@ -3734,7 +3734,7 @@ Function 434: TextJoin() (3 input parameters) Name: TextJoin Return type: char * Description: Join text strings with delimiter - Param[1]: textList (type: char **) + Param[1]: textList (type: const char **) Param[2]: count (type: int) Param[3]: delimiter (type: const char *) Function 435: TextSplit() (3 input parameters) diff --git a/tools/parser/output/raylib_api.xml b/tools/parser/output/raylib_api.xml index 43835334d..4f91715c1 100644 --- a/tools/parser/output/raylib_api.xml +++ b/tools/parser/output/raylib_api.xml @@ -2474,7 +2474,7 @@ - +