diff 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 (2015-02-17)
parents 4197fc428c7d
children a9574e3c6e9e
line wrap: on
line diff
--- a/libinterp/corefcn/oct-stream.h
+++ b/libinterp/corefcn/oct-stream.h
@@ -190,8 +190,8 @@
 {
 public:
 
-  printf_format_elt (const char *txt = 0, int n = 0, int w = 0,
-                     int p = 0, const std::string& f = std::string (),
+  printf_format_elt (const char *txt = 0, int n = 0, int w = -1,
+                     int p = -1, const std::string& f = std::string (),
                      char typ = '\0', char mod = '\0')
     : text (strsave (txt)), args (n), fw (w), prec (p), flags (f),
       type (typ), modifier (mod) { }