summaryrefslogtreecommitdiff
path: root/toxcore/list.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2015-05-01 15:13:38 -0400
committerirungentoo <irungentoo@gmail.com>2015-05-01 15:13:38 -0400
commit7d13f1928e604b87c29ca22d8bf14e962c1cc8ed (patch)
tree4c9ff324a2516b3c5a7136dedc95fcf5f82a9038 /toxcore/list.c
parentb2c966a6e39cb9c7be9b498da2e603e0111e5223 (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.c10
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 */
48static int find(const BS_LIST *list, const void *data) 48static 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 */
114static int resize(BS_LIST *list, uint32_t new_size) 114static 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
165int bs_list_find(const BS_LIST *list, const void *data) 165int 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
177int bs_list_add(BS_LIST *list, const void *data, int id) 177int 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
217int bs_list_remove(BS_LIST *list, const void *data, int id) 217int 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