summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2017-12-24 19:22:17 -0500
committerFranklin Wei <git@fwei.tk>2017-12-24 19:22:17 -0500
commit6a843ca2b2008310f4b27070a2ea8fd7d0490fe5 (patch)
tree51791daff23161d6d2f3e93c4e5144f4e8716a28
parent8a705f696e766606f21a6f3609b43d9a7c8f290b (diff)
downloadrockbox-6a843ca2b2008310f4b27070a2ea8fd7d0490fe5.tar.gz
rockbox-6a843ca2b2008310f4b27070a2ea8fd7d0490fe5.zip
Revert "Support floating-point formatting"
This reverts commit 01c6dcf6c7b9bb1ad2fa0450f99bacc5f3d3e04b. The hack isn't used in duke, so having it is redundant. Change-Id: Ieb36d75718e0c2d1305440d08021744625117886
-rw-r--r--firmware/common/vuprintf.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/firmware/common/vuprintf.c b/firmware/common/vuprintf.c
index a4b3c72680..e233022bc3 100644
--- a/firmware/common/vuprintf.c
+++ b/firmware/common/vuprintf.c
@@ -23,7 +23,6 @@
23#include <limits.h> 23#include <limits.h>
24#include <string.h> 24#include <string.h>
25#include <stddef.h> 25#include <stddef.h>
26#include <stdio.h> /* for snprintf */
27#include "system.h" 26#include "system.h"
28#include "vuprintf.h" 27#include "vuprintf.h"
29 28
@@ -526,20 +525,6 @@ static inline const char * format_p(const void *p,
526} 525}
527#endif /* FMT_RADIX_p */ 526#endif /* FMT_RADIX_p */
528 527
529#undef ABS
530#define ABS(x) ((x)<0?-(x):(x))
531
532static const char * format_f(double f,
533 struct fmt_buf *fmt_buf,
534 int radixchar,
535 bool *numericp)
536{
537 (void) radixchar;
538 (void) numericp;
539 fmt_buf->length = snprintf(fmt_buf->buf, 24, "%d.%06d", (int)f, ABS((int)((f - (int)f)*1e6)));
540 return fmt_buf->buf;
541}
542
543/* parse fixed width or precision field */ 528/* parse fixed width or precision field */
544static const char * parse_number_spec(const char *fmt, 529static const char * parse_number_spec(const char *fmt,
545 int ch, 530 int ch,
@@ -757,12 +742,6 @@ int vuprintf(vuprintf_push_cb push, /* call 'push()' for each output letter */
757 break; 742 break;
758 #endif 743 #endif
759 744
760 case 'f':
761 case 'g':
762 buf = format_f(va_arg(ap, double), &fmt_buf, ch,
763 &numeric);
764 break;
765
766 /** signed integer **/ 745 /** signed integer **/
767 case 'd': 746 case 'd':
768 case 'i': 747 case 'i':