~kdsch/c-modules

64b6a25de9a6bd0b8e30a62cdf5a0538b57a0437 — Karl Schultheisz 5 months ago cea4967
dynamic-array: add some const qualifiers
1 files changed, 6 insertions(+), 6 deletions(-)

M dynamic-array.c
M dynamic-array.c => dynamic-array.c +6 -6
@@ 17,14 17,14 @@ struct array {
};

void
array_init(struct array *a)
array_init(struct array *const a)
{
	assert(a != NULL);
	memset(a, 0, sizeof(*a));
}

static bool
array_full(const struct array *a)
array_full(const struct array *const a)
{
	assert(a != NULL);



@@ 32,7 32,7 @@ array_full(const struct array *a)
}

static enum status
array_grow(struct array *a)
array_grow(struct array *const a)
{
	assert(a != NULL);



@@ 52,10 52,10 @@ array_grow(struct array *a)
}

enum status
array_append(struct array *a, uint32_t x)
array_append(struct array *const a, const uint32_t x)
{
	if (array_full(a)) {
		enum status status = array_grow(a);
		const enum status status = array_grow(a);
		if (status != STATUS_OK) {
			return status;
		}


@@ 70,7 70,7 @@ array_append(struct array *a, uint32_t x)
}

void
array_free(struct array *a)
array_free(struct array *const a)
{
	assert(a != NULL);