mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
Fix flake8 warnings: W191 indentation contains tabs + E101 indentation contains mixed spaces and tabs
This commit is contained in:
parent
e18948a6a9
commit
0a20bd44f0
@ -194,13 +194,13 @@ class Field(object):
|
|||||||
fromwire_impl_templ = """bool fromwire_{name}({ctx}const void *p{args})
|
fromwire_impl_templ = """bool fromwire_{name}({ctx}const void *p{args})
|
||||||
{{
|
{{
|
||||||
{fields}
|
{fields}
|
||||||
const u8 *cursor = p;
|
const u8 *cursor = p;
|
||||||
size_t plen = tal_len(p);
|
size_t plen = tal_len(p);
|
||||||
|
|
||||||
if (fromwire_u16(&cursor, &plen) != {enum.name})
|
if (fromwire_u16(&cursor, &plen) != {enum.name})
|
||||||
return false;
|
return false;
|
||||||
{subcalls}
|
{subcalls}
|
||||||
return cursor != NULL;
|
return cursor != NULL;
|
||||||
}}
|
}}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -212,11 +212,11 @@ towire_header_templ = """u8 *towire_{name}(const tal_t *ctx{args});
|
|||||||
towire_impl_templ = """u8 *towire_{name}(const tal_t *ctx{args})
|
towire_impl_templ = """u8 *towire_{name}(const tal_t *ctx{args})
|
||||||
{{
|
{{
|
||||||
{field_decls}
|
{field_decls}
|
||||||
u8 *p = tal_arr(ctx, u8, 0);
|
u8 *p = tal_arr(ctx, u8, 0);
|
||||||
towire_u16(&p, {enumname});
|
towire_u16(&p, {enumname});
|
||||||
{subcalls}
|
{subcalls}
|
||||||
|
|
||||||
return memcheck(p, tal_count(p));
|
return memcheck(p, tal_count(p));
|
||||||
}}
|
}}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -226,7 +226,7 @@ printwire_impl_templ = """void printwire_{name}(const u8 *cursor)
|
|||||||
{{
|
{{
|
||||||
size_t plen = tal_len(cursor);
|
size_t plen = tal_len(cursor);
|
||||||
|
|
||||||
if (fromwire_u16(&cursor, &plen) != {enum.name}) {{
|
if (fromwire_u16(&cursor, &plen) != {enum.name}) {{
|
||||||
printf("WRONG TYPE?!\\n");
|
printf("WRONG TYPE?!\\n");
|
||||||
return;
|
return;
|
||||||
}}
|
}}
|
||||||
@ -620,14 +620,14 @@ impl_template = """/* This file was generated by generate-wire.py */
|
|||||||
|
|
||||||
const char *{enumname}_name(int e)
|
const char *{enumname}_name(int e)
|
||||||
{{
|
{{
|
||||||
static char invalidbuf[sizeof("INVALID ") + STR_MAX_CHARS(e)];
|
static char invalidbuf[sizeof("INVALID ") + STR_MAX_CHARS(e)];
|
||||||
|
|
||||||
switch ((enum {enumname})e) {{
|
switch ((enum {enumname})e) {{
|
||||||
{cases}
|
{cases}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
sprintf(invalidbuf, "INVALID %i", e);
|
sprintf(invalidbuf, "INVALID %i", e);
|
||||||
return invalidbuf;
|
return invalidbuf;
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{func_decls}
|
{func_decls}
|
||||||
@ -657,11 +657,11 @@ print_template = """/* This file was generated by generate-wire.py */
|
|||||||
|
|
||||||
void print_message(const u8 *msg)
|
void print_message(const u8 *msg)
|
||||||
{{
|
{{
|
||||||
switch ((enum {enumname})fromwire_peektype(msg)) {{
|
switch ((enum {enumname})fromwire_peektype(msg)) {{
|
||||||
{printcases}
|
{printcases}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
printf("UNKNOWN: %s\\n", tal_hex(msg, msg));
|
printf("UNKNOWN: %s\\n", tal_hex(msg, msg));
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{func_decls}
|
{func_decls}
|
||||||
|
Loading…
Reference in New Issue
Block a user