8000 gh-120017: use 'do-while(0)' in some `{codegen,compile}.c` multi-line macros by picnixz · Pull Request #120018 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-120017: use 'do-while(0)' in some {codegen,compile}.c multi-line macros #120018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Nov 7, 2024
Prev Previous commit
Next Next commit
normalize style
  • Loading branch information
picnixz committed Jun 4, 2024
commit 617d565c11688e5e948ad2ff634329d4e6dd1dce
10 changes: 5 additions & 5 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ codegen_addop_j(instr_sequence *seq, location loc,
compiler_exit_scope((C)); \
return ERROR; \
} \
} while(0)
} while (0)

#define ADDOP(C, LOC, OP) \
RETURN_IF_ERROR(codegen_addop_noarg(INSTR_SEQUENCE(C), (OP), (LOC)))
Expand All @@ -981,7 +981,7 @@ codegen_addop_j(instr_sequence *seq, location loc,
return ERROR; \
} \
Py_DECREF(__new_const); \
} while(0)
} while (0)

#define ADDOP_N(C, LOC, OP, O, TYPE) \
do { \
Expand All @@ -991,7 +991,7 @@ codegen_addop_j(instr_sequence *seq, location loc,
return ERROR; \
} \
Py_DECREF((O)); \
} while(0)
} while (0)

#define ADDOP_NAME(C, LOC, OP, O, TYPE) \
RETURN_IF_ERROR(compiler_addop_name((C)->u, (LOC), (OP), (C)->u->u_metadata.u_ ## TYPE, (O)))
Expand Down Expand Up @@ -1038,7 +1038,7 @@ codegen_addop_j(instr_sequence *seq, location loc,
TYPE ## _ty elt = (TYPE ## _ty)asdl_seq_GET(seq, _i); \
RETURN_IF_ERROR(compiler_visit_ ## TYPE((C), elt)); \
} \
} while(0)
} while (0)

#define VISIT_SEQ_IN_SCOPE(C, TYPE, SEQ) \
do { \
Expand All @@ -1051,7 +1051,7 @@ codegen_addop_j(instr_sequence *seq, location loc,
return ERROR; \
} \
} \
} while(0)
} while (0)


static int
Expand Down
0