diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-09-04 10:56:14 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-09-04 12:06:27 -0400 |
commit | dc199f40fb03588af0bccb149a564e895e11d60d (patch) | |
tree | 8f8c33ca1d6f33d6705588646309056b3a226914 /src/lib/container/smartlist.h | |
parent | 539158f2be6001a7849b7a85e053e43d7d78195a (diff) | |
download | tor-dc199f40fb03588af0bccb149a564e895e11d60d.tar.gz tor-dc199f40fb03588af0bccb149a564e895e11d60d.zip |
smartlist_pqueue: use ptrdiff_t instead of int for offsets.
This is technically correct, but should not matter in practice,
since we don't use this on any structs whose size exceeds INT_MAX.
Diffstat (limited to 'src/lib/container/smartlist.h')
-rw-r--r-- | src/lib/container/smartlist.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/container/smartlist.h b/src/lib/container/smartlist.h index 81b0151433..25638e4b22 100644 --- a/src/lib/container/smartlist.h +++ b/src/lib/container/smartlist.h @@ -13,6 +13,7 @@ **/ #include <stdarg.h> +#include <stddef.h> #include "lib/smartlist_core/smartlist_core.h" #include "lib/smartlist_core/smartlist_foreach.h" @@ -72,18 +73,18 @@ int smartlist_bsearch_idx(const smartlist_t *sl, const void *key, void smartlist_pqueue_add(smartlist_t *sl, int (*compare)(const void *a, const void *b), - int idx_field_offset, + ptrdiff_t idx_field_offset, void *item); void *smartlist_pqueue_pop(smartlist_t *sl, int (*compare)(const void *a, const void *b), - int idx_field_offset); + ptrdiff_t idx_field_offset); void smartlist_pqueue_remove(smartlist_t *sl, int (*compare)(const void *a, const void *b), - int idx_field_offset, + ptrdiff_t idx_field_offset, void *item); void smartlist_pqueue_assert_ok(smartlist_t *sl, int (*compare)(const void *a, const void *b), - int idx_field_offset); + ptrdiff_t idx_field_offset); char *smartlist_join_strings(smartlist_t *sl, const char *join, int terminate, size_t *len_out) ATTR_MALLOC; |