This module currently supports removing but not inserting at a
specified index, so this adds that along with some tests. Inserting a
value moves all existing data beyond index over one element.
Signed-off-by: Damien Grassart
---
ccan/darray/darray.h | 7 +++
The memmove() call should be using the index argument to determine the
number of bytes to copy. To be consistent with the rest of the code,
we should also not evaluate the index parameter multiple
times. Calling this with rand() % arr.size would otherwise generally
segfault.
Finally, we want to
Identifiers starting with underscores are technically reserved for
system use, so rename all of them to end with one instead.
Signed-off-by: Damien Grassart
---
ccan/darray/darray.h | 68 ++--
1 file changed, 34 insertions(+),
On Tue, Aug 29, 2017 at 12:08:40PM +0200, Damien Grassart wrote:
> This module currently supports removing but not inserting at a
> specified index, so this adds that along with some tests. Inserting a
> value moves all existing data beyond index over one element.
>
> Signed-off-by: Damien