Mercurial > hg > octave-nkf
diff src/oct-stream.cc @ 7199:cd6ceb8cbf09
[project @ 2007-11-27 03:29:57 by jwe]
author | jwe |
---|---|
date | Tue, 27 Nov 2007 03:29:57 +0000 |
parents | a1dbe9d80eee |
children | bf7235434a2a |
line wrap: on
line diff
--- a/src/oct-stream.cc +++ b/src/oct-stream.cc @@ -2491,39 +2491,22 @@ #define DO_DOUBLE_CONV(TQUAL) \ do \ { \ - if (elt->modifier == 'l') \ + if (val > std::numeric_limits<TQUAL long>::max () \ + || val < std::numeric_limits<TQUAL long>::min ()) \ { \ - if (val > std::numeric_limits<TQUAL long>::max () \ - || val < std::numeric_limits<TQUAL long>::min ()) \ - { \ - std::string tfmt = fmt; \ + std::string tfmt = fmt; \ \ - tfmt.replace (tfmt.rfind (elt->type), 1, ".f"); \ - tfmt.replace (tfmt.rfind (elt->modifier), 1, ""); \ + tfmt.replace (tfmt.rfind (elt->type), 1, ".f"); \ \ - retval += do_printf_conv (os, tfmt.c_str (), nsa, sa_1, sa_2, \ - val, who); \ - } \ - else \ - retval += do_printf_conv (os, fmt, nsa, sa_1, sa_2, \ - static_cast<TQUAL long> (val), who); \ + if (elt->modifier == 'l') \ + tfmt.replace (tfmt.rfind (elt->modifier), 1, ""); \ + \ + retval += do_printf_conv (os, tfmt.c_str (), nsa, sa_1, sa_2, \ + val, who); \ } \ else \ - { \ - if (val > std::numeric_limits<TQUAL int>::max () \ - || val < std::numeric_limits<TQUAL int>::min ()) \ - { \ - std::string tfmt = fmt; \ - \ - tfmt.replace (tfmt.rfind (elt->type), 1, ".f"); \ - \ - retval += do_printf_conv (os, tfmt.c_str (), nsa, sa_1, sa_2, \ - val, who); \ - } \ - else \ - retval += do_printf_conv (os, fmt, nsa, sa_1, sa_2, \ - static_cast<TQUAL int> (val), who); \ - } \ + retval += do_printf_conv (os, fmt, nsa, sa_1, sa_2, \ + static_cast<TQUAL long> (val), who); \ } \ while (0) @@ -2635,7 +2618,7 @@ switch (type) { case 'd': case 'i': case 'c': - DO_DOUBLE_CONV ( ); + DO_DOUBLE_CONV (); break; case 'o': case 'x': case 'X': case 'u':