comparison libinterp/corefcn/oct-stream.h @ 19728:17a7e9f26e50

improve compatibility of printf functions * oct-stream.h, octave-stream.cc (printf_format_elt::fw, printf_format_elt::prec): Use -1 to indicate uninitialized values and -2 to indicate star values were converted. Change all uses. (printf_value_cache::get_next_value): New arg, TYPE. Handle character string extraction. (printf_value_cache::string_value): Delete. (octave_base_stream::do_numeric_printf_conversion, printf_value_cache::int_value, ok_for_signed_int_conv, ok_for_unsigned_int_conv): Force string to double conversion. (do_printf_string): New static function. (octave_base_stream::do_printf): Improve compatibility of string and character conversions. * io.tst: New tests.
author John W. Eaton <jwe@octave.org>
date Tue, 17 Feb 2015 00:51:42 -0500
parents 4197fc428c7d
children a9574e3c6e9e
comparison
equal deleted inserted replaced
19727:928ecc95f395 19728:17a7e9f26e50
188 class 188 class
189 printf_format_elt 189 printf_format_elt
190 { 190 {
191 public: 191 public:
192 192
193 printf_format_elt (const char *txt = 0, int n = 0, int w = 0, 193 printf_format_elt (const char *txt = 0, int n = 0, int w = -1,
194 int p = 0, const std::string& f = std::string (), 194 int p = -1, const std::string& f = std::string (),
195 char typ = '\0', char mod = '\0') 195 char typ = '\0', char mod = '\0')
196 : text (strsave (txt)), args (n), fw (w), prec (p), flags (f), 196 : text (strsave (txt)), args (n), fw (w), prec (p), flags (f),
197 type (typ), modifier (mod) { } 197 type (typ), modifier (mod) { }
198 198
199 printf_format_elt (const printf_format_elt& e) 199 printf_format_elt (const printf_format_elt& e)