Fixed compiler warning

This commit is contained in:
2021-06-15 07:20:58 -07:00
parent baa79fc646
commit 7344a22c3a
2 changed files with 2 additions and 4 deletions

View File

@ -28,16 +28,14 @@ void cardHandSort(card_t *cards, uint8_t length) {
arraySort(sizeof(card_t), cards, (int32_t)length, &_cardSorter); 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 cardL = *((card_t *)left);
card_t cardR = *((card_t *)right); card_t cardR = *((card_t *)right);
uint8_t suitL = cardGetSuit(cardL); uint8_t suitL = cardGetSuit(cardL);
uint8_t suitR = cardGetSuit(cardR); uint8_t suitR = cardGetSuit(cardR);
if(suitL != suitR) return suitL - suitR; if(suitL != suitR) return suitL - suitR;
uint8_t numberL = cardGetNumber(cardL); uint8_t numberL = cardGetNumber(cardL);
uint8_t numberR = cardGetNumber(cardR); uint8_t numberR = cardGetNumber(cardR);

View File

@ -43,4 +43,4 @@ void cardDeal(card_t *source, uint8_t *sourceSize, card_t *dest,
*/ */
void cardHandSort(card_t *cards, uint8_t length); void cardHandSort(card_t *cards, uint8_t length);
int32_t _cardSorter(void *left, void *right); int32_t _cardSorter(const void* left, const void* right);