Skip to content

Commit

Permalink
py/vm: Consistently indent #if guards to match the code they surround.
Browse files Browse the repository at this point in the history
Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge committed Jul 12, 2022
1 parent 893a5c8 commit b878fc0
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions py/vm.c
Expand Up @@ -307,14 +307,14 @@ FRAME_SETUP();
// loop to execute byte code
for (;;) {
dispatch_loop:
#if MICROPY_OPT_COMPUTED_GOTO
#if MICROPY_OPT_COMPUTED_GOTO
DISPATCH();
#else
#else
TRACE(ip);
MARK_EXC_IP_GLOBAL();
TRACE_TICK(ip, sp, false);
switch (*ip++) {
#endif
#endif

ENTRY(MP_BC_LOAD_CONST_FALSE):
PUSH(mp_const_false);
Expand Down Expand Up @@ -831,17 +831,17 @@ unwind_jump:;
mp_obj_dict_store(sp[0], sp[2], sp[1]);
DISPATCH();

#if MICROPY_PY_BUILTINS_SET
#if MICROPY_PY_BUILTINS_SET
ENTRY(MP_BC_BUILD_SET): {
MARK_EXC_IP_SELECTIVE();
DECODE_UINT;
sp -= unum - 1;
SET_TOP(mp_obj_new_set(unum, sp));
DISPATCH();
}
#endif
#endif

#if MICROPY_PY_BUILTINS_SLICE
#if MICROPY_PY_BUILTINS_SLICE
ENTRY(MP_BC_BUILD_SLICE): {
MARK_EXC_IP_SELECTIVE();
mp_obj_t step = mp_const_none;
Expand All @@ -854,7 +854,7 @@ unwind_jump:;
SET_TOP(mp_obj_new_slice(start, stop, step));
DISPATCH();
}
#endif
#endif

ENTRY(MP_BC_STORE_COMP): {
MARK_EXC_IP_SELECTIVE();
Expand Down Expand Up @@ -1248,7 +1248,7 @@ unwind_jump:;
mp_import_all(POP());
DISPATCH();

#if MICROPY_OPT_COMPUTED_GOTO
#if MICROPY_OPT_COMPUTED_GOTO
ENTRY(MP_BC_LOAD_CONST_SMALL_INT_MULTI):
PUSH(MP_OBJ_NEW_SMALL_INT((mp_int_t)ip[-1] - MP_BC_LOAD_CONST_SMALL_INT_MULTI - MP_BC_LOAD_CONST_SMALL_INT_MULTI_EXCESS));
DISPATCH();
Expand Down Expand Up @@ -1276,7 +1276,7 @@ unwind_jump:;

ENTRY_DEFAULT:
MARK_EXC_IP_SELECTIVE();
#else
#else
ENTRY_DEFAULT:
if (ip[-1] < MP_BC_LOAD_CONST_SMALL_INT_MULTI + MP_BC_LOAD_CONST_SMALL_INT_MULTI_NUM) {
PUSH(MP_OBJ_NEW_SMALL_INT((mp_int_t)ip[-1] - MP_BC_LOAD_CONST_SMALL_INT_MULTI - MP_BC_LOAD_CONST_SMALL_INT_MULTI_EXCESS));
Expand All @@ -1296,19 +1296,18 @@ unwind_jump:;
SET_TOP(mp_binary_op(ip[-1] - MP_BC_BINARY_OP_MULTI, lhs, rhs));
DISPATCH();
} else
#endif
#endif // MICROPY_OPT_COMPUTED_GOTO
{

mp_obj_t obj = mp_obj_new_exception_msg(&mp_type_NotImplementedError, MP_ERROR_TEXT("opcode"));
nlr_pop();
code_state->state[0] = obj;
FRAME_LEAVE();
return MP_VM_RETURN_EXCEPTION;
}

#if !MICROPY_OPT_COMPUTED_GOTO
#if !MICROPY_OPT_COMPUTED_GOTO
} // switch
#endif
#endif

pending_exception_check:
// We've just done a branch, use this as a convenient point to
Expand Down

0 comments on commit b878fc0

Please sign in to comment.