diff options
-rw-r--r-- | list.c | 11 | ||||
-rw-r--r-- | list.h | 2 | ||||
-rw-r--r-- | smenu.c | 11 | ||||
-rw-r--r-- | smenu.h | 2 | ||||
-rw-r--r-- | utils.c | 6 | ||||
-rw-r--r-- | utils.h | 2 |
6 files changed, 18 insertions, 16 deletions
@@ -24,11 +24,11 @@ static ll_node_t * ll_partition(ll_node_t * l, ll_node_t * h, int (*comp)(void *, void *), - void (*swap)(void *, void *)); + void (*swap)(void **, void **)); static void ll_quicksort(ll_node_t * l, ll_node_t * h, int (*comp)(void *, void *), - void (*swap)(void *, void *)); + void (*swap)(void **, void **)); /* ========================== */ /* Creates a new linked list. */ @@ -185,7 +185,7 @@ ll_insert_after(ll_t * const list, ll_node_t * node, void * const data) /* ====================================================== */ static ll_node_t * ll_partition(ll_node_t * l, ll_node_t * h, int (*comp)(void *, void *), - void (*swap)(void *, void *)) + void (*swap)(void **, void **)) { /* Considers last element as pivot, places the pivot element at its */ /* correct position in sorted array, and places all smaller (smaller than */ @@ -222,7 +222,7 @@ ll_partition(ll_node_t * l, ll_node_t * h, int (*comp)(void *, void *), /* ======================================================== */ static void ll_quicksort(ll_node_t * l, ll_node_t * h, int (*comp)(void *, void *), - void (*swap)(void *, void *)) + void (*swap)(void **, void **)) { if (h != NULL && l != h && l != h->next) { @@ -236,7 +236,8 @@ ll_quicksort(ll_node_t * l, ll_node_t * h, int (*comp)(void *, void *), /* A linked list sort function. */ /* ============================ */ void -ll_sort(ll_t * list, int (*comp)(void *, void *), void (*swap)(void *, void *)) +ll_sort(ll_t * list, int (*comp)(void *, void *), + void (*swap)(void **, void **)) { /* Call the recursive ll_quicksort function. */ /* """"""""""""""""""""""""""""""""""""""""" */ @@ -51,7 +51,7 @@ ll_insert_after(ll_t * const list, ll_node_t * node, void * const data); void ll_sort(ll_t * list, int (*comp)(void *, void *), - void (*swap)(void * a, void *)); + void (*swap)(void **, void **)); int ll_delete(ll_t * const list, ll_node_t * node); @@ -875,12 +875,13 @@ tag_comp(void * a, void * b) /* Swap the values of two selected words in the output list. */ /* ========================================================= */ void -tag_swap(void * a, void * b) +tag_swap(void ** a, void ** b) { - output_t * oa = *(output_t **)a; - output_t * ob = *(output_t **)b; - char * tmp_str; - long tmp_order; + output_t * oa = (output_t *)*a; + output_t * ob = (output_t *)*b; + + char * tmp_str; + long tmp_order; tmp_str = oa->output_str; oa->output_str = ob->output_str; @@ -430,7 +430,7 @@ int tag_comp(void * a, void * b); void -tag_swap(void * a, void * b); +tag_swap(void * *a, void ** b); int isempty(const char * s); @@ -65,10 +65,10 @@ interval_comp(void * a, void * b) /* Swaps the values of two intervals. */ /* ================================== */ void -interval_swap(void * a, void * b) +interval_swap(void ** a, void ** b) { - interval_t * ia = *(interval_t **)a; - interval_t * ib = *(interval_t **)b; + interval_t * ia = (interval_t *)*a; + interval_t * ib = (interval_t *)*b; long tmp; tmp = ia->low; @@ -33,7 +33,7 @@ int interval_comp(void * a, void * b); void -interval_swap(void * a, void * b); +interval_swap(void ** a, void ** b); void merge_intervals(ll_t * list); |