diff options
author | irungentoo <irungentoo@gmail.com> | 2015-05-01 15:13:38 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2015-05-01 15:13:38 -0400 |
commit | 7d13f1928e604b87c29ca22d8bf14e962c1cc8ed (patch) | |
tree | 4c9ff324a2516b3c5a7136dedc95fcf5f82a9038 /toxcore/list.c | |
parent | b2c966a6e39cb9c7be9b498da2e603e0111e5223 (diff) |
Fixed some non standard C.
Replaced void * with uint8_t * in list.c
Diffstat (limited to 'toxcore/list.c')
-rw-r--r-- | toxcore/list.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/toxcore/list.c b/toxcore/list.c index 301e56f8..8bb71306 100644 --- a/toxcore/list.c +++ b/toxcore/list.c | |||
@@ -45,7 +45,7 @@ | |||
45 | * < 0 : no match, returns index (return value is INDEX(index)) where | 45 | * < 0 : no match, returns index (return value is INDEX(index)) where |
46 | * the data should be inserted | 46 | * the data should be inserted |
47 | */ | 47 | */ |
48 | static int find(const BS_LIST *list, const void *data) | 48 | static int find(const BS_LIST *list, const uint8_t *data) |
49 | { | 49 | { |
50 | //should work well, but could be improved | 50 | //should work well, but could be improved |
51 | if (list->n == 0) { | 51 | if (list->n == 0) { |
@@ -113,7 +113,7 @@ static int find(const BS_LIST *list, const void *data) | |||
113 | */ | 113 | */ |
114 | static int resize(BS_LIST *list, uint32_t new_size) | 114 | static int resize(BS_LIST *list, uint32_t new_size) |
115 | { | 115 | { |
116 | void *p; | 116 | uint8_t *p; |
117 | 117 | ||
118 | p = realloc(list->data, list->element_size * new_size); | 118 | p = realloc(list->data, list->element_size * new_size); |
119 | 119 | ||
@@ -162,7 +162,7 @@ void bs_list_free(BS_LIST *list) | |||
162 | free(list->ids); | 162 | free(list->ids); |
163 | } | 163 | } |
164 | 164 | ||
165 | int bs_list_find(const BS_LIST *list, const void *data) | 165 | int bs_list_find(const BS_LIST *list, const uint8_t *data) |
166 | { | 166 | { |
167 | int r = find(list, data); | 167 | int r = find(list, data); |
168 | 168 | ||
@@ -174,7 +174,7 @@ int bs_list_find(const BS_LIST *list, const void *data) | |||
174 | return list->ids[r]; | 174 | return list->ids[r]; |
175 | } | 175 | } |
176 | 176 | ||
177 | int bs_list_add(BS_LIST *list, const void *data, int id) | 177 | int bs_list_add(BS_LIST *list, const uint8_t *data, int id) |
178 | { | 178 | { |
179 | //find where the new element should be inserted | 179 | //find where the new element should be inserted |
180 | //see: return value of find() | 180 | //see: return value of find() |
@@ -214,7 +214,7 @@ int bs_list_add(BS_LIST *list, const void *data, int id) | |||
214 | return 1; | 214 | return 1; |
215 | } | 215 | } |
216 | 216 | ||
217 | int bs_list_remove(BS_LIST *list, const void *data, int id) | 217 | int bs_list_remove(BS_LIST *list, const uint8_t *data, int id) |
218 | { | 218 | { |
219 | int i = find(list, data); | 219 | int i = find(list, data); |
220 | 220 | ||