From 02dee3370f1420b208c546194ac67322fe563a24 Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 7 Jan 2022 17:18:30 +0100 Subject: refactor: add explicit int types --- src/grid.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/grid.c') diff --git a/src/grid.c b/src/grid.c index 3554779..1ad01cd 100644 --- a/src/grid.c +++ b/src/grid.c @@ -13,11 +13,11 @@ Grid grid_create(unsigned int width, unsigned int height, char *fill) Grid grid = {.grid = malloc_s(mem_height), .dimens = dimens}; // Fill the grid - for (unsigned int y = 0; y < height; y++) + for (unsigned int y = 0U; y < height; y++) { grid.grid[y] = malloc_s(mem_width); - for (unsigned int x = 0; x < width; x++) + for (unsigned int x = 0U; x < width; x++) grid.grid[y][x] = fill; } @@ -36,9 +36,9 @@ void grid_set(Grid grid, Position pos, char *value) void grid_print(Grid grid) { - for (unsigned int y = 0; y < grid.dimens.height; y++) + for (unsigned int y = 0U; y < grid.dimens.height; y++) { - for (unsigned int x = 0; x < grid.dimens.width; x++) + for (unsigned int x = 0U; x < grid.dimens.width; x++) printf("%s", grid.grid[y][x]); printf("\n"); @@ -48,7 +48,7 @@ void grid_print(Grid grid) void grid_destroy(Grid grid) { // Deallocate the memory of the grid - for (unsigned int y = 0; y < grid.dimens.height; y++) + for (unsigned int y = 0U; y < grid.dimens.height; y++) free(grid.grid[y]); free(grid.grid); -- cgit v1.2.3-18-g5258