diff options
author | HampusM <hampus@hampusmat.com> | 2022-01-07 17:18:30 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-01-07 17:18:30 +0100 |
commit | 02dee3370f1420b208c546194ac67322fe563a24 (patch) | |
tree | 183df0b5267c233d658f0fd3cb5bfd87eb11b402 /src/grid.c | |
parent | 813c98b028c9ba484fb5b21a60067ae35cc925ff (diff) |
refactor: add explicit int types
Diffstat (limited to 'src/grid.c')
-rw-r--r-- | src/grid.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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); |