diff --git a/asm/labels.c b/asm/labels.c index 132b6e00..cf9acdd1 100644 --- a/asm/labels.c +++ b/asm/labels.c @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- * * - * Copyright 1996-2016 The NASM Authors - All Rights Reserved + * Copyright 1996-2017 The NASM Authors - All Rights Reserved * See the file AUTHORS included with the NASM distribution for * the specific copyright holders. * @@ -108,7 +108,7 @@ struct permts { /* permanent text storage */ char data[PERMTS_SIZE]; /* ... the data block itself */ }; -extern int64_t global_offset_changed; /* defined in nasm.c */ +uint64_t global_offset_changed; /* counter for global offset changes */ static struct hash_table ltab; /* labels hash table */ static union label *ldata; /* all label data blocks */ diff --git a/asm/nasm.c b/asm/nasm.c index fb5e9541..9e3c2344 100644 --- a/asm/nasm.c +++ b/asm/nasm.c @@ -114,10 +114,6 @@ static int cmd_sb = 16; /* by default */ iflag_t cpu; static iflag_t cmd_cpu; -int64_t global_offset_changed; /* referenced in labels.c */ -int64_t prev_offset_changed; -int32_t stall_count; - struct location location; bool in_absolute; /* Flag we are in ABSOLUTE seg */ struct location absolute; /* Segment/offset inside ABSOLUTE */ @@ -1218,6 +1214,8 @@ static void assemble_file(char *fname, StrList **depend_ptr) int64_t offs; int pass_max; int sb; + uint64_t prev_offset_changed; + unsigned int stall_count = 0; /* Make sure we make forward progress... */ if (cmd_sb == 32 && iflag_ffs(&cmd_cpu) < IF_386) nasm_fatal(0, "command line: 32-bit segment size requires a higher cpu"); @@ -1476,7 +1474,7 @@ static void assemble_file(char *fname, StrList **depend_ptr) if (terminate_after_phase) break; - if ((stall_count > 997) || (passn >= pass_max)) { + if ((stall_count > 997U) || (passn >= pass_max)) { /* We get here if the labels don't converge * Example: FOO equ FOO + 1 */ diff --git a/include/labels.h b/include/labels.h index 4da608e4..5ffdff60 100644 --- a/include/labels.h +++ b/include/labels.h @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- * * - * Copyright 1996-2009 The NASM Authors - All Rights Reserved + * Copyright 1996-2017 The NASM Authors - All Rights Reserved * See the file AUTHORS included with the NASM distribution for * the specific copyright holders. * @@ -38,6 +38,8 @@ #ifndef LABELS_H #define LABELS_H +#include "compiler.h" + extern char lprefix[PREFIX_MAX]; extern char lpostfix[PREFIX_MAX]; @@ -53,4 +55,6 @@ int init_labels(void); void cleanup_labels(void); char *local_scope(char *label); +extern uint64_t global_offset_changed; + #endif /* LABELS_H */