From f85bfe4cfdc6b03ff66a874d4d1028e291bccda4 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Thu, 24 Oct 2024 14:18:30 -0400 Subject: small type fixes --- lib/cetris.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/cetris.h b/lib/cetris.h index 5ae3dae..6f3ea77 100755 --- a/lib/cetris.h +++ b/lib/cetris.h @@ -12,7 +12,7 @@ typedef struct { - char x; + char x; char y; } ctrs_vec2; @@ -224,7 +224,7 @@ static const ctrs_vec2 basic_movements[3] = { static void update_board(ctrs_game *g); static void -set_piece(ctrs_game *g, uint8_t type, ctrs_mino* mino) +set_piece(ctrs_game *g, unsigned char type, ctrs_mino* mino) { memset(mino, 0, sizeof(ctrs_mino)); @@ -758,9 +758,9 @@ ctrs_init_game(ctrs_game *g) memset(g, 0, sizeof(ctrs_game) - sizeof(ctrs_config)); - g->board = calloc(g->config.board_x, sizeof(unsigned char *)); + g->board = (unsigned char **)calloc(g->config.board_x, sizeof(unsigned char *)); for (int i = 0; i < g->config.board_x; i++) - g->board[i] = calloc(g->config.board_y, sizeof(unsigned char)); + g->board[i] = (unsigned char *)calloc(g->config.board_y, sizeof(unsigned char)); g->line_remove_tick = (unsigned long *)calloc(g->config.board_y, sizeof(unsigned long)); @@ -769,7 +769,7 @@ ctrs_init_game(ctrs_game *g) g->highest_line = g->config.board_y; - for (int i = 0; i < 7; i++) + for (unsigned char i = 0; i < 7; i++) g->next_queue[i] = i; shuffle_queue(g); -- cgit v1.2.3-101-g0448