clang-format: Minor whitespace issues.
These are entirely my fault, sadly. Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
This commit is contained in:
parent
54093060cb
commit
f74c418f47
@ -261,9 +261,9 @@ struct blog_entry_t {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct ptr_vector {
|
struct ptr_vector {
|
||||||
size_t len;
|
size_t len;
|
||||||
size_t capacity;
|
size_t capacity;
|
||||||
void **ptrs;
|
void **ptrs;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern void init_ptr_vector(struct ptr_vector *vec);
|
extern void init_ptr_vector(struct ptr_vector *vec);
|
||||||
|
18
src/util.c
18
src/util.c
@ -134,17 +134,17 @@ int ptr_vector_append(struct ptr_vector *vec, void *p) {
|
|||||||
if (vec->len == vec->capacity) {
|
if (vec->len == vec->capacity) {
|
||||||
void **ps;
|
void **ps;
|
||||||
size_t oldcap = vec->capacity;
|
size_t oldcap = vec->capacity;
|
||||||
if (vec->capacity == 0)
|
if (vec->capacity == 0)
|
||||||
vec->capacity = 1;
|
vec->capacity = 1;
|
||||||
else
|
else
|
||||||
vec->capacity *= 2;
|
vec->capacity *= 2;
|
||||||
ps = realloc(vec->ptrs, vec->capacity * sizeof(void *));
|
ps = realloc(vec->ptrs, vec->capacity * sizeof(void *));
|
||||||
assert(ps != NULL);
|
assert(ps != NULL);
|
||||||
memset(vec->ptrs + oldcap, 0, (vec->capacity - oldcap) * sizeof(void *));
|
memset(vec->ptrs + oldcap, 0, (vec->capacity - oldcap) * sizeof(void *));
|
||||||
vec->ptrs = ps;
|
vec->ptrs = ps;
|
||||||
}
|
}
|
||||||
vec->ptrs[vec->len] = p;
|
vec->ptrs[vec->len] = p;
|
||||||
++vec->len;
|
++vec->len;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user