From bug-octave-request at bevo dot che dot wisc dot edu Thu Feb 5 14:41:40 2004 Subject: Re: Warnings when loading strings stored in MAT5 format From: "John W. Eaton" To: Luke Sjulson Cc: Quentin Spencer , bug-octave@bevo.che.wisc.edu Date: Thu, 5 Feb 2004 14:40:48 -0600 On 5-Feb-2004, Luke Sjulson wrote: | There's a variable called warn_num_to_str, which can be set to zero. | This will disable the warning. You can put the line | | warn_num_to_str = 0; | | in your .octaverc file, and that should take care of it. Yes, that would be a quick fix to avoid the annoying warnings, but you should not have to do that. Here is a patch that avoids the warning from load while not forcing you to turn off the warning globally (which might not be what you want). jwe src/ChangeLog: 2004-02-05 John W. Eaton * ls-mat5.cc (read_mat5_binary_element): For character strings, force conversion from numeric data. Index: src/ls-mat5.cc =================================================================== RCS file: /usr/local/cvsroot/octave/src/ls-mat5.cc,v retrieving revision 1.5 diff -u -r1.5 ls-mat5.cc --- src/ls-mat5.cc 23 Jan 2004 20:04:36 -0000 1.5 +++ src/ls-mat5.cc 5 Feb 2004 20:27:49 -0000 at @ -508,7 +508,7 @@ tc = re; if (arrayclass == mxCHAR_CLASS) - tc = tc.convert_to_str (); + tc = tc.convert_to_str (false, true); } is.seekg (pos + static_cast (element_length)); ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------