From 80f3d83c34c230ecb558ca89dda2228f74c1a89d Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 24 May 2012 23:47:56 +0200 Subject: [PATCH] software/libbase: now that we have double precision, printf hack no longer needed --- software/libbase/vsnprintf.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/software/libbase/vsnprintf.c b/software/libbase/vsnprintf.c index 102ee8cb..92ef590c 100644 --- a/software/libbase/vsnprintf.c +++ b/software/libbase/vsnprintf.c @@ -196,12 +196,11 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) case 'f': { int m; - float f; + double f; int integer; - /* until I sort out how to disable this stupid promotion to double ... */ - f = *(va_arg(args, float *)); - if((f <= 0.0f) && (f != 0.0f)) { /* TODO: fix that |[#{'"é! '<' operator */ + f = va_arg(args, double); + if(f < 0.0) { *str = '-'; str++; f = -f; @@ -233,7 +232,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) for(i=0;i<6;i++) { int n; - f = f*10.0f; + f = f*10.0; n = f; f = f - n; if(str >= end) break; -- 2.30.2