diff options
| author | Mario Kilies <MarioKilies@GMX.net> | 2011-01-16 07:57:28 +0100 |
|---|---|---|
| committer | Mario Kilies <MarioKilies@GMX.net> | 2011-01-16 07:57:28 +0100 |
| commit | fac5e3de0929c3abb73da552efbda6d641136588 (patch) | |
| tree | 2d1c20909525e657237389a9825e3c3a73dad726 /src/hand.c | |
| parent | 08a3c0b9979857e708865d2756ba057bb1c664ee (diff) | |
Simplified net_recv(). Refactored 'hand' from array definition to hand_t struct definition.
Diffstat (limited to 'src/hand.c')
| -rw-r--r-- | src/hand.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,5 +1,6 @@ #include "hand.h" #include <stdlib.h> +#include <assert.h> #include "card.h" static int hand_comparator(const void *a, const void *b) @@ -10,7 +11,8 @@ static int hand_comparator(const void *a, const void *b) return c1 - c2; } -void hand_sort(hand h) +void hand_sort(hand_t *h) { - qsort(h, MAX_HAND_CARDS, sizeof(card), hand_comparator); + assert(h != NULL); + qsort(h->cards, MAX_HAND_CARDS, sizeof(card), hand_comparator); } |
