mirror of
https://github.com/apache/nuttx.git
synced 2026-09-28 15:54:57 +08:00
Add floating point support to printf
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2656 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* lib/lib_libvsprintf.c
|
||||
*
|
||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -186,6 +186,12 @@ static const char g_nullstring[] = "(null)";
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/* Include floating point functions */
|
||||
|
||||
#ifdef CONFIG_LIBC_FLOATINGPOINT
|
||||
# include "lib_libdtoa.c"
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: ptohex
|
||||
****************************************************************************/
|
||||
@@ -1468,9 +1474,8 @@ int lib_vsprintf(FAR struct lib_outstream_s *obj, const char *src, va_list ap)
|
||||
#ifdef CONFIG_LIBC_FLOATINGPOINT
|
||||
else if (strchr("eEfgG", *src))
|
||||
{
|
||||
#ifdef CONFIG_CPP_HAVE_WARNING
|
||||
# warning "No floating point support"
|
||||
#endif
|
||||
double dblval = va_arg(ap, double);
|
||||
lib_dtoa(obj, *src, trunc, flags, dblval);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user