From a7e66df56d6c9f8d99cbcd21331964cadc7c7419 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 13 Aug 2025 12:33:38 +0200 Subject: [PATCH] Using define for buffers size --- tools/rexm/rexm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/rexm/rexm.c b/tools/rexm/rexm.c index 125815ee2..761fca0ee 100644 --- a/tools/rexm/rexm.c +++ b/tools/rexm/rexm.c @@ -448,7 +448,7 @@ int main(int argc, char *argv[]) char *exCollectionList = LoadFileText(exCollectionFilePath); if (TextFindIndex(exCollectionList, exName) == -1) // Example not found { - char *exCollectionListUpdated = (char *)RL_CALLOC(2*1024*1024, 1); // Updated list copy, 2MB + char *exCollectionListUpdated = (char *)RL_CALLOC(REXM_MAX_BUFFER_SIZE, 1); // Updated list copy, 2MB // Add example to the main list, by category // by default add it last in the category list @@ -1051,7 +1051,7 @@ static int UpdateRequiredFiles(void) // Edit: raylib/examples/Makefile --> Update from collection //------------------------------------------------------------------------------------------------ char *mkText = LoadFileText(TextFormat("%s/Makefile", exBasePath)); - char *mkTextUpdated = (char *)RL_CALLOC(2*1024*1024, 1); // Updated Makefile copy, 2MB + char *mkTextUpdated = (char *)RL_CALLOC(REXM_MAX_BUFFER_SIZE, 1); // Updated Makefile copy, 2MB int mkListStartIndex = TextFindIndex(mkText, "#EXAMPLES_LIST_START"); int mkListEndIndex = TextFindIndex(mkText, "#EXAMPLES_LIST_END"); @@ -1086,7 +1086,7 @@ static int UpdateRequiredFiles(void) // NOTE: We avoid the "others" category on web building //------------------------------------------------------------------------------------------------ char *mkwText = LoadFileText(TextFormat("%s/Makefile.Web", exBasePath)); - char *mkwTextUpdated = (char *)RL_CALLOC(2*1024*1024, 1); // Updated Makefile copy, 2MB + char *mkwTextUpdated = (char *)RL_CALLOC(REXM_MAX_BUFFER_SIZE, 1); // Updated Makefile copy, 2MB int mkwListStartIndex = TextFindIndex(mkwText, "#EXAMPLES_LIST_START"); int mkwListEndIndex = TextFindIndex(mkwText, "#EXAMPLES_LIST_END"); @@ -1206,7 +1206,7 @@ static int UpdateRequiredFiles(void) // NOTE: Using [examples_list.txt] to update/regen README.md // Lines format: | 01 | [core_basic_window](core/core_basic_window.c) | core_basic_window | ⭐️☆☆☆ | 1.0 | 1.0 | [Ray](https://github.com/raysan5) | char *mdText = LoadFileText(TextFormat("%s/README.md", exBasePath)); - char *mdTextUpdated = (char *)RL_CALLOC(2*1024*1024, 1); // Updated examples.js copy, 2MB + char *mdTextUpdated = (char *)RL_CALLOC(REXM_MAX_BUFFER_SIZE, 1); // Updated examples.js copy, 2MB int mdListStartIndex = TextFindIndex(mdText, "## EXAMPLES COLLECTION"); @@ -1312,7 +1312,7 @@ static int UpdateRequiredFiles(void) // NOTE: Entries format: exampleEntry('⭐️☆☆☆' , 'core' , 'basic_window'), //------------------------------------------------------------------------------------------------ char *jsText = LoadFileText(TextFormat("%s/../common/examples.js", exWebPath)); - char *jsTextUpdated = (char *)RL_CALLOC(2*1024*1024, 1); // Updated examples.js copy, 2MB + char *jsTextUpdated = (char *)RL_CALLOC(REXM_MAX_BUFFER_SIZE, 1); // Updated examples.js copy, 2MB int jsListStartIndex = TextFindIndex(jsText, "//EXAMPLE_DATA_LIST_START"); int jsListEndIndex = TextFindIndex(jsText, "//EXAMPLE_DATA_LIST_END");