From 5a08c01208559c05fd6cfbe57271a668e7160d36 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Tue, 22 Oct 2024 11:06:02 +0300 Subject: [PATCH] fix warnings --- src/rendering/twn_gl_15_rendering.c | 2 +- src/rendering/twn_rects.c | 4 ++-- src/rendering/twn_sprites.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rendering/twn_gl_15_rendering.c b/src/rendering/twn_gl_15_rendering.c index 68a90e4..13180e0 100644 --- a/src/rendering/twn_gl_15_rendering.c +++ b/src/rendering/twn_gl_15_rendering.c @@ -801,7 +801,7 @@ void finally_draw_uncolored_space_traingle_batch(const MeshBatch *batch, command.textured = true; command.texture_key = texture_key; - const GLuint primitives_len = arrlenu(batch->primitives); + const GLsizei primitives_len = (GLsizei)arrlenu(batch->primitives); command.primitive_count = 3 * primitives_len; DeferredCommand final_command = { diff --git a/src/rendering/twn_rects.c b/src/rendering/twn_rects.c index 7d6bf04..829c170 100644 --- a/src/rendering/twn_rects.c +++ b/src/rendering/twn_rects.c @@ -32,7 +32,7 @@ struct QuadBatch collect_rect_batch(const Primitive2D primitives[], size_t len) .constant_colored = true, }; - const uint32_t uniform_color = *(const uint32_t *)&primitives[0].rect.color; + const uint32_t uniform_color = *(const uint32_t *)(void const *)&primitives[0].rect.color; /* batch size is clamped so that reallocated short indices could be used */ if (len >= QUAD_ELEMENT_BUFFER_LENGTH) @@ -50,7 +50,7 @@ struct QuadBatch collect_rect_batch(const Primitive2D primitives[], size_t len) break; /* if all are modulated the same we can skip sending the color data */ - if (*(const uint32_t *)¤t->rect.color != uniform_color) + if (*(const uint32_t *)(void const *)¤t->rect.color != uniform_color) batch.constant_colored = false; ++batch.size; diff --git a/src/rendering/twn_sprites.c b/src/rendering/twn_sprites.c index 49354ea..0567dfe 100644 --- a/src/rendering/twn_sprites.c +++ b/src/rendering/twn_sprites.c @@ -75,7 +75,7 @@ struct QuadBatch collect_sprite_batch(const Primitive2D primitives[], size_t len .textured = true, }; - const uint32_t uniform_color = *(const uint32_t *)&primitives[0].sprite.color; + const uint32_t uniform_color = *(const uint32_t *)(void const*)&primitives[0].sprite.color; /* batch size is clamped so that reallocated short indices could be used */ if (len >= QUAD_ELEMENT_BUFFER_LENGTH) @@ -109,7 +109,7 @@ struct QuadBatch collect_sprite_batch(const Primitive2D primitives[], size_t len } /* if all are modulated the same we can skip sending the color data */ - if (*(const uint32_t *)¤t->sprite.color != uniform_color) + if (*(const uint32_t *)(void const *)¤t->sprite.color != uniform_color) batch.constant_colored = false; ++batch.size; @@ -132,7 +132,7 @@ void render_sprite_batch(const Primitive2D primitives[], textures_get_dims(&ctx.texture_cache, primitives->sprite.texture_key); /* cached srcrect */ - Rect cached_srcrect; + Rect cached_srcrect = {0}; TextureKey cached_srcrect_key = TEXTURE_KEY_INVALID; /* vertex population over a vertex buffer builder interface */