From 12e46510bc185fff839530bba0c7becaaf307037 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 3 Oct 2007 21:30:57 -0700 Subject: [PATCH] Change cloc_t to struct location, and reorder the members Change cloc_t to struct location, and reorder the members so that it should fit in 16 bytes instead of needing 8 bytes of extra padding on 64-bit machines. --- eval.c | 4 ++-- eval.h | 2 +- nasm.c | 2 +- nasm.h | 6 +++--- parser.c | 4 ++-- parser.h | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/eval.c b/eval.c index e8b10ed..3679f2d 100644 --- a/eval.c +++ b/eval.c @@ -44,7 +44,7 @@ static struct tokenval *tokval; /* The current token */ static int i; /* The t_type of tokval */ static void *scpriv; -static cloc_t *location; /* Pointer to current line's segment,offset */ +static struct location *location; /* Pointer to current line's segment,offset */ static int *opflags; static struct eval_hints *hint; @@ -813,7 +813,7 @@ static expr *expr6(int critical) } void eval_global_info(struct ofmt *output, lfunc lookup_label, - cloc_t * locp) + struct location * locp) { outfmt = output; labelfunc = lookup_label; diff --git a/eval.h b/eval.h index 1a1b1c3..6fb64ae 100644 --- a/eval.h +++ b/eval.h @@ -15,7 +15,7 @@ * look labels up. */ void eval_global_info(struct ofmt *output, lfunc lookup_label, - cloc_t * locp); + struct location * locp); /* * The evaluator itself. diff --git a/nasm.c b/nasm.c index ffed1e7..726fd09 100644 --- a/nasm.c +++ b/nasm.c @@ -69,7 +69,7 @@ static uint32_t cmd_cpu = IF_PLEVEL; /* highest level by default */ static uint32_t cpu = IF_PLEVEL; /* passed to insn_size & assemble.c */ int global_offset_changed; /* referenced in labels.c */ -static cloc_t location; +static struct location location; int in_abs_seg; /* Flag we are in ABSOLUTE seg */ int32_t abs_seg; /* ABSOLUTE segment basis */ int32_t abs_offset; /* ABSOLUTE offset */ diff --git a/nasm.h b/nasm.h index 92708bc..068049b 100644 --- a/nasm.h +++ b/nasm.h @@ -190,11 +190,11 @@ enum floatize { FLOAT_128H, }; -typedef struct { - int32_t segment; +struct location { int64_t offset; + int32_t segment; int known; -} cloc_t; +}; /* * Expression-evaluator datatype. Expressions, within the diff --git a/parser.c b/parser.c index 2096c41..5fe79f8 100644 --- a/parser.c +++ b/parser.c @@ -36,9 +36,9 @@ static int i; static struct tokenval tokval; static efunc error; static struct ofmt *outfmt; /* Structure of addresses of output routines */ -static cloc_t *location; /* Pointer to current line's segment,offset */ +static struct location *location; /* Pointer to current line's segment,offset */ -void parser_global_info(struct ofmt *output, cloc_t * locp) +void parser_global_info(struct ofmt *output, struct location * locp) { outfmt = output; location = locp; diff --git a/parser.h b/parser.h index 4ec5bcf..7e72994 100644 --- a/parser.h +++ b/parser.h @@ -10,7 +10,7 @@ #ifndef NASM_PARSER_H #define NASM_PARSER_H -void parser_global_info(struct ofmt *output, cloc_t * locp); +void parser_global_info(struct ofmt *output, struct location * locp); insn *parse_line(int pass, char *buffer, insn * result, efunc error, evalfunc evaluate, ldfunc ldef); void cleanup_insn(insn * instruction); -- 2.7.4