summaryrefslogtreecommitdiff
path: root/labels.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-07-18 18:31:41 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-07-18 18:43:58 -0700
commit605f5155eeedea126c4fe4f2387e7a3da0fc3063 (patch)
tree9d747371d33bc82c51ec76fe63dc370dd7e9ffe5 /labels.c
parentab6443969a57014b4261f1b8a2b9c2ab1224e149 (diff)
downloadnasm-605f5155eeedea126c4fe4f2387e7a3da0fc3063.tar.gz
Drop the ofmt and errfunc arguments to label definition functions
We never set ofmt and errfunc to anything but the global values. Dropping them from the label definition function command line simplifies the code. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'labels.c')
-rw-r--r--labels.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/labels.c b/labels.c
index 7e7b7f31..8c850c30 100644
--- a/labels.c
+++ b/labels.c
@@ -206,8 +206,7 @@ bool is_extern(char *label)
}
void redefine_label(char *label, int32_t segment, int64_t offset, char *special,
- bool is_norm, bool isextrn, struct ofmt *ofmt,
- efunc error)
+ bool is_norm, bool isextrn)
{
union label *lptr;
int exi;
@@ -220,19 +219,18 @@ void redefine_label(char *label, int32_t segment, int64_t offset, char *special,
(void)special; /* Don't warn that this parameter is unused */
(void)is_norm; /* Don't warn that this parameter is unused */
(void)isextrn; /* Don't warn that this parameter is unused */
- (void)ofmt; /* Don't warn that this parameter is unused */
#ifdef DEBUG
#if DEBUG<3
if (!strncmp(label, "debugdump", 9))
#endif
- error(ERR_DEBUG, "redefine_label (%s, %ld, %08lx, %s, %d, %d)",
+ nasm_error(ERR_DEBUG, "redefine_label (%s, %ld, %08lx, %s, %d, %d)",
label, segment, offset, special, is_norm, isextrn);
#endif
lptr = find_label(label, 1);
if (!lptr)
- error(ERR_PANIC, "can't find label `%s' on pass two", label);
+ nasm_error(ERR_PANIC, "can't find label `%s' on pass two", label);
if (!islocal(label)) {
if (!islocalchar(*label) && lptr->defn.is_norm)
@@ -281,7 +279,7 @@ void redefine_label(char *label, int32_t segment, int64_t offset, char *special,
}
void define_label(char *label, int32_t segment, int64_t offset, char *special,
- bool is_norm, bool isextrn, struct ofmt *ofmt, efunc error)
+ bool is_norm, bool isextrn)
{
union label *lptr;
int exi;
@@ -290,12 +288,12 @@ void define_label(char *label, int32_t segment, int64_t offset, char *special,
#if DEBUG<3
if (!strncmp(label, "debugdump", 9))
#endif
- error(ERR_DEBUG, "define_label (%s, %ld, %08lx, %s, %d, %d)",
+ nasm_error(ERR_DEBUG, "define_label (%s, %ld, %08lx, %s, %d, %d)",
label, segment, offset, special, is_norm, isextrn);
#endif
lptr = find_label(label, 1);
if (lptr->defn.is_global & DEFINED_BIT) {
- error(ERR_NONFATAL, "symbol `%s' redefined", label);
+ nasm_error(ERR_NONFATAL, "symbol `%s' redefined", label);
return;
}
lptr->defn.is_global |= DEFINED_BIT;
@@ -306,7 +304,7 @@ void define_label(char *label, int32_t segment, int64_t offset, char *special,
/* not local, but not special either */
prevlabel = lptr->defn.label;
} else if (islocal(label) && !*prevlabel) {
- error(ERR_NONFATAL, "attempt to define a local label before any"
+ nasm_error(ERR_NONFATAL, "attempt to define a local label before any"
" non-local labels");
}
@@ -348,15 +346,14 @@ void define_label(char *label, int32_t segment, int64_t offset, char *special,
} /* if (pass0 == 1) */
}
-void define_common(char *label, int32_t segment, int32_t size, char *special,
- struct ofmt *ofmt, efunc error)
+void define_common(char *label, int32_t segment, int32_t size, char *special)
{
union label *lptr;
lptr = find_label(label, 1);
if ((lptr->defn.is_global & DEFINED_BIT) &&
(passn == 1 || !(lptr->defn.is_global & COMMON_BIT))) {
- error(ERR_NONFATAL, "symbol `%s' redefined", label);
+ nasm_error(ERR_NONFATAL, "symbol `%s' redefined", label);
return;
}
lptr->defn.is_global |= DEFINED_BIT|COMMON_BIT;
@@ -364,7 +361,7 @@ void define_common(char *label, int32_t segment, int32_t size, char *special,
if (!islocalchar(label[0])) {
prevlabel = lptr->defn.label;
} else {
- error(ERR_NONFATAL, "attempt to define a local label as a "
+ nasm_error(ERR_NONFATAL, "attempt to define a local label as a "
"common variable");
return;
}
@@ -382,12 +379,12 @@ void define_common(char *label, int32_t segment, int32_t size, char *special,
special);
}
-void declare_as_global(char *label, char *special, efunc error)
+void declare_as_global(char *label, char *special)
{
union label *lptr;
if (islocal(label)) {
- error(ERR_NONFATAL, "attempt to declare local symbol `%s' as"
+ nasm_error(ERR_NONFATAL, "attempt to declare local symbol `%s' as"
" global", label);
return;
}
@@ -402,7 +399,7 @@ void declare_as_global(char *label, char *special, efunc error)
break;
case LOCAL_SYMBOL:
if (!(lptr->defn.is_global & EXTERN_BIT)) {
- error(ERR_WARNING, "symbol `%s': GLOBAL directive "
+ nasm_error(ERR_WARNING, "symbol `%s': GLOBAL directive "
"after symbol definition is an experimental feature", label);
lptr->defn.is_global = GLOBAL_SYMBOL;
}