Remove trailing spaces

This commit is contained in:
Ray
2026-03-13 18:50:26 +01:00
parent 7b9a2a4145
commit 6ba6df3af3
9 changed files with 43 additions and 43 deletions

View File

@ -124,10 +124,10 @@ if (PLATFORM STREQUAL "Desktop")
target_compile_definitions(raylib PRIVATE _GLFW_X11) target_compile_definitions(raylib PRIVATE _GLFW_X11)
target_link_libraries(raylib PRIVATE target_link_libraries(raylib PRIVATE
${X11_LIBRARIES} ${X11_LIBRARIES}
) )
message(STATUS "X11 support enabled for raylib") message(STATUS "X11 support enabled for raylib")
endif() endif()
endif() endif()

View File

@ -280,15 +280,15 @@ static int android_close(void *cookie);
// The flag MUST be applied at every final link step that needs wrapping, // The flag MUST be applied at every final link step that needs wrapping,
// it has no effect when only building a static archive (.a) // it has no effect when only building a static archive (.a)
// //
// CMake: no action required, raylib's CMakeLists.txt already sets // CMake: no action required, raylib's CMakeLists.txt already sets
// target_link_options(raylib INTERFACE -Wl,--wrap=fopen) which propagates to // target_link_options(raylib INTERFACE -Wl,--wrap=fopen) which propagates to
// the final app link, wrapping app code and all static (.a) dependencies too // the final app link, wrapping app code and all static (.a) dependencies too
// Make (SHARED): no action required for raylib itself, src/Makefile already sets // Make (SHARED): no action required for raylib itself, src/Makefile already sets
// LDFLAGS += -Wl,--wrap=fopen wrapping fopen inside libraylib.so only; // LDFLAGS += -Wl,--wrap=fopen wrapping fopen inside libraylib.so only;
// app code and static (.a) dependencies are NOT wrapped unless -Wl,--wrap=fopen // app code and static (.a) dependencies are NOT wrapped unless -Wl,--wrap=fopen
// is also added to the final app link step // is also added to the final app link step
// Make (STATIC): pass -Wl,--wrap=fopen to the linker command producing the final artifact // Make (STATIC): pass -Wl,--wrap=fopen to the linker command producing the final artifact
// build.zig: no dedicated wrap helper; pass -Wl,--wrap=fopen to the linker command producing // build.zig: no dedicated wrap helper; pass -Wl,--wrap=fopen to the linker command producing
// the final artifact // the final artifact
// custom: pass -Wl,--wrap=fopen to the linker command producing the final artifact // custom: pass -Wl,--wrap=fopen to the linker command producing the final artifact
FILE *__real_fopen(const char *fileName, const char *mode); // Real fopen, provided by the linker (--wrap=fopen) FILE *__real_fopen(const char *fileName, const char *mode); // Real fopen, provided by the linker (--wrap=fopen)

View File

@ -819,22 +819,22 @@ EM_ASYNC_JS(void, RequestClipboardData, (void), {
{ {
const blob = await item.getType(item.types.find(t => t.startsWith("image/"))); const blob = await item.getType(item.types.find(t => t.startsWith("image/")));
const bitmap = await createImageBitmap(blob); const bitmap = await createImageBitmap(blob);
const canvas = document.createElement('canvas'); const canvas = document.createElement('canvas');
canvas.width = bitmap.width; canvas.width = bitmap.width;
canvas.height = bitmap.height; canvas.height = bitmap.height;
const ctx = canvas.getContext('2d'); const ctx = canvas.getContext('2d');
ctx.drawImage(bitmap, 0, 0); ctx.drawImage(bitmap, 0, 0);
const imgData = ctx.getImageData(0, 0, canvas.width, canvas.height).data; const imgData = ctx.getImageData(0, 0, canvas.width, canvas.height).data;
// Store image and data for the Fetch function // Store image and data for the Fetch function
window._lastImgWidth = canvas.width; window._lastImgWidth = canvas.width;
window._lastImgHeight = canvas.height; window._lastImgHeight = canvas.height;
window._lastImgData = imgData; window._lastImgData = imgData;
} }
} }
} }
else console.warn("Clipboard read() requires HTTPS/Localhost"); else console.warn("Clipboard read() requires HTTPS/Localhost");
}); });
@ -856,19 +856,19 @@ EM_JS(unsigned char *, GetLastPastedImage, (int *width, int *height), {
if (window._lastImgData) if (window._lastImgData)
{ {
const data = window._lastImgData; const data = window._lastImgData;
if (data.length > 0) if (data.length > 0)
{ {
const ptr = _malloc(data.length); const ptr = _malloc(data.length);
HEAPU8.set(data, ptr); HEAPU8.set(data, ptr);
// Set the width and height via the pointers passed from C // Set the width and height via the pointers passed from C
// HEAP32 handles the 4-byte integers // HEAP32 handles the 4-byte integers
if (width) setValue(width, window._lastImgWidth, 'i32'); if (width) setValue(width, window._lastImgWidth, 'i32');
if (height) setValue(height, window._lastImgHeight, 'i32'); if (height) setValue(height, window._lastImgHeight, 'i32');
// Clear the JS buffer so there is no need to fetch the same image twice // Clear the JS buffer so there is no need to fetch the same image twice
window._lastImgData = null; window._lastImgData = null;
return ptr; return ptr;
} }
} }
@ -898,7 +898,7 @@ Image GetClipboardImage(void)
image.mipmaps = 1; image.mipmaps = 1;
image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8;
} }
return image; return image;
} }

