Mercurial > octave-nkf
changeset 7768:a2d9f325b65a
Use isschar instead of deprecated isstr
author | Rafael Laboissiere <rafael@debian.org> |
---|---|
date | Sat, 03 May 2008 11:47:54 +0200 |
parents | 71f068b22fcc |
children | 247828ad21e2 |
files | doc/ChangeLog doc/interpreter/expr.txi doc/interpreter/tips.txi scripts/ChangeLog scripts/linear-algebra/cond.m scripts/miscellaneous/computer.m scripts/miscellaneous/version.m scripts/plot/__bar__.m scripts/plot/__quiver__.m scripts/plot/__scatter__.m scripts/plot/compass.m scripts/plot/feather.m src/ChangeLog src/DLD-FUNCTIONS/time.cc src/file-io.cc test/ChangeLog test/test_io.m test/test_system.m |
diffstat | 18 files changed, 50 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/ChangeLog Wed May 07 13:45:30 2008 -0400 +++ b/doc/ChangeLog Sat May 03 11:47:54 2008 +0200 @@ -1,3 +1,8 @@ +2008-05-03 Rafael Laboissiere <rafael@debian.org> + + * interpreter/expr.txi, interpreter/tips.txi: Use ischar instead of + deprecated isstr. + 2008-04-02 David Bateman <dbateman@free.fr> * interpreter/sparse.txi: Document spaugment.
--- a/doc/interpreter/expr.txi Wed May 07 13:45:30 2008 -0400 +++ b/doc/interpreter/expr.txi Sat May 03 11:47:54 2008 +0200 @@ -747,7 +747,7 @@ @example @group function f (a, b, c) - if (nargin > 2 && isstr (c)) + if (nargin > 2 && ischar (c)) @dots{} @end group @end example @@ -761,7 +761,7 @@ @group function f (a, b, c) if (nargin > 2) - if (isstr (c)) + if (ischar (c)) @dots{} @end group @end example @@ -772,7 +772,7 @@ @example @group function f (a, b, c) - if (nargin > 2 & isstr (c)) + if (nargin > 2 & ischar (c)) @dots{} @end group @end example
--- a/doc/interpreter/tips.txi Wed May 07 13:45:30 2008 -0400 +++ b/doc/interpreter/tips.txi Sat May 03 11:47:54 2008 +0200 @@ -210,7 +210,7 @@ ## [in, out, pid] = popen2 ("sort", "-nr"); ## fputs (in, "these\nare\nsome\nstrings\n"); ## fclose (in); -## while (isstr (s = fgets (out))) +## while (ischar (s = fgets (out))) ## fputs (stdout, s); ## endwhile ## fclose (out);
--- a/scripts/ChangeLog Wed May 07 13:45:30 2008 -0400 +++ b/scripts/ChangeLog Sat May 03 11:47:54 2008 +0200 @@ -8,6 +8,13 @@ * miscellaneous/dbstack.m: Delete. * miscellaneous/Makefile.in (SOURCES): Remove it from the list. +2008-05-03 Rafael Laboissiere <rafael@debian.org> + + * linear-algebra/cond.m, miscellaneous/version.m, + miscellaneous/version.m, plot/feather.m, plot/__bar__.m, + plot/compass.m, plot/__quiver__.m, plot/__scatter__.m: Use ischar + instead of deprecated isstr. + 2008-05-01 David Bateman <dbateman@free.fr> * plot/plot.m: Remove documentation of 'L' option.
--- a/scripts/linear-algebra/cond.m Wed May 07 13:45:30 2008 -0400 +++ b/scripts/linear-algebra/cond.m Sat May 03 11:47:54 2008 +0200 @@ -40,7 +40,7 @@ p = 2; endif - if (! isstr (p) && p == 2) + if (! ischar (p) && p == 2) [nr, nc] = size (a); if (nr == 0 || nc == 0) retval = 0.0;
--- a/scripts/miscellaneous/computer.m Wed May 07 13:45:30 2008 -0400 +++ b/scripts/miscellaneous/computer.m Sat May 03 11:47:54 2008 +0200 @@ -73,7 +73,7 @@ endfunction -%!assert((isstr (computer ()) +%!assert((ischar (computer ()) %! && computer () == octave_config_info ("canonical_host_type"))); %!warning a =computer(2);
--- a/scripts/miscellaneous/version.m Wed May 07 13:45:30 2008 -0400 +++ b/scripts/miscellaneous/version.m Sat May 03 11:47:54 2008 +0200 @@ -34,7 +34,7 @@ endfunction -%!assert(isstr (version ()) && strcmp (version (), OCTAVE_VERSION)); +%!assert(ischar (version ()) && strcmp (version (), OCTAVE_VERSION)); %!warning version (1);
--- a/scripts/plot/__bar__.m Wed May 07 13:45:30 2008 -0400 +++ b/scripts/plot/__bar__.m Sat May 03 11:47:54 2008 +0200 @@ -67,14 +67,14 @@ newargs = {}; have_line_spec = false; while (idx <= nargin - 2) - if (isstr (varargin{idx}) && strcmp (varargin{idx}, "grouped")) + if (ischar (varargin{idx}) && strcmp (varargin{idx}, "grouped")) group = true; idx++; - elseif (isstr (varargin{idx}) && strcmp (varargin{idx}, "stacked")) + elseif (ischar (varargin{idx}) && strcmp (varargin{idx}, "stacked")) group = false; idx++; else - if ((isstr (varargin{idx}) || iscell (varargin{idx})) + if ((ischar (varargin{idx}) || iscell (varargin{idx})) && ! have_line_spec) [linespec, valid] = __pltopt__ (func, varargin{idx}, false); if (valid) @@ -88,7 +88,7 @@ width = varargin{idx++}; elseif (idx == nargin - 2) newargs = [newargs,varargin(idx++)]; - elseif (isstr (varargin{idx}) && strcmp (tolower (varargin{idx}), "basevalue") && + elseif (ischar (varargin{idx}) && strcmp (tolower (varargin{idx}), "basevalue") && isscalar (varargin{idx+1})) bv = varargin{idx+1}; idx += 2;
--- a/scripts/plot/__quiver__.m Wed May 07 13:45:30 2008 -0400 +++ b/scripts/plot/__quiver__.m Sat May 03 11:47:54 2008 +0200 @@ -79,7 +79,7 @@ arg = varargin{ioff++}; if (ischar (arg) && strncmp (tolower (arg), "filled", 6)) have_filled = true; - elseif ((isstr (arg) || iscell (arg)) + elseif ((ischar (arg) || iscell (arg)) && ! have_line_spec) [linespec, valid] = __pltopt__ ("quiver", arg, false); if (valid)
--- a/scripts/plot/__scatter__.m Wed May 07 13:45:30 2008 -0400 +++ b/scripts/plot/__scatter__.m Sat May 03 11:47:54 2008 +0200 @@ -79,7 +79,7 @@ arg = varargin{iarg++}; if (ischar (arg) && strncmp (tolower (arg), "filled", 6)) filled = true; - elseif ((isstr (arg) || iscell (arg)) && ! have_marker) + elseif ((ischar (arg) || iscell (arg)) && ! have_marker) [linespec, valid] = __pltopt__ ("scatter", arg, false); if (valid) have_marker = true;
--- a/scripts/plot/compass.m Wed May 07 13:45:30 2008 -0400 +++ b/scripts/plot/compass.m Sat May 03 11:47:54 2008 +0200 @@ -71,7 +71,7 @@ line_spec = "b-"; while (ioff <= nargin) arg = varargin{ioff++}; - if ((isstr (arg) || iscell (arg)) && ! have_line_spec) + if ((ischar (arg) || iscell (arg)) && ! have_line_spec) [linespec, valid] = __pltopt__ ("compass", arg, false); if (valid) line_spec = arg;
--- a/scripts/plot/feather.m Wed May 07 13:45:30 2008 -0400 +++ b/scripts/plot/feather.m Sat May 03 11:47:54 2008 +0200 @@ -71,7 +71,7 @@ line_spec = "b-"; while (ioff <= nargin) arg = varargin{ioff++}; - if ((isstr (arg) || iscell (arg)) && ! have_line_spec) + if ((ischar (arg) || iscell (arg)) && ! have_line_spec) [linespec, valid] = __pltopt__ ("feather", arg, false); if (valid) line_spec = arg;
--- a/src/ChangeLog Wed May 07 13:45:30 2008 -0400 +++ b/src/ChangeLog Sat May 03 11:47:54 2008 +0200 @@ -348,6 +348,11 @@ New typedefs. (octave_mex_file_list::do_remove): Use them. +2008-05-03 Rafael Laboissiere <rafael@debian.org> + + * DLD-FUNCTIONS/time.cc, file_io.cc: Use ischar instead of + deprecated isstr. + 2008-04-30 John W. Eaton <jwe@octave.org> * dynamic-ld.cc (octave_dynamic_loader::do_load_oct):
--- a/src/DLD-FUNCTIONS/time.cc Wed May 07 13:45:30 2008 -0400 +++ b/src/DLD-FUNCTIONS/time.cc Sat May 03 11:47:54 2008 +0200 @@ -467,11 +467,11 @@ /* -%!assert((isstr (strftime ("%%%n%t%H%I%k%l", localtime (time ()))) -%! && isstr (strftime ("%M%p%r%R%s%S%T", localtime (time ()))) -%! && isstr (strftime ("%X%Z%z%a%A%b%B", localtime (time ()))) -%! && isstr (strftime ("%c%C%d%e%D%h%j", localtime (time ()))) -%! && isstr (strftime ("%m%U%w%W%x%y%Y", localtime (time ()))))); +%!assert((ischar (strftime ("%%%n%t%H%I%k%l", localtime (time ()))) +%! && ischar (strftime ("%M%p%r%R%s%S%T", localtime (time ()))) +%! && ischar (strftime ("%X%Z%z%a%A%b%B", localtime (time ()))) +%! && ischar (strftime ("%c%C%d%e%D%h%j", localtime (time ()))) +%! && ischar (strftime ("%m%U%w%W%x%y%Y", localtime (time ()))))); %!error <Invalid call to strftime.*> strftime ();
--- a/src/file-io.cc Wed May 07 13:45:30 2008 -0400 +++ b/src/file-io.cc Sat May 03 11:47:54 2008 +0200 @@ -1734,7 +1734,7 @@ @example\n\ @group\n\ fid = popen (\"ls -ltr / | tail -3\", \"r\");\n\ -while (isstr (s = fgets (fid)))\n\ +while (ischar (s = fgets (fid)))\n\ fputs (stdout, s);\n\ endwhile\n\ @print{} drwxr-xr-x 33 root root 3072 Feb 15 13:28 etc\n\
--- a/test/ChangeLog Wed May 07 13:45:30 2008 -0400 +++ b/test/ChangeLog Sat May 03 11:47:54 2008 +0200 @@ -3,6 +3,10 @@ * fntests.m: Use puts instead of printf where appropriate. Fix missing newline in message. +2008-05-03 Rafael Laboissiere <rafael@debian.org> + + * test_io.m, test_system.m: Use ischar instead of deprecated isstr. + 2008-03-26 David Bateman <dbateman@free.fr> * test_index-wfi-f.m: Split large block of tests. New tests.
--- a/test/test_io.m Wed May 07 13:45:30 2008 -0400 +++ b/test/test_io.m Sat May 03 11:47:54 2008 +0200 @@ -240,8 +240,8 @@ %! [v2, c2, m2] = sscanf ("1 2 bar 3 4 5 6", "%d"); %! %! assert((a == 1.2 && b == 3 && c == "foo" -%! && v1 == [1; 2; 3; 4; 5; 6] && c1 == 6 && isstr (m1) -%! && v2 == [1; 2] && c2 == 2 && isstr (m2))); +%! && v1 == [1; 2; 3; 4; 5; 6] && c1 == 6 && ischar (m1) +%! && v2 == [1; 2] && c2 == 2 && ischar (m2))); %% test/octave.test/io/sscanf-2.m %!error <Invalid call to sscanf.*> sscanf (); @@ -281,7 +281,7 @@ %!test %! [s, msg, status] = sprintf ("%s: %d\n", "test", 1); %! -%! assert(s == "test: 1\n" && isstr (msg) && status == 8); +%! assert(s == "test: 1\n" && ischar (msg) && status == 8); %% test/octave.test/io/sprintf-2.m %!error sprintf (1); @@ -370,7 +370,7 @@ %!error <Invalid call to fclose.*> fclose (1, 2); %% test/octave.test/io/tmpnam-1.m -%!assert(isstr (tmpnam ())); +%!assert(ischar (tmpnam ())); %% test/octave.test/io/tmpnam-2.m %!warning tmpnam (1);
--- a/test/test_system.m Wed May 07 13:45:30 2008 -0400 +++ b/test/test_system.m Sat May 03 11:47:54 2008 +0200 @@ -185,7 +185,7 @@ %! && struct_contains (s, "atime") %! && struct_contains (s, "mtime") %! && struct_contains (s, "ctime") -%! && isstr (msg))); +%! && ischar (msg))); %% test/octave.test/system/stat-2.m %!error <Invalid call to stat.*> stat (); @@ -208,7 +208,7 @@ %! && struct_contains (s, "atime") %! && struct_contains (s, "mtime") %! && struct_contains (s, "ctime") -%! && isstr (msg))); +%! && ischar (msg))); %% test/octave.test/system/lstat-2.m %!error <Invalid call to lstat.*> lstat (); @@ -241,7 +241,7 @@ %!error <Invalid call to fnmatch.*> fnmatch ("foo", "bar", 3); %% test/octave.test/system/file_in_path-1.m -%!assert(isstr (file_in_path (path (), "date.m"))); +%!assert(ischar (file_in_path (path (), "date.m"))); %% test/octave.test/system/file_in_path-2.m %!error <invalid option> file_in_path ("foo", "bar", 1); @@ -363,7 +363,7 @@ %!error cd (1); %% test/octave.test/system/pwd-1.m -%!assert(isstr (pwd ())); +%!assert(ischar (pwd ())); %% test/octave.test/system/getpwent-1.m %!testif HAVE_GETPWENT