FreeCalypso > hg > themwi-system-sw
diff utils/themwi-update-numdb2.c @ 230:803829e6244f
themwi-update-numdb2: more sensible sort comparison functions
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 14 Aug 2023 11:09:35 -0800 |
parents | 626824449ddf |
children | abb3f415b9dd |
line wrap: on
line diff
--- a/utils/themwi-update-numdb2.c Mon Aug 14 10:41:23 2023 -0800 +++ b/utils/themwi-update-numdb2.c Mon Aug 14 11:09:35 2023 -0800 @@ -383,30 +383,30 @@ static int compare_owned_num(p1, p2) - struct owned_number_rec *p1, *p2; + uint16_t *p1, *p2; { - if (p1->number[0] < p2->number[0]) + if (p1[0] < p2[0]) return(-1); - if (p1->number[0] > p2->number[0]) + if (p1[0] > p2[0]) return(1); - if (p1->number[1] < p2->number[1]) + if (p1[1] < p2[1]) return(-1); - if (p1->number[1] > p2->number[1]) + if (p1[1] > p2[1]) return(1); - if (p1->number[2] < p2->number[2]) + if (p1[2] < p2[2]) return(-1); - if (p1->number[2] > p2->number[2]) + if (p1[2] > p2[2]) return(1); return(0); } static int compare_short_num(p1, p2) - struct short_number_rec *p1, *p2; + uint16_t *p1, *p2; { - if (p1->short_num < p2->short_num) + if (*p1 < *p2) return(-1); - if (p1->short_num > p2->short_num) + if (*p1 > *p2) return(1); return(0); }