Changeset 7f1c620 in mainline for generic/src/lib/sort.c
- Timestamp:
- 2006-07-04T17:17:56Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0ffa3ef5
- Parents:
- 991779c5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/lib/sort.c
r991779c5 r7f1c620 64 64 void qsort(void * data, count_t n, size_t e_size, int (* cmp) (void * a, void * b)) 65 65 { 66 __u8buf_tmp[EBUFSIZE];67 __u8buf_pivot[EBUFSIZE];66 uint8_t buf_tmp[EBUFSIZE]; 67 uint8_t buf_pivot[EBUFSIZE]; 68 68 void * tmp = buf_tmp; 69 69 void * pivot = buf_pivot; … … 133 133 void bubblesort(void * data, count_t n, size_t e_size, int (* cmp) (void * a, void * b)) 134 134 { 135 __u8buf_slot[EBUFSIZE];135 uint8_t buf_slot[EBUFSIZE]; 136 136 void * slot = buf_slot; 137 137 … … 185 185 } 186 186 187 int __u8_cmp(void * a, void * b)188 { 189 return (* ( __u8 *) a > * (__u8 *)b) ? 1 : (*(__u8 *)a < * (__u8*)b) ? -1 : 0;190 } 191 192 int __u16_cmp(void * a, void * b)193 { 194 return (* ( __u16 *) a > * (__u16 *)b) ? 1 : (*(__u16 *)a < * (__u16*)b) ? -1 : 0;195 } 196 197 int __u32_cmp(void * a, void * b)198 { 199 return (* ( __u32 *) a > * (__u32 *)b) ? 1 : (*(__u32 *)a < * (__u32*)b) ? -1 : 0;187 int uint8_t_cmp(void * a, void * b) 188 { 189 return (* (uint8_t *) a > * (uint8_t *)b) ? 1 : (*(uint8_t *)a < * (uint8_t *)b) ? -1 : 0; 190 } 191 192 int uint16_t_cmp(void * a, void * b) 193 { 194 return (* (uint16_t *) a > * (uint16_t *)b) ? 1 : (*(uint16_t *)a < * (uint16_t *)b) ? -1 : 0; 195 } 196 197 int uint32_t_cmp(void * a, void * b) 198 { 199 return (* (uint32_t *) a > * (uint32_t *)b) ? 1 : (*(uint32_t *)a < * (uint32_t *)b) ? -1 : 0; 200 200 } 201 201
Note:
See TracChangeset
for help on using the changeset viewer.