common: use tabs everywhere.

Didn't generally fixup inside comments and the bech32 code: reformatting that
is just anti-social.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2020-02-04 10:33:22 +10:30
committed by Christian Decker
parent 5d2fdfe66b
commit f376a9c24c
16 changed files with 630 additions and 630 deletions

View File

@@ -123,7 +123,7 @@ bool json_to_number(const char *buffer, const jsmntok_t *tok,
}
bool json_to_u16(const char *buffer, const jsmntok_t *tok,
short unsigned int *num)
short unsigned int *num)
{
uint64_t u64;
@@ -355,7 +355,7 @@ void json_tok_print(const char *buffer, const jsmntok_t *tok)
printf("size: %d, count: %td\n", tok->size, last - first);
while (first != last) {
printf("%td. %.*s, %s\n", first - tok,
first->end - first->start, buffer + first->start,
first->end - first->start, buffer + first->start,
jsmntype_to_string(first->type));
first++;
}
@@ -405,32 +405,32 @@ const jsmntok_t *json_delve(const char *buffer,
const char *guide)
{
while (*guide) {
const char *key;
size_t len = strcspn(guide+1, ".[]");
const char *key;
size_t len = strcspn(guide+1, ".[]");
key = tal_strndup(tmpctx, guide+1, len);
switch (guide[0]) {
case '.':
if (tok->type != JSMN_OBJECT)
return NULL;
tok = json_get_member(buffer, tok, key);
if (!tok)
return NULL;
break;
case '[':
if (tok->type != JSMN_ARRAY)
return NULL;
tok = json_get_arr(tok, atol(key));
if (!tok)
return NULL;
/* Must be terminated */
assert(guide[1+strlen(key)] == ']');
len++;
break;
default:
abort();
}
guide += len + 1;
key = tal_strndup(tmpctx, guide+1, len);
switch (guide[0]) {
case '.':
if (tok->type != JSMN_OBJECT)
return NULL;
tok = json_get_member(buffer, tok, key);
if (!tok)
return NULL;
break;
case '[':
if (tok->type != JSMN_ARRAY)
return NULL;
tok = json_get_arr(tok, atol(key));
if (!tok)
return NULL;
/* Must be terminated */
assert(guide[1+strlen(key)] == ']');
len++;
break;
default:
abort();
}
guide += len + 1;
}
return tok;