From dddb133a62f8b04ac04e725cbb73ba0d6df39c43 Mon Sep 17 00:00:00 2001 From: night0721 Date: Mon, 4 Nov 2024 23:27:50 +0000 Subject: [PATCH] Update CLFAGS and resolve compiler warnings --- Makefile | 2 +- ace.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d62b121..726515c 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ TARGET = ace PREFIX ?= /usr/local 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 diff --git a/ace.c b/ace.c index 07b12e2..74c9f5a 100644 --- a/ace.c +++ b/ace.c @@ -13,13 +13,13 @@ typedef struct { int suit; /* 0 to 3 (Hearts, Spades, Diamonds, Clubs) */ } card; -card deal_card(); +card deal_card(void); int calculate_score(card hand[], int num_cards); void display_hand(card hand[], int num_cards, int is_player, int total); struct termios orig_termios; -int main() +int main(void) { srand(time(NULL)); @@ -111,7 +111,7 @@ int main() return 0; } -card deal_card() +card deal_card(void) { card card; card.value = rand() % 13 + 1;