View File

@ -797,22 +797,22 @@ EM_ASYNC_JS(void, RequestClipboardData, (void), {
{ {
const blob = await item.getType(item.types.find(t => t.startsWith("image/"))); const blob = await item.getType(item.types.find(t => t.startsWith("image/")));
const bitmap = await createImageBitmap(blob); const bitmap = await createImageBitmap(blob);
const canvas = document.createElement('canvas'); const canvas = document.createElement('canvas');
canvas.width = bitmap.width; canvas.width = bitmap.width;
canvas.height = bitmap.height; canvas.height = bitmap.height;
const ctx = canvas.getContext('2d'); const ctx = canvas.getContext('2d');
ctx.drawImage(bitmap, 0, 0); ctx.drawImage(bitmap, 0, 0);
const imgData = ctx.getImageData(0, 0, canvas.width, canvas.height).data; const imgData = ctx.getImageData(0, 0, canvas.width, canvas.height).data;
// Store image and data for the Fetch function // Store image and data for the Fetch function
window._lastImgWidth = canvas.width; window._lastImgWidth = canvas.width;
window._lastImgHeight = canvas.height; window._lastImgHeight = canvas.height;
window._lastImgData = imgData; window._lastImgData = imgData;
} }
} }
} }
else console.warn("Clipboard read() requires HTTPS/Localhost"); else console.warn("Clipboard read() requires HTTPS/Localhost");
}); });
@ -838,15 +838,15 @@ EM_JS(unsigned char *, GetLastPastedImage, (int *width, int *height), {
{ {
const ptr = _malloc(data.length); const ptr = _malloc(data.length);
HEAPU8.set(data, ptr); HEAPU8.set(data, ptr);
// Set the width and height via the pointers passed from C // Set the width and height via the pointers passed from C
// HEAP32 handles the 4-byte integers // HEAP32 handles the 4-byte integers
if (width) setValue(width, window._lastImgWidth, 'i32'); if (width) setValue(width, window._lastImgWidth, 'i32');
if (height) setValue(height, window._lastImgHeight, 'i32'); if (height) setValue(height, window._lastImgHeight, 'i32');
// Clear the JS buffer so there is no need to fetch the same image twice // Clear the JS buffer so there is no need to fetch the same image twice
window._lastImgData = null; window._lastImgData = null;
return ptr; return ptr;
} }
} }
@ -876,7 +876,7 @@ Image GetClipboardImage(void)
image.mipmaps = 1; image.mipmaps = 1;
image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8;
} }
return image; return image;
} }

View File

