[formatting] run everything through codestyle

Almost nothing changes here except moving braces to the same line as the
function declaration. Everything else is largely whitespace changes and
a few dangling files with tab indents.

See scripts/codestyle
This commit is contained in:
Travis Geiselbrecht
2019-06-19 20:54:28 -07:00
parent 4f2d4841d8
commit d8fa82cb91
491 changed files with 6037 additions and 9035 deletions

View File

@@ -30,8 +30,7 @@
#define INCPTR(e, ptr, inc) \
modpow2((ptr) + (inc), (e)->len_pow2)
status_t evlog_init_etc(evlog_t *e, uint len, uint unitsize, uintptr_t *items)
{
status_t evlog_init_etc(evlog_t *e, uint len, uint unitsize, uintptr_t *items) {
if (len < 2 || !ispow2(len)) {
return ERR_INVALID_ARGS;
}
@@ -50,8 +49,7 @@ status_t evlog_init_etc(evlog_t *e, uint len, uint unitsize, uintptr_t *items)
return NO_ERROR;
}
status_t evlog_init(evlog_t *e, uint len, uint unitsize)
{
status_t evlog_init(evlog_t *e, uint len, uint unitsize) {
uintptr_t *items = calloc(1, len * sizeof(uintptr_t));
if (!items) {
return ERR_NO_MEMORY;
@@ -63,16 +61,14 @@ status_t evlog_init(evlog_t *e, uint len, uint unitsize)
return err;
}
uint evlog_bump_head(evlog_t *e)
{
uint evlog_bump_head(evlog_t *e) {
uint index = e->head;
e->head = INCPTR(e, e->head, e->unitsize);
return index;
}
void evlog_dump(evlog_t *e, evlog_dump_cb cb)
{
void evlog_dump(evlog_t *e, evlog_dump_cb cb) {
for (uint index = INCPTR(e, e->head, e->unitsize); index != e->head; index = INCPTR(e, index, e->unitsize)) {
cb(&e->items[index]);
}