Changeset 7f1c620 in mainline for generic/src/lib/sort.c


Ignore:
Timestamp:
2006-07-04T17:17:56Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0ffa3ef5
Parents:
991779c5
Message:

Replace old u?? types with respective C99 variants (e.g. uint32_t, int64_t, uintptr_t etc.).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/lib/sort.c

    r991779c5 r7f1c620  
    6464void qsort(void * data, count_t n, size_t e_size, int (* cmp) (void * a, void * b))
    6565{
    66         __u8 buf_tmp[EBUFSIZE];
    67         __u8 buf_pivot[EBUFSIZE];
     66        uint8_t buf_tmp[EBUFSIZE];
     67        uint8_t buf_pivot[EBUFSIZE];
    6868        void * tmp = buf_tmp;
    6969        void * pivot = buf_pivot;
     
    133133void bubblesort(void * data, count_t n, size_t e_size, int (* cmp) (void * a, void * b))
    134134{
    135         __u8 buf_slot[EBUFSIZE];
     135        uint8_t buf_slot[EBUFSIZE];
    136136        void * slot = buf_slot;
    137137       
     
    185185}
    186186
    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;
     187int 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
     192int 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
     197int 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;
    200200}
    201201
Note: See TracChangeset for help on using the changeset viewer.