@ -1634,7 +1634,7 @@ Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data,
{ {
music.ctxType = MUSIC_AUDIO_QOA; music.ctxType = MUSIC_AUDIO_QOA;
music.ctxData = ctxQoa; music.ctxData = ctxQoa;
// NOTE: Loading samples are 32bit float normalized data, so, // NOTE: Loading samples are 32bit float normalized data, so,
// configure the output audio stream to also use float 32bit // configure the output audio stream to also use float 32bit
music.stream = LoadAudioStream(ctxQoa->info.samplerate, 32, ctxQoa->info.channels); music.stream = LoadAudioStream(ctxQoa->info.samplerate, 32, ctxQoa->info.channels);

View File

@ -4446,7 +4446,7 @@ void rlUnloadShader(unsigned int id)
{ {
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
glDeleteShader(id); glDeleteShader(id);
TRACELOG(RL_LOG_INFO, "SHADER: [ID %i] Unloaded shader data from VRAM (GPU)", id); TRACELOG(RL_LOG_INFO, "SHADER: [ID %i] Unloaded shader data from VRAM (GPU)", id);
#endif #endif
} }

View File

@ -3375,7 +3375,7 @@ Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize)
Vector3 n5 = { 0.0f, 0.0f, -1.0f }; Vector3 n5 = { 0.0f, 0.0f, -1.0f };
Vector3 n6 = { 0.0f, 0.0f, 1.0f }; Vector3 n6 = { 0.0f, 0.0f, 1.0f };
// NOTE: Using texture rectangles to define different // NOTE: Using texture rectangles to define different
// textures for top-bottom-front-back-right-left (6) // textures for top-bottom-front-back-right-left (6)
typedef struct RectangleF { typedef struct RectangleF {
float x; float x;

View File

@ -156,7 +156,7 @@ extern void LoadFontDefault(void)
{ {
#define BIT_CHECK(a,b) ((a) & (1u << (b))) #define BIT_CHECK(a,b) ((a) & (1u << (b)))
// Check to see if the font for an image has alreeady been allocated, // Check to see if the font for an image has alreeady been allocated,
// and if no need to upload, then return // and if no need to upload, then return
if (defaultFont.glyphs != NULL) return; if (defaultFont.glyphs != NULL) return;
@ -242,7 +242,7 @@ extern void LoadFontDefault(void)
{ {
if (BIT_CHECK(defaultFontData[counter], j)) if (BIT_CHECK(defaultFontData[counter], j))
{ {
// NOTE: Unreferencing data as short, so, // NOTE: Unreferencing data as short, so,
// considering data as little-endian (alpha + gray) // considering data as little-endian (alpha + gray)
((unsigned short *)imFont.data)[i + j] = 0xffff; ((unsigned short *)imFont.data)[i + j] = 0xffff;
} }
@ -446,7 +446,7 @@ Font LoadFontFromImage(Image image, Color key, int firstChar)
int charHeight = 0; int charHeight = 0;
int j = 0; int j = 0;
while (((lineSpacing + j) < image.height) && while (((lineSpacing + j) < image.height) &&
!COLOR_EQUAL(pixels[(lineSpacing + j)*image.width + charSpacing], key)) j++; !COLOR_EQUAL(pixels[(lineSpacing + j)*image.width + charSpacing], key)) j++;
charHeight = j; charHeight = j;
@ -470,7 +470,7 @@ Font LoadFontFromImage(Image image, Color key, int firstChar)
int charWidth = 0; int charWidth = 0;
while (((xPosToRead + charWidth) < image.width) && while (((xPosToRead + charWidth) < image.width) &&
!COLOR_EQUAL(pixels[(lineSpacing + (charHeight + lineSpacing)*lineToRead)*image.width + xPosToRead + charWidth], key)) charWidth++; !COLOR_EQUAL(pixels[(lineSpacing + (charHeight + lineSpacing)*lineToRead)*image.width + xPosToRead + charWidth], key)) charWidth++;
tempCharRecs[index].width = (float)charWidth; tempCharRecs[index].width = (float)charWidth;

View File

@ -659,7 +659,7 @@ int main(int argc, char *argv[])
// we must store provided file paths because pointers will be overwriten // we must store provided file paths because pointers will be overwriten
// TODO: It seems projects are added to solution BUT not to required solution folder, // TODO: It seems projects are added to solution BUT not to required solution folder,
// that process still requires to be done manually // that process still requires to be done manually
LOG("INFO: [%s] Adding project to raylib solution (.sln)\n", LOG("INFO: [%s] Adding project to raylib solution (.sln)\n",
TextFormat("%s/../projects/VS2022/examples/%s.vcxproj", exBasePath, exName)); TextFormat("%s/../projects/VS2022/examples/%s.vcxproj", exBasePath, exName));
AddVSProjectToSolution(exVSProjectSolutionFile, AddVSProjectToSolution(exVSProjectSolutionFile,
TextFormat("%s/../projects/VS2022/examples/%s.vcxproj", exBasePath, exName), exCategory); TextFormat("%s/../projects/VS2022/examples/%s.vcxproj", exBasePath, exName), exCategory);
@ -1254,7 +1254,7 @@ int main(int argc, char *argv[])
exCollection[i].status &= ~VALID_NOT_IN_README; exCollection[i].status &= ~VALID_NOT_IN_README;
exCollection[i].status &= ~VALID_NOT_IN_JS; exCollection[i].status &= ~VALID_NOT_IN_JS;
} }
// Check examples "status" information // Check examples "status" information
for (int i = 0; i < exCollectionCount; i++) for (int i = 0; i < exCollectionCount; i++)
{ {
@ -2686,21 +2686,21 @@ static int AddVSProjectToSolution(const char *slnFile, const char *projFile, con
// Add project folder line // Add project folder line
// NOTE: Folder uuid depends on category // NOTE: Folder uuid depends on category
if (strcmp(category, "core") == 0) offsetIndex += sprintf(slnTextUpdated + offsetIndex, if (strcmp(category, "core") == 0) offsetIndex += sprintf(slnTextUpdated + offsetIndex,
TextFormat("\t\t{%s} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035}\n", uuid)); TextFormat("\t\t{%s} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035}\n", uuid));
else if (strcmp(category, "shapes") == 0) offsetIndex += sprintf(slnTextUpdated + offsetIndex, else if (strcmp(category, "shapes") == 0) offsetIndex += sprintf(slnTextUpdated + offsetIndex,
TextFormat("\t\t{%s} = {278D8859-20B1-428F-8448-064F46E1F021}\n", uuid)); TextFormat("\t\t{%s} = {278D8859-20B1-428F-8448-064F46E1F021}\n", uuid));
else if (strcmp(category, "textures") == 0) offsetIndex += sprintf(slnTextUpdated + offsetIndex, else if (strcmp(category, "textures") == 0) offsetIndex += sprintf(slnTextUpdated + offsetIndex,
TextFormat("\t\t{%s} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE}\n", uuid)); TextFormat("\t\t{%s} = {DA049009-21FF-4AC0-84E4-830DD1BCD0CE}\n", uuid));
else if (strcmp(category, "text") == 0) offsetIndex += sprintf(slnTextUpdated + offsetIndex, else if (strcmp(category, "text") == 0) offsetIndex += sprintf(slnTextUpdated + offsetIndex,
TextFormat("\t\t{%s} = {8D3C83B7-F1E0-4C2E-9E34-EE5F6AB2502A}\n", uuid)); TextFormat("\t\t{%s} = {8D3C83B7-F1E0-4C2E-9E34-EE5F6AB2502A}\n", uuid));
else if (strcmp(category, "models") == 0) offsetIndex += sprintf(slnTextUpdated + offsetIndex, else if (strcmp(category, "models") == 0) offsetIndex += sprintf(slnTextUpdated + offsetIndex,
TextFormat("\t\t{%s} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C}\n", uuid)); TextFormat("\t\t{%s} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C}\n", uuid));
else if (strcmp(category, "shaders") == 0) offsetIndex += sprintf(slnTextUpdated + offsetIndex, else if (strcmp(category, "shaders") == 0) offsetIndex += sprintf(slnTextUpdated + offsetIndex,
TextFormat("\t\t{%s} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9}\n", uuid)); TextFormat("\t\t{%s} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9}\n", uuid));
else if (strcmp(category, "audio") == 0) offsetIndex += sprintf(slnTextUpdated + offsetIndex, else if (strcmp(category, "audio") == 0) offsetIndex += sprintf(slnTextUpdated + offsetIndex,
TextFormat("\t\t{%s} = {CC132A4D-D081-4C26-BFB9-AB11984054F8}\n", uuid)); TextFormat("\t\t{%s} = {CC132A4D-D081-4C26-BFB9-AB11984054F8}\n", uuid));
else if (strcmp(category, "other") == 0) offsetIndex += sprintf(slnTextUpdated + offsetIndex, else if (strcmp(category, "other") == 0) offsetIndex += sprintf(slnTextUpdated + offsetIndex,
TextFormat("\t\t{%s} = {E9D708A5-9C1F-4B84-A795-C5F191801762}\n", uuid)); TextFormat("\t\t{%s} = {E9D708A5-9C1F-4B84-A795-C5F191801762}\n", uuid));
else LOG("WARNING: Provided category is not valid: %s\n", category); else LOG("WARNING: Provided category is not valid: %s\n", category);
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------