aboutsummaryrefslogtreecommitdiff
path: root/nuttx/lib/stdio/lib_libdtoa.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-08-06 17:59:41 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-08-06 17:59:41 +0000
commit756fc3f2db435855a76535c9863ad5d5d197b9dc (patch)
tree414b735663365ee1333299dae6932f0908678501 /nuttx/lib/stdio/lib_libdtoa.c
parent722430d4d27063839de0be788c09c5068ce9070b (diff)
downloadpx4-firmware-756fc3f2db435855a76535c9863ad5d5d197b9dc.tar.gz
px4-firmware-756fc3f2db435855a76535c9863ad5d5d197b9dc.tar.bz2
px4-firmware-756fc3f2db435855a76535c9863ad5d5d197b9dc.zip
Misc updates (minor)
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5014 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/lib/stdio/lib_libdtoa.c')
-rw-r--r--nuttx/lib/stdio/lib_libdtoa.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/nuttx/lib/stdio/lib_libdtoa.c b/nuttx/lib/stdio/lib_libdtoa.c
index 77045d9b0..1e022a8eb 100644
--- a/nuttx/lib/stdio/lib_libdtoa.c
+++ b/nuttx/lib/stdio/lib_libdtoa.c
@@ -132,7 +132,6 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec,
FAR char *digits; /* String returned by __dtoa */
FAR char *digalloc; /* Copy of digits to be freed after usage */
FAR char *rve; /* Points to the end of the return value */
- char sign; /* Temporary negative sign for floats */
int expt; /* Integer value of exponent */
int numlen; /* Actual number of digits returned by cvt */
int nchars; /* Number of characters to print */
@@ -144,11 +143,7 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec,
if (value < 0)
{
value = -value;
- sign = '-';
- }
- else
- {
- sign = '\0';
+ SET_NEGATE(flags);
}
/* Perform the conversion */
@@ -157,7 +152,7 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec,
digalloc = digits;
numlen = rve - digits;
- if (sign)
+ if (IS_NEGATE(flags))
{
obj->put(obj, '-');
}