Mercurial > hg > octave-avbm
changeset 3878:faeca8a063ae
[project @ 2002-03-07 23:28:32 by jwe]
author | jwe |
---|---|
date | Thu, 07 Mar 2002 23:28:32 +0000 |
parents | 55648fc616c8 |
children | 7200bfd25c97 |
files | src/oct-stream.cc |
diffstat | 1 files changed, 90 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/oct-stream.cc +++ b/src/oct-stream.cc @@ -1133,8 +1133,8 @@ } template void -do_scanf_conv (std::istream&, const scanf_format_elt&, int*, Matrix&, - double*, int&, int&, int, int, bool); +do_scanf_conv (std::istream&, const scanf_format_elt&, int*, + Matrix&, double*, int&, int&, int, int, bool); template void do_scanf_conv (std::istream&, const scanf_format_elt&, long int*, @@ -1144,6 +1144,18 @@ do_scanf_conv (std::istream&, const scanf_format_elt&, short int*, Matrix&, double*, int&, int&, int, int, bool); +template void +do_scanf_conv (std::istream&, const scanf_format_elt&, unsigned int*, + Matrix&, double*, int&, int&, int, int, bool); + +template void +do_scanf_conv (std::istream&, const scanf_format_elt&, unsigned long int*, + Matrix&, double*, int&, int&, int, int, bool); + +template void +do_scanf_conv (std::istream&, const scanf_format_elt&, unsigned short int*, + Matrix&, double*, int&, int&, int, int, bool); + #if 0 template void do_scanf_conv (std::istream&, const scanf_format_elt&, float*, @@ -1481,7 +1493,7 @@ DO_PCT_CONVERSION (); break; - case 'd': case 'i': case 'o': case 'u': case 'x': + case 'd': case 'i': { switch (elt->modifier) { @@ -1515,6 +1527,40 @@ } break; + case 'o': case 'u': case 'x': + { + switch (elt->modifier) + { + case 'h': + { + unsigned short int tmp; + do_scanf_conv (is, *elt, &tmp, mval, data, + data_index, conversion_count, + nr, max_size, discard); + } + break; + + case 'l': + { + unsigned long int tmp; + do_scanf_conv (is, *elt, &tmp, mval, data, + data_index, conversion_count, + nr, max_size, discard); + } + break; + + default: + { + unsigned int tmp; + do_scanf_conv (is, *elt, &tmp, mval, data, + data_index, conversion_count, + nr, max_size, discard); + } + break; + } + } + break; + case 'e': case 'f': case 'g': { double tmp; @@ -1723,7 +1769,7 @@ } break; - case 'd': case 'i': case 'o': case 'u': case 'x': + case 'd': case 'i': { int tmp; @@ -1737,6 +1783,20 @@ } break; + case 'o': case 'u': case 'x': + { + long int tmp; + + if (OCTAVE_SCAN (is, *elt, &tmp)) + { + if (! discard) + retval = static_cast<double> (tmp); + } + else + quit = true; + } + break; + case 'e': case 'f': case 'g': { double tmp; @@ -2161,6 +2221,12 @@ template int do_printf_conv (std::ostream&, const char*, int, int, int, long); +template int +do_printf_conv (std::ostream&, const char*, int, int, int, unsigned int); + +template int +do_printf_conv (std::ostream&, const char*, int, int, int, unsigned long); + template int do_printf_conv (std::ostream&, const char*, int, int, int, double); @@ -2244,17 +2310,29 @@ { switch (elt->type) { - case 'd': case 'i': case 'o': case 'x': - case 'X': case 'u': case 'c': + case 'd': case 'i': case 'c': { if (elt->modifier == 'l') - retval - += do_printf_conv (os, fmt, nsa, sa_1, sa_2, - static_cast<long> (val)); + retval += do_printf_conv + (os, fmt, nsa, sa_1, sa_2, + static_cast<long int> (val)); else - retval - += do_printf_conv (os, fmt, nsa, sa_1, sa_2, - static_cast<int> (val)); + retval += do_printf_conv + (os, fmt, nsa, sa_1, sa_2, + static_cast<int> (val)); + } + break; + + case 'o': case 'x': case 'X': case 'u': + { + if (elt->modifier == 'l') + retval += do_printf_conv + (os, fmt, nsa, sa_1, sa_2, + static_cast<unsigned long int> (val)); + else + retval += do_printf_conv + (os, fmt, nsa, sa_1, sa_2, + static_cast<unsigned int> (val)); } break;