Sun, 07 Feb 2021 20:08:13 +0100
changes off_t to ptrdiff_t
src/cx/linked_list.h | file | annotate | diff | comparison | revisions | |
src/linked_list.c | file | annotate | diff | comparison | revisions |
--- a/src/cx/linked_list.h Sun Feb 07 20:05:26 2021 +0100 +++ b/src/cx/linked_list.h Sun Feb 07 20:08:13 2021 +0100 @@ -29,11 +29,12 @@ #ifndef UCX_LINKED_LIST_H #define UCX_LINKED_LIST_H +#include <stddef.h> #include "list.h" -void *cx_linked_list_last(void **begin, void **end, off_t loc_next); +void *cx_linked_list_last(void **begin, void **end, ptrdiff_t loc_next); -int cx_linked_list_add(void **begin, void **end, off_t loc_next, off_t loc_prev, void *newnode); +int cx_linked_list_add(void **begin, void **end, ptrdiff_t loc_next, ptrdiff_t loc_prev, void *newnode); CxList cxLinkedListCreate(CxAllocator allocator, CxListComparator comparator);
--- a/src/linked_list.c Sun Feb 07 20:05:26 2021 +0100 +++ b/src/linked_list.c Sun Feb 07 20:08:13 2021 +0100 @@ -27,13 +27,12 @@ */ #include "cx/linked_list.h" -#include <stddef.h> /* LOW LEVEL LINKED LIST FUNCTIONS */ #define CX_LL_PTR(cur, off) ((void**)(((char*)cur)+off)) -void *cx_linked_list_last(void **begin, void **end, off_t loc_next) { +void *cx_linked_list_last(void **begin, void **end, ptrdiff_t loc_next) { if (end != NULL) { return *end; } else { @@ -50,7 +49,7 @@ } } -int cx_linked_list_add(void **begin, void **end, off_t loc_next, off_t loc_prev, void *newnode) { +int cx_linked_list_add(void **begin, void **end, ptrdiff_t loc_next, ptrdiff_t loc_prev, void *newnode) { // TODO: how do we report error messages? if (loc_next < 0 || (begin == NULL && end == NULL)) { return 1;