diff --git a/libsrc/stdio/vfprintf.c b/libsrc/stdio/vfprintf.c index aaf5756ca..aa350b431 100644 --- a/libsrc/stdio/vfprintf.c +++ b/libsrc/stdio/vfprintf.c @@ -252,10 +252,10 @@ int vfprintf(FILE *fp, const char *fmt_, va_list ap) { } } - if (c == 'l') { + if (tolower(c) == 'l') { nlong = 1; c = fmt[++i]; - if (c == 'l') { + if (tolower(c) == 'l') { nlong = 2; c = fmt[++i]; } diff --git a/src/_debug/dump_expr.c b/src/_debug/dump_expr.c index 4c678fa88..07e8cae3b 100644 --- a/src/_debug/dump_expr.c +++ b/src/_debug/dump_expr.c @@ -114,7 +114,7 @@ void dump_expr(FILE *fp, Expr *expr) { case EX_FLONUM: { char buf[64]; - snprintf(buf, sizeof(buf) - 4, "%g", expr->flonum); + snprintf(buf, sizeof(buf) - 4, "%Lg", expr->flonum); if (strchr(buf, '.') == NULL) strcat(buf, ".0"); switch (expr->type->flonum.kind) { diff --git a/src/as/inst.h b/src/as/inst.h index ba1b8a401..1649c97d8 100644 --- a/src/as/inst.h +++ b/src/as/inst.h @@ -252,11 +252,7 @@ enum ExprKind { }; #ifndef __NO_FLONUM -#if defined(__XCC) typedef long double Flonum; -#else -typedef double Flonum; -#endif #endif typedef struct Expr { diff --git a/src/cc/frontend/ast.h b/src/cc/frontend/ast.h index bd805f53d..35d614dd4 100644 --- a/src/cc/frontend/ast.h +++ b/src/cc/frontend/ast.h @@ -22,11 +22,7 @@ typedef int64_t Fixnum; typedef uint64_t UFixnum; #ifndef __NO_FLONUM -#ifdef __XCC typedef long double Flonum; -#else -typedef double Flonum; // TODO: long double -#endif #endif enum StrKind {