summaryrefslogtreecommitdiff
path: root/float.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2002-04-30 20:52:26 +0000
committerH. Peter Anvin <hpa@zytor.com>2002-04-30 20:52:26 +0000
commit6768eb71d8debde65562619c938b997aea1bd9f9 (patch)
tree93fc4f4a6d66891ace9494b737aa4b2c1bed37ef /float.c
parentd7ed89eac9580f280fe0017b22c8e38ca75ed8e3 (diff)
downloadnasm-6768eb71d8debde65562619c938b997aea1bd9f9.tar.gz
nasm-6768eb71d8debde65562619c938b997aea1bd9f9.tar.bz2
nasm-6768eb71d8debde65562619c938b997aea1bd9f9.zip
NASM 0.95
Diffstat (limited to 'float.c')
-rw-r--r--float.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/float.c b/float.c
index e9b7f4a..1f66ca6 100644
--- a/float.c
+++ b/float.c
@@ -55,7 +55,8 @@ static int multiply(unsigned short *to, unsigned short *from) {
}
}
-static void flconvert(char *string, unsigned short *mant, long *exponent) {
+static void flconvert(char *string, unsigned short *mant, long *exponent,
+ efunc error) {
char digits[MANT_DIGITS], *p, *q, *r;
unsigned short mult[MANT_WORDS], *m, bit;
long tenpwr, twopwr;
@@ -69,7 +70,8 @@ static void flconvert(char *string, unsigned short *mant, long *exponent) {
if (!seendot)
seendot = TRUE;
else {
- fprintf(stderr, "too many periods!\n");
+ error (ERR_NONFATAL,
+ "too many periods in floating-point constant");
return;
}
} else if (*string >= '0' && *string <= '9') {
@@ -84,7 +86,9 @@ static void flconvert(char *string, unsigned short *mant, long *exponent) {
tenpwr++;
}
} else {
- fprintf(stderr, "`%c' is invalid char\n", *string);
+ error (ERR_NONFATAL,
+ "floating-point constant: `%c' is invalid character",
+ *string);
return;
}
string++;
@@ -209,7 +213,7 @@ static int to_double(char *str, long sign, unsigned char *result,
sign = (sign < 0 ? 0x8000L : 0L);
- flconvert (str, mant, &exponent);
+ flconvert (str, mant, &exponent, error);
if (mant[0] & 0x8000) {
/*
* Non-zero.
@@ -269,7 +273,7 @@ static int to_float(char *str, long sign, unsigned char *result,
sign = (sign < 0 ? 0x8000L : 0L);
- flconvert (str, mant, &exponent);
+ flconvert (str, mant, &exponent, error);
if (mant[0] & 0x8000) {
/*
* Non-zero.
@@ -322,7 +326,7 @@ static int to_ldoub(char *str, long sign, unsigned char *result,
sign = (sign < 0 ? 0x8000L : 0L);
- flconvert (str, mant, &exponent);
+ flconvert (str, mant, &exponent, error);
if (mant[0] & 0x8000) {
/*
* Non-zero.