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 {
|
||||
size_t len;
|
||||
size_t capacity;
|
||||
void **ptrs;
|
||||
size_t len;
|
||||
size_t capacity;
|
||||
void **ptrs;
|
||||
};
|
||||
|
||||
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) {
|
||||
void **ps;
|
||||
size_t oldcap = vec->capacity;
|
||||
if (vec->capacity == 0)
|
||||
vec->capacity = 1;
|
||||
else
|
||||
if (vec->capacity == 0)
|
||||
vec->capacity = 1;
|
||||
else
|
||||
vec->capacity *= 2;
|
||||
ps = realloc(vec->ptrs, vec->capacity * sizeof(void *));
|
||||
assert(ps != NULL);
|
||||
ps = realloc(vec->ptrs, vec->capacity * sizeof(void *));
|
||||
assert(ps != NULL);
|
||||
memset(vec->ptrs + oldcap, 0, (vec->capacity - oldcap) * sizeof(void *));
|
||||
vec->ptrs = ps;
|
||||
}
|
||||
vec->ptrs[vec->len] = p;
|
||||
++vec->len;
|
||||
vec->ptrs = ps;
|
||||
}
|
||||
vec->ptrs[vec->len] = p;
|
||||
++vec->len;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user