diff options
author | June McEnroe <june@causal.agency> | 2018-11-25 20:53:34 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2018-11-25 20:53:34 -0500 |
commit | 3106ccf7551ef1dc8b0279b032b8c53655fe3c42 (patch) | |
tree | d80585c6099857af440460e504f92255a1c4001a /bin/edi/log.c | |
parent | Implement deserialization in edi (diff) | |
download | src-3106ccf7551ef1dc8b0279b032b8c53655fe3c42.tar.gz src-3106ccf7551ef1dc8b0279b032b8c53655fe3c42.zip |
Return enum Error from file functions in edi
Diffstat (limited to 'bin/edi/log.c')
-rw-r--r-- | bin/edi/log.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/bin/edi/log.c b/bin/edi/log.c index 267833ec..253554fd 100644 --- a/bin/edi/log.c +++ b/bin/edi/log.c @@ -25,12 +25,7 @@ struct Log logAlloc(size_t cap) { struct State *states = malloc(sizeof(*states) * cap); if (!states) err(EX_OSERR, "malloc"); - return (struct Log) { - .cap = cap, - .len = 0, - .state = 0, - .states = states, - }; + return (struct Log) { .cap = cap, .states = states }; } void logFree(struct Log *log) { @@ -47,11 +42,9 @@ void logPush(struct Log *log, struct Table table) { if (!log->states) err(EX_OSERR, "realloc"); } size_t next = log->len++; - log->states[next] = (struct State) { - .table = table, - .prev = log->state, - .next = next, - }; + log->states[next].table = table; + log->states[next].prev = log->state; + log->states[next].next = next; log->states[log->state].next = next; log->state = next; } |