2727#include "debug.h"
2828#include "defaultatoms.h"
2929#include "exportedfunction.h"
30- #include "utils.h"
31- #include "scheduler.h"
3230#include "nifs.h"
3331#include "opcodes.h"
32+ #include "scheduler.h"
33+ #include "utils.h"
3434
3535#ifdef IMPL_EXECUTE_LOOP
3636 #include "bitstring.h"
@@ -71,9 +71,9 @@ typedef union
7171} dreg_type_t ;
7272
7373#ifdef IMPL_EXECUTE_LOOP
74- #define RAISE_ERROR (error_type_atom ) \
75- ctx->x[0] = ERROR_ATOM; \
76- ctx->x[1] = error_type_atom; \
74+ #define RAISE_ERROR (error_type_atom ) \
75+ ctx->x[0] = ERROR_ATOM; \
76+ ctx->x[1] = error_type_atom; \
7777 goto handle_error;
7878
7979#define VM_ABORT () \
@@ -316,7 +316,7 @@ typedef union
316316 } \
317317}
318318
319- #define READ_DEST_REGISTER (dreg_type , dreg ) \
319+ #define READ_DEST_REGISTER (dreg_type , dreg ) \
320320 *(*((dreg_type).ptr) + (dreg));
321321
322322
@@ -451,9 +451,9 @@ typedef union
451451#define INSTRUCTION_POINTER () \
452452 ((const void *) &code[i])
453453
454- #define DO_RETURN () \
454+ #define DO_RETURN () \
455455 mod = mod->global->modules_by_index[ctx->cp >> 24]; \
456- code = mod->code->code; \
456+ code = mod->code->code; \
457457 i = (ctx->cp & 0xFFFFFF) >> 2;
458458
459459#define POINTER_TO_II (instruction_pointer ) \
@@ -462,37 +462,36 @@ typedef union
462462#define HANDLE_ERROR () \
463463 goto handle_error;
464464
465- #define VERIFY_IS_INTEGER (t , opcode_name ) \
466- if (UNLIKELY(!term_is_integer(t))) { \
467- TRACE(opcode_name ": " #t " is not an integer\n"); \
468- RAISE_ERROR(BADARG_ATOM); \
469- }
465+ #define VERIFY_IS_INTEGER (t , opcode_name ) \
466+ if (UNLIKELY(!term_is_integer(t))) { \
467+ TRACE(opcode_name ": " #t " is not an integer\n"); \
468+ RAISE_ERROR(BADARG_ATOM); \
469+ }
470470
471- #define VERIFY_IS_ANY_INTEGER (t , opcode_name ) \
472- if (UNLIKELY(!term_is_any_integer(t))) { \
473- TRACE(opcode_name ": " #t " is not any integer\n"); \
474- RAISE_ERROR(BADARG_ATOM); \
475- }
471+ #define VERIFY_IS_ANY_INTEGER (t , opcode_name ) \
472+ if (UNLIKELY(!term_is_any_integer(t))) { \
473+ TRACE(opcode_name ": " #t " is not any integer\n"); \
474+ RAISE_ERROR(BADARG_ATOM); \
475+ }
476476
477- #define VERIFY_IS_BINARY (t , opcode_name ) \
478- if (UNLIKELY(!term_is_binary(t))) { \
479- TRACE(opcode_name ": " #t " is not a binary\n"); \
480- RAISE_ERROR(BADARG_ATOM); \
481- }
477+ #define VERIFY_IS_BINARY (t , opcode_name ) \
478+ if (UNLIKELY(!term_is_binary(t))) { \
479+ TRACE(opcode_name ": " #t " is not a binary\n"); \
480+ RAISE_ERROR(BADARG_ATOM); \
481+ }
482482
483- #define VERIFY_IS_MATCH_STATE (t , opcode_name ) \
484- if (UNLIKELY(!term_is_match_state(t))) { \
483+ #define VERIFY_IS_MATCH_STATE (t , opcode_name ) \
484+ if (UNLIKELY(!term_is_match_state(t))) { \
485485 TRACE(opcode_name ": " #t " is not a match context.\n"); \
486- RAISE_ERROR(BADARG_ATOM); \
486+ RAISE_ERROR(BADARG_ATOM); \
487487 }
488488
489- #define VERIFY_IS_MATCH_OR_BINARY (t , opcode_name ) \
490- if (UNLIKELY(!(term_is_binary(t) || term_is_match_state(t)))) { \
489+ #define VERIFY_IS_MATCH_OR_BINARY (t , opcode_name ) \
490+ if (UNLIKELY(!(term_is_binary(t) || term_is_match_state(t)))) { \
491491 TRACE(opcode_name ": " #t " is not a binary or match context.\n"); \
492- RAISE_ERROR(BADARG_ATOM); \
492+ RAISE_ERROR(BADARG_ATOM); \
493493 }
494494
495-
496495#define MIN (X , Y ) ((X) < (Y) ? (X) : (Y))
497496
498497#ifdef IMPL_EXECUTE_LOOP
@@ -516,11 +515,12 @@ struct Int56
516515 int64_t val56 : 56 ;
517516};
518517
519- #define SWAP_KV_PAIR (I , J ) { \
520- struct kv_pair tmp = kv[(I)]; \
521- kv[(I)] = kv[(J)]; \
522- kv[(J)] = tmp; \
523- }
518+ #define SWAP_KV_PAIR (I , J ) \
519+ { \
520+ struct kv_pair tmp = kv[(I)]; \
521+ kv[(I)] = kv[(J)]; \
522+ kv[(J)] = tmp; \
523+ }
524524
525525struct kv_pair
526526{
@@ -618,7 +618,7 @@ COLD_FUNC static void dump(Context *ctx)
618618 int offset ;
619619 cp_to_mod_lbl_off (ctx -> cp , ctx , & cp_mod , & label , & offset );
620620 fprintf (stderr , "cp: #CP<module: %i, label: %i, offset: %i>\n\n" ,
621- cp_mod -> module_index , label , offset );
621+ cp_mod -> module_index , label , offset );
622622 }
623623
624624 fprintf (stderr , "x[0]: " );
@@ -659,7 +659,7 @@ COLD_FUNC static void dump(Context *ctx)
659659
660660 fprintf (stderr , "\n\nMailbox\n--------\n" );
661661 struct ListHead * item ;
662- LIST_FOR_EACH (item , & ctx -> mailbox ) {
662+ LIST_FOR_EACH (item , & ctx -> mailbox ) {
663663 Message * msg = GET_LIST_ENTRY (item , Message , mailbox_list_head );
664664 term_display (stderr , msg -> message , ctx );
665665 fprintf (stderr , "\n" );
@@ -802,7 +802,7 @@ term make_fun(Context *ctx, const Module *mod, int fun_index)
802802}
803803
804804static bool maybe_call_native (Context * ctx , AtomString module_name , AtomString function_name , int arity ,
805- term * return_value )
805+ term * return_value )
806806{
807807 BifImpl bif = bif_registry_get_handler (module_name , function_name , arity );
808808 if (bif ) {
@@ -999,7 +999,7 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
999999 int remaining_reductions = DEFAULT_REDUCTIONS_AMOUNT ;
10001000 #endif
10011001
1002- while (1 ) {
1002+ while (1 ) {
10031003
10041004 switch (code [i ]) {
10051005 case OP_LABEL : {
@@ -1802,7 +1802,6 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
18021802 break ;
18031803 }
18041804
1805-
18061805 case OP_IS_LT : {
18071806 int next_off = 1 ;
18081807 int label ;
@@ -1978,9 +1977,9 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
19781977 #endif
19791978
19801979 break ;
1981- }
1980+ }
19821981
1983- case OP_IS_INTEGER : {
1982+ case OP_IS_INTEGER : {
19841983 int next_off = 1 ;
19851984 int label ;
19861985 DECODE_LABEL (label , code , i , next_off , next_off )
@@ -2007,7 +2006,6 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
20072006 break ;
20082007 }
20092008
2010-
20112009 case OP_IS_FLOAT : {
20122010 int next_off = 1 ;
20132011 int label ;
@@ -2281,9 +2279,9 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
22812279 #endif
22822280
22832281 break ;
2284- }
2282+ }
22852283
2286- case OP_IS_TUPLE : {
2284+ case OP_IS_TUPLE : {
22872285 int next_off = 1 ;
22882286 int label ;
22892287 DECODE_LABEL (label , code , i , next_off , next_off )
@@ -2310,7 +2308,7 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
23102308 break ;
23112309 }
23122310
2313- case OP_TEST_ARITY : {
2311+ case OP_TEST_ARITY : {
23142312 int next_off = 1 ;
23152313 int label ;
23162314 DECODE_LABEL (label , code , i , next_off , next_off );
@@ -2955,7 +2953,6 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
29552953
29562954 NEXT_INSTRUCTION (next_off );
29572955 break ;
2958-
29592956 }
29602957
29612958 case OP_TRY : {
@@ -4074,7 +4071,7 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
40744071 DECODE_INTEGER (arity , code , i , next_off , next_off )
40754072#ifdef IMPL_EXECUTE_LOOP
40764073 term module = ctx -> x [arity ];
4077- term function = ctx -> x [arity + 1 ];
4074+ term function = ctx -> x [arity + 1 ];
40784075 TRACE ("apply/1, module=%lu, function=%lu arity=%i\n" , module , function , arity );
40794076
40804077 remaining_reductions -- ;
@@ -4130,7 +4127,7 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
41304127 DECODE_INTEGER (n_words , code , i , next_off , next_off );
41314128#ifdef IMPL_EXECUTE_LOOP
41324129 term module = ctx -> x [arity ];
4133- term function = ctx -> x [arity + 1 ];
4130+ term function = ctx -> x [arity + 1 ];
41344131 TRACE ("apply_last/1, module=%lu, function=%lu arity=%i deallocate=%i\n" , module , function , arity , n_words );
41354132
41364133 remaining_reductions -- ;
0 commit comments