Update CLFAGS and resolve compiler warnings

This commit is contained in:
Night Kaly 2024-11-04 23:27:50 +00:00
parent 08bf232b7f
commit dddb133a62
Signed by: night0721
SSH key fingerprint: SHA256:B/hgVwUoBpx5vdNsXl9w8XwZljA9766uk6T4ubZp5HM
2 changed files with 4 additions and 4 deletions

View file

@ -6,7 +6,7 @@ TARGET = ace
PREFIX ?= /usr/local PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin BINDIR = $(PREFIX)/bin
CFLAGS = -O3 -march=native -mtune=native -pipe -s -std=c99 -flto -pedantic -Wall CFLAGS = -Os -march=native -mtune=native -pipe -s -std=c99 -flto -pedantic -Wall
SRC = ace.c SRC = ace.c

6
ace.c
View file

@ -13,13 +13,13 @@ typedef struct {
int suit; /* 0 to 3 (Hearts, Spades, Diamonds, Clubs) */ int suit; /* 0 to 3 (Hearts, Spades, Diamonds, Clubs) */
} card; } card;
card deal_card(); card deal_card(void);
int calculate_score(card hand[], int num_cards); int calculate_score(card hand[], int num_cards);
void display_hand(card hand[], int num_cards, int is_player, int total); void display_hand(card hand[], int num_cards, int is_player, int total);
struct termios orig_termios; struct termios orig_termios;
int main() int main(void)
{ {
srand(time(NULL)); srand(time(NULL));
@ -111,7 +111,7 @@ int main()
return 0; return 0;
} }
card deal_card() card deal_card(void)
{ {
card card; card card;
card.value = rand() % 13 + 1; card.value = rand() % 13 + 1;