Mercurial > code
comparison array.c @ 119:d6a78dea70c9
Fix names
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 28 Feb 2012 21:15:48 +0100 |
parents | 3c51b1f2974e |
children | 68784ea3fabb |
comparison
equal
deleted
inserted
replaced
118:3c51b1f2974e | 119:d6a78dea70c9 |
---|---|
162 /* | 162 /* |
163 * Remove the data at the specified index. Bounds are checked. | 163 * Remove the data at the specified index. Bounds are checked. |
164 */ | 164 */ |
165 | 165 |
166 void | 166 void |
167 array_remove(struct array *arr, int index) | 167 array_iremove(struct array *arr, int index) |
168 { | 168 { |
169 if (arr->length > 0 && index >= 0 && index < arr->length) { | 169 if (arr->length > 0 && index >= 0 && index < arr->length) { |
170 memmove((char *)arr->data + OFFSET(index), | 170 memmove((char *)arr->data + OFFSET(index), |
171 (char *)arr->data + OFFSET(index + 1), | 171 (char *)arr->data + OFFSET(index + 1), |
172 OFFSET(arr->length - index - 1)); | 172 OFFSET(arr->length - index - 1)); |
178 * Remove the object referenced by the `data' argument. Useful when you | 178 * Remove the object referenced by the `data' argument. Useful when you |
179 * don't know the index. | 179 * don't know the index. |
180 */ | 180 */ |
181 | 181 |
182 void | 182 void |
183 array_unref(struct array *arr, const void *data) | 183 array_premove(struct array *arr, const void *data) |
184 { | 184 { |
185 void *elm; | 185 void *elm; |
186 int i; | 186 int i; |
187 | 187 |
188 for (i = 0; i < arr->length; ++i) { | 188 for (i = 0; i < arr->length; ++i) { |