Skip to content

Commit ecd7826

Browse files
dlechdpgeorge
authored andcommitted
tools/codeformat.py: Remove sizeof fixup.
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 <david@pybricks.com>
1 parent bd7c92e commit ecd7826

2 files changed

Lines changed: 2 additions & 9 deletions

File tree

py/objfun.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ STATIC void dump_args(const mp_obj_t *a, size_t sz) {
197197
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); \
198198
\
199199
/* state size in bytes */ \
200-
state_size_out_var = n_state_out_var *sizeof(mp_obj_t) \
201-
+ n_exc_stack *sizeof(mp_exc_stack_t); \
200+
state_size_out_var = n_state_out_var * sizeof(mp_obj_t) \
201+
+ n_exc_stack * sizeof(mp_exc_stack_t); \
202202
}
203203

204204
#define INIT_CODESTATE(code_state, _fun_bc, _n_state, n_args, n_kw, args) \

tools/codeformat.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@
7676
PY_EXTS = (".py",)
7777

7878

79-
FIXUP_REPLACEMENTS = ((re.compile("sizeof\(([a-z_]+)\) \*\(([a-z_]+)\)"), r"sizeof(\1) * (\2)"),)
80-
81-
8279
def list_files(paths, exclusions=None, prefix=""):
8380
files = set()
8481
for pattern in paths:
@@ -124,10 +121,6 @@ def fixup_c(filename):
124121
if directive == "endif":
125122
dedent_stack.pop()
126123

127-
# Apply general regex-based fixups.
128-
for regex, replacement in FIXUP_REPLACEMENTS:
129-
l = regex.sub(replacement, l)
130-
131124
# Write out line.
132125
f.write(l)
133126

0 commit comments

Comments
 (0)