summaryrefslogtreecommitdiff
path: root/nuttx/lib/lib_sscanf.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-02-20 22:39:56 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-02-20 22:39:56 +0000
commit630b4bdd3d2ca967f0e1d4f438f7f1761461dd31 (patch)
treef640e5eab1ce66cdeadd0ab3684ea326f56db8a5 /nuttx/lib/lib_sscanf.c
parentbd7dce092d36128a0f84e5544ccc857a45f6ba2f (diff)
downloadpx4-nuttx-630b4bdd3d2ca967f0e1d4f438f7f1761461dd31.tar.gz
px4-nuttx-630b4bdd3d2ca967f0e1d4f438f7f1761461dd31.tar.bz2
px4-nuttx-630b4bdd3d2ca967f0e1d4f438f7f1761461dd31.zip
Eliminating GCC dependencies
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@14 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/lib/lib_sscanf.c')
-rw-r--r--nuttx/lib/lib_sscanf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/nuttx/lib/lib_sscanf.c b/nuttx/lib/lib_sscanf.c
index 4f100c8ca..efd4ebcfa 100644
--- a/nuttx/lib/lib_sscanf.c
+++ b/nuttx/lib/lib_sscanf.c
@@ -286,7 +286,7 @@ int vsscanf(char *buf, const char *s, va_list ap)
{
/* strtod always returns a double */
- double dvalue = strtod(tmp, NULL);
+ double_t dvalue = strtod(tmp, NULL);
void *pv = va_arg(ap, void*);
vdbg("vsscanf: Return %f to 0x%p\n", dvalue, pv);
@@ -295,11 +295,13 @@ int vsscanf(char *buf, const char *s, va_list ap)
* float or a double.
*/
+#ifdef CONFIG_HAVE_DOUBLE
if (lflag)
{
- *((double*)pv) = dvalue;
+ *((double_t*)pv) = dvalue;
}
else
+#endif
{
*((float*)pv) = (float)dvalue;
}