diff options
Diffstat (limited to 'src/token822.c')
-rw-r--r-- | src/token822.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/token822.c b/src/token822.c index 34d8c24..b4913ab 100644 --- a/src/token822.c +++ b/src/token822.c @@ -9,23 +9,16 @@ static struct token822 comma = {TOKEN822_COMMA}; void token822_reverse(token822_alloc *ta) { - int i; - int n; + int n = ta->len - 1; struct token822 temp; - n = ta->len - 1; - for (i = 0; i + i < n; ++i) { + for (int i = 0; i + i < n; ++i) { temp = ta->t[i]; ta->t[i] = ta->t[n - i]; ta->t[n - i] = temp; } } -GEN_ALLOC_ready(token822_alloc, struct token822, t, len, a, i, n, x, 30, token822_ready); -GEN_ALLOC_readyplus(token822_alloc, struct token822, t, len, a, i, n, x, 30, token822_readyplus); -GEN_ALLOC_append( - token822_alloc, struct token822, t, len, a, i, n, x, 30, token822_readyplus, token822_append); - static int needspace(int t1, int t2) { if (!t1) return 0; @@ -449,7 +442,7 @@ int token822_parse(token822_alloc *ta, stralloc *sa, stralloc *buf) return 1; } -static int gotaddr(token822_alloc *taout, token822_alloc *taaddr, int (*callback)()) +static int gotaddr(token822_alloc *taout, token822_alloc *taaddr, int (*callback)(token822_alloc *)) { int i; |