From 08e79a16b01816a9ea730cef9ec0a437081f438d Mon Sep 17 00:00:00 2001 From: Maicon Santana Date: Thu, 29 Jan 2026 16:30:03 +0000 Subject: [PATCH] Refactoring {0} to { 0 } to follow conventions (#5519) Co-authored-by: maiconpintoabreu --- examples/core/msf_gif.h | 6 +++--- examples/models/models_decals.c | 4 ++-- examples/shaders/shaders_hybrid_rendering.c | 2 +- examples/shaders/shaders_vertex_displacement.c | 2 +- examples/shapes/shapes_ball_physics.c | 2 +- examples/shapes/shapes_pie_chart.c | 4 ++-- examples/text/text_3d_drawing.c | 4 ++-- examples/text/text_strings_management.c | 2 +- src/platforms/rcore_android.c | 4 ++-- src/platforms/rcore_drm.c | 8 ++++---- tools/rexm/rexm.c | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/examples/core/msf_gif.h b/examples/core/msf_gif.h index bc2c6edef..6aa11fdbd 100644 --- a/examples/core/msf_gif.h +++ b/examples/core/msf_gif.h @@ -413,7 +413,7 @@ static MsfGifBuffer * msf_compress_frame(void * allocContext, int width, int hei //generate palette typedef struct { uint8_t r, g, b; } Color3; - Color3 table[256] = { {0} }; + Color3 table[256] = { { 0 } }; int tableIdx = 1; //we start counting at 1 because 0 is the transparent color //transparent is always last in the table tlb[tlbSize-1] = 0; @@ -550,7 +550,7 @@ static void msf_free_gif_state(MsfGifState * handle) { int msf_gif_begin(MsfGifState * handle, int width, int height) { MsfTimeFunc //NOTE: we cannot stomp the entire struct to zero because we must preserve `customAllocatorContext`. - MsfCookedFrame empty = {0}; //god I hate MSVC... + MsfCookedFrame empty = { 0 }; //god I hate MSVC... handle->previousFrame = empty; handle->currentFrame = empty; handle->width = width; @@ -614,7 +614,7 @@ int msf_gif_frame(MsfGifState * handle, uint8_t * pixelData, int centiSecondsPer } MsfGifResult msf_gif_end(MsfGifState * handle) { MsfTimeFunc - if (!handle->listHead) { MsfGifResult empty = {0}; return empty; } + if (!handle->listHead) { MsfGifResult empty = { 0 }; return empty; } //first pass: determine total size size_t total = 1; //1 byte for trailing marker diff --git a/examples/models/models_decals.c b/examples/models/models_decals.c index 71122dd68..9eba33de6 100644 --- a/examples/models/models_decals.c +++ b/examples/models/models_decals.c @@ -183,7 +183,7 @@ int main(void) if (showModel) DrawModel(model, (Vector3){0.0f, 0.0f, 0.0f}, 1.0f, WHITE); // Draw the decal models - for (int i = 0; i < decalCount; i++) DrawModel(decalModels[i], (Vector3){0}, 1.0f, WHITE); + for (int i = 0; i < decalCount; i++) DrawModel(decalModels[i], (Vector3){ 0 }, 1.0f, WHITE); // If we hit the mesh, draw the box for the decal if (collision.hit) @@ -191,7 +191,7 @@ int main(void) Vector3 origin = Vector3Add(collision.point, Vector3Scale(collision.normal, 1.0f)); Matrix splat = MatrixLookAt(collision.point, origin, (Vector3){0,1,0}); placementCube.transform = MatrixInvert(splat); - DrawModel(placementCube, (Vector3){0}, 1.0f, Fade(WHITE, 0.5f)); + DrawModel(placementCube, (Vector3){ 0 }, 1.0f, Fade(WHITE, 0.5f)); } DrawGrid(10, 10.0f); diff --git a/examples/shaders/shaders_hybrid_rendering.c b/examples/shaders/shaders_hybrid_rendering.c index 439965fd6..ca6e93d9c 100644 --- a/examples/shaders/shaders_hybrid_rendering.c +++ b/examples/shaders/shaders_hybrid_rendering.c @@ -65,7 +65,7 @@ int main(void) Shader shdrRaster = LoadShader(0, TextFormat("resources/shaders/glsl%i/hybrid_raster.fs", GLSL_VERSION)); // Declare Struct used to store camera locs - RayLocs marchLocs = {0}; + RayLocs marchLocs = { 0 }; // Fill the struct with shader locs marchLocs.camPos = GetShaderLocation(shdrRaymarch, "camPos"); diff --git a/examples/shaders/shaders_vertex_displacement.c b/examples/shaders/shaders_vertex_displacement.c index 3eff34e00..8978b0fce 100644 --- a/examples/shaders/shaders_vertex_displacement.c +++ b/examples/shaders/shaders_vertex_displacement.c @@ -41,7 +41,7 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [shaders] example - vertex displacement"); // set up camera - Camera camera = {0}; + Camera camera = { 0 }; camera.position = (Vector3) {20.0f, 5.0f, -20.0f}; camera.target = (Vector3) {0.0f, 0.0f, 0.0f}; camera.up = (Vector3) {0.0f, 1.0f, 0.0f}; diff --git a/examples/shapes/shapes_ball_physics.c b/examples/shapes/shapes_ball_physics.c index 0c98ccf9d..293be1cd5 100644 --- a/examples/shapes/shapes_ball_physics.c +++ b/examples/shapes/shapes_ball_physics.c @@ -58,7 +58,7 @@ int main(void) int ballCount = 1; Ball *grabbedBall = NULL; // A pointer to the current ball that is grabbed - Vector2 pressOffset = {0}; // Mouse press offset relative to the ball that grabbedd + Vector2 pressOffset = { 0 }; // Mouse press offset relative to the ball that grabbedd float gravity = 100; // World gravity diff --git a/examples/shapes/shapes_pie_chart.c b/examples/shapes/shapes_pie_chart.c index 6db7f96da..baf0a3652 100644 --- a/examples/shapes/shapes_pie_chart.c +++ b/examples/shapes/shapes_pie_chart.c @@ -49,8 +49,8 @@ int main(void) bool showPercentages = false; bool showDonut = false; int hoveredSlice = -1; - Rectangle scrollPanelBounds = {0}; - Vector2 scrollContentOffset = {0}; + Rectangle scrollPanelBounds = { 0 }; + Vector2 scrollContentOffset = { 0 }; Rectangle view = { 0 }; // UI layout parameters diff --git a/examples/text/text_3d_drawing.c b/examples/text/text_3d_drawing.c index 80b617b2e..aebf33837 100644 --- a/examples/text/text_3d_drawing.c +++ b/examples/text/text_3d_drawing.c @@ -113,7 +113,7 @@ int main(void) // Set the text (using markdown!) char text[64] = "Hello ~~World~~ in 3D!"; - Vector3 tbox = {0}; + Vector3 tbox = { 0 }; int layers = 1; int quads = 0; float layerDistance = 0.01f; @@ -133,7 +133,7 @@ int main(void) Shader alphaDiscard = LoadShader(NULL, TextFormat("resources/shaders/glsl%i/alpha_discard.fs", GLSL_VERSION)); // Array filled with multiple random colors (when multicolor mode is set) - Color multi[TEXT_MAX_LAYERS] = {0}; + Color multi[TEXT_MAX_LAYERS] = { 0 }; DisableCursor(); // Limit cursor to relative movement inside the window diff --git a/examples/text/text_strings_management.c b/examples/text/text_strings_management.c index e4a7ab2af..db4540081 100644 --- a/examples/text/text_strings_management.c +++ b/examples/text/text_strings_management.c @@ -65,7 +65,7 @@ int main(void) TextParticle textParticles[MAX_TEXT_PARTICLES] = { 0 }; int particleCount = 0; TextParticle *grabbedTextParticle = NULL; - Vector2 pressOffset = {0}; + Vector2 pressOffset = { 0 }; PrepareFirstTextParticle("raylib => fun videogames programming!", textParticles, &particleCount); diff --git a/src/platforms/rcore_android.c b/src/platforms/rcore_android.c index 65d1c2ddf..65236be0f 100644 --- a/src/platforms/rcore_android.c +++ b/src/platforms/rcore_android.c @@ -886,8 +886,8 @@ void ClosePlatform(void) // NOTE: Reset global state in case the activity is being relaunched if (platform.app->destroyRequested != 0) { - CORE = (CoreData){0}; - platform = (PlatformData){0}; + CORE = (CoreData){ 0 }; + platform = (PlatformData){ 0 }; } } diff --git a/src/platforms/rcore_drm.c b/src/platforms/rcore_drm.c index b296e0042..68431030b 100644 --- a/src/platforms/rcore_drm.c +++ b/src/platforms/rcore_drm.c @@ -915,7 +915,7 @@ void SwapScreenBuffer(void) { TRACELOG(LOG_ERROR, "DISPLAY: Failed to get DRM resources"); drmModeRmFB(platform.fd, fb); - struct drm_mode_destroy_dumb dreq = {0}; + struct drm_mode_destroy_dumb dreq = { 0 }; dreq.handle = creq.handle; drmIoctl(platform.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq); return; @@ -955,7 +955,7 @@ void SwapScreenBuffer(void) { TRACELOG(LOG_ERROR, "DISPLAY: No compatible CRTC found"); drmModeRmFB(platform.fd, fb); - struct drm_mode_destroy_dumb dreq = {0}; + struct drm_mode_destroy_dumb dreq = { 0 }; dreq.handle = creq.handle; drmIoctl(platform.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq); return; @@ -971,7 +971,7 @@ void SwapScreenBuffer(void) TRACELOG(LOG_ERROR, "DISPLAY: Mode: %dx%d@%d", mode->hdisplay, mode->vdisplay, mode->vrefresh); drmModeRmFB(platform.fd, fb); - struct drm_mode_destroy_dumb dreq = {0}; + struct drm_mode_destroy_dumb dreq = { 0 }; dreq.handle = creq.handle; drmIoctl(platform.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq); return; @@ -989,7 +989,7 @@ void SwapScreenBuffer(void) // Clean up previous dumb buffer if (platform.prevDumbHandle) { - struct drm_mode_destroy_dumb dreq = {0}; + struct drm_mode_destroy_dumb dreq = { 0 }; dreq.handle = platform.prevDumbHandle; drmIoctl(platform.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq); } diff --git a/tools/rexm/rexm.c b/tools/rexm/rexm.c index ad9bcbed0..70001a5f3 100644 --- a/tools/rexm/rexm.c +++ b/tools/rexm/rexm.c @@ -1556,7 +1556,7 @@ int main(int argc, char *argv[]) "#include \n" "#include \n" "#include \n\n" - "static char logText[4096] = {0};\n" + "static char logText[4096] = { 0 };\n" "static int logTextOffset = 0;\n\n" "void CustomTraceLog(int msgType, const char *text, va_list args)\n{\n" " if (logTextOffset < 3800)\n {\n"