Skip to content

Commit

Permalink
tools/codeformat.py: Remove sizeof fixup.
Browse files Browse the repository at this point in the history
Formatting for `* sizeof` was fixed in uncrustify v0.71, so we no longer
need the fixups for it.  Also, there was one file where the updated
uncrustify caught a problem that the regex didn't pick up, which is updated
in this commit.

Signed-off-by: David Lechner <[email protected]>
  • Loading branch information
dlech authored and dpgeorge committed Jun 14, 2020
1 parent bd7c92e commit ecd7826
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
4 changes: 2 additions & 2 deletions py/objfun.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ STATIC void dump_args(const mp_obj_t *a, size_t sz) {
MP_BC_PRELUDE_SIG_DECODE_INTO(ip, n_state_out_var, n_exc_stack, scope_flags, n_pos_args, n_kwonly_args, n_def_args); \
\
/* state size in bytes */ \
state_size_out_var = n_state_out_var *sizeof(mp_obj_t) \
+ n_exc_stack *sizeof(mp_exc_stack_t); \
state_size_out_var = n_state_out_var * sizeof(mp_obj_t) \
+ n_exc_stack * sizeof(mp_exc_stack_t); \
}

#define INIT_CODESTATE(code_state, _fun_bc, _n_state, n_args, n_kw, args) \
Expand Down
7 changes: 0 additions & 7 deletions tools/codeformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@
PY_EXTS = (".py",)


FIXUP_REPLACEMENTS = ((re.compile("sizeof\(([a-z_]+)\) \*\(([a-z_]+)\)"), r"sizeof(\1) * (\2)"),)


def list_files(paths, exclusions=None, prefix=""):
files = set()
for pattern in paths:
Expand Down Expand Up @@ -124,10 +121,6 @@ def fixup_c(filename):
if directive == "endif":
dedent_stack.pop()

# Apply general regex-based fixups.
for regex, replacement in FIXUP_REPLACEMENTS:
l = regex.sub(replacement, l)

# Write out line.
f.write(l)

Expand Down

0 comments on commit ecd7826

Please sign in to comment.