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