Skip to content

Commit

Permalink
Fixing some warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chukobyte committed Mar 2, 2024
1 parent 8d9a26f commit 1aa6f4a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion seika/data_structures/se_static_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ARRAY_NAME ##_count = 0;

#define SE_STATIC_ARRAY_SORT_INT(ARRAY_NAME) \
if (SE_STATIC_ARRAY_SIZE(ARRAY_NAME) > 0) { \
se_array_utils_selection_sort_int(ARRAY_NAME, (size_t) SE_STATIC_ARRAY_SIZE(ARRAY_NAME)); \
se_array_utils_selection_sort_int(ARRAY_NAME, (int)SE_STATIC_ARRAY_SIZE(ARRAY_NAME)); \
}

// Array Utils (TODO: Move in own file)
Expand Down
10 changes: 5 additions & 5 deletions seika/data_structures/ska_array2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "../memory/se_mem.h"
#include "seika/utils/se_assert.h"

#define SKA_ARRAY2D_IS_VALID_COORD(ARRAY2D, ROW, COL) (!(ROW >= ARRAY2D->size.w || COL >= ARRAY2D->size.h))
#define SKA_ARRAY2D_IS_VALID_COORD(ARRAY2D, ROW, COL) (!((int)ROW >= ARRAY2D->size.w || (int)COL >= ARRAY2D->size.h))

SkaArray2D* ska_array2d_create(size_t rows, size_t cols, size_t elementSize) {
SkaArray2D* newArray = SE_MEM_ALLOCATE(SkaArray2D);
Expand All @@ -19,7 +19,7 @@ SkaArray2D* ska_array2d_create(size_t rows, size_t cols, size_t elementSize) {
}

void ska_array2d_destroy(SkaArray2D* array2d) {
for (size_t i = 0; i < array2d->size.h; i++) {
for (int i = 0; i < array2d->size.h; i++) {
SE_MEM_FREE(array2d->data[i]);
}
SE_MEM_FREE(array2d->data);
Expand Down Expand Up @@ -74,13 +74,13 @@ void ska_array2d_reset(SkaArray2D* array2d) {

void ska_array2d_reset_default(SkaArray2D* array2d, void* defaultValue) {
if (defaultValue) {
for (size_t y = 0; y < array2d->size.h; y++) {
for (size_t x = 0; x < array2d->size.w; x++) {
for (int y = 0; y < array2d->size.h; y++) {
for (int x = 0; x < array2d->size.w; x++) {
ska_array2d_set(array2d, x, y, defaultValue);
}
}
} else {
for (size_t i = 0; i < array2d->size.h; i++) {
for (int i = 0; i < array2d->size.h; i++) {
memset(array2d->data[i], 0, array2d->size.w * array2d->elementSize);
}
}
Expand Down
4 changes: 2 additions & 2 deletions seika/rendering/renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void ska_renderer_queue_sprite_draw(SETexture* texture, SKARect2 sourceRect, SKA
se_logger_error("NULL texture, not submitting draw call!");
return;
}
SpriteBatchItem item = { .texture = texture, .sourceRect = sourceRect, .destSize = destSize, .color = color, .flipH = flipH, .flipV = flipV, .transform2D = {0}, .shaderInstance = shaderInstance };
SpriteBatchItem item = (SpriteBatchItem){ .texture = texture, .sourceRect = sourceRect, .destSize = destSize, .color = color, .flipH = flipH, .flipV = flipV, .transform2D = {0}, .shaderInstance = shaderInstance };

Check warning on line 193 in seika/rendering/renderer.c

View workflow job for this annotation

GitHub Actions / build

missing braces around initializer [-Wmissing-braces]

Check warning on line 193 in seika/rendering/renderer.c

View workflow job for this annotation

GitHub Actions / build

missing braces around initializer [-Wmissing-braces]
ska_transform2d_transform_to_mat4(transform2D, item.transform2D.model);
ska_renderer_queue_sprite_draw_call(&item, zIndex);
}
Expand All @@ -200,7 +200,7 @@ void ska_renderer_queue_sprite_draw2(SETexture* texture, SKARect2 sourceRect, SK
se_logger_error("NULL texture, not submitting draw call!");
return;
}
SpriteBatchItem item = { .texture = texture, .sourceRect = sourceRect, .destSize = destSize, .color = color, .flipH = flipH, .flipV = flipV, .transform2D = {0}, .shaderInstance = shaderInstance };
SpriteBatchItem item = (SpriteBatchItem){ .texture = texture, .sourceRect = sourceRect, .destSize = destSize, .color = color, .flipH = flipH, .flipV = flipV, .transform2D = {0}, .shaderInstance = shaderInstance };

Check warning on line 203 in seika/rendering/renderer.c

View workflow job for this annotation

GitHub Actions / build

missing braces around initializer [-Wmissing-braces]

Check warning on line 203 in seika/rendering/renderer.c

View workflow job for this annotation

GitHub Actions / build

missing braces around initializer [-Wmissing-braces]
glm_mat4_copy(trsMatrix, item.transform2D.model);
ska_renderer_queue_sprite_draw_call(&item, zIndex);
}
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "seika",
"version": "0.0.43",
"version": "0.0.44",
"dependencies": [
{
"name": "sdl2",
Expand Down

0 comments on commit 1aa6f4a

Please sign in to comment.