From 7344a22c3ae7266c9748121ccee8b743749fb2ba Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Tue, 15 Jun 2021 07:20:58 -0700 Subject: [PATCH] Fixed compiler warning --- src/poker/card.c | 4 +--- src/poker/card.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/poker/card.c b/src/poker/card.c index ad5044be..524c5f17 100644 --- a/src/poker/card.c +++ b/src/poker/card.c @@ -28,16 +28,14 @@ void cardHandSort(card_t *cards, uint8_t length) { arraySort(sizeof(card_t), cards, (int32_t)length, &_cardSorter); } -int32_t _cardSorter(void *left, void *right) { +int32_t _cardSorter(const void* left, const void* right) { card_t cardL = *((card_t *)left); card_t cardR = *((card_t *)right); uint8_t suitL = cardGetSuit(cardL); uint8_t suitR = cardGetSuit(cardR); - if(suitL != suitR) return suitL - suitR; - uint8_t numberL = cardGetNumber(cardL); uint8_t numberR = cardGetNumber(cardR); diff --git a/src/poker/card.h b/src/poker/card.h index 448fe8db..414723c1 100644 --- a/src/poker/card.h +++ b/src/poker/card.h @@ -43,4 +43,4 @@ void cardDeal(card_t *source, uint8_t *sourceSize, card_t *dest, */ void cardHandSort(card_t *cards, uint8_t length); -int32_t _cardSorter(void *left, void *right); \ No newline at end of file +int32_t _cardSorter(const void* left, const void* right); \ No newline at end of file