# HG changeset patch # User Rafael Laboissiere # Date 1209808074 -7200 # Node ID a2d9f325b65a6986ed71de9512e7e920b6087940 # Parent 71f068b22fccc42d7a55b2cb379887eda29406eb Use isschar instead of deprecated isstr diff --git a/doc/ChangeLog b/doc/ChangeLog --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2008-05-03 Rafael Laboissiere + + * interpreter/expr.txi, interpreter/tips.txi: Use ischar instead of + deprecated isstr. + 2008-04-02 David Bateman * interpreter/sparse.txi: Document spaugment. diff --git a/doc/interpreter/expr.txi b/doc/interpreter/expr.txi --- a/doc/interpreter/expr.txi +++ b/doc/interpreter/expr.txi @@ -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 diff --git a/doc/interpreter/tips.txi b/doc/interpreter/tips.txi --- a/doc/interpreter/tips.txi +++ b/doc/interpreter/tips.txi @@ -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); diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -8,6 +8,13 @@ * miscellaneous/dbstack.m: Delete. * miscellaneous/Makefile.in (SOURCES): Remove it from the list. +2008-05-03 Rafael Laboissiere + + * 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 * plot/plot.m: Remove documentation of 'L' option. diff --git a/scripts/linear-algebra/cond.m b/scripts/linear-algebra/cond.m --- a/scripts/linear-algebra/cond.m +++ b/scripts/linear-algebra/cond.m @@ -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; diff --git a/scripts/miscellaneous/computer.m b/scripts/miscellaneous/computer.m --- a/scripts/miscellaneous/computer.m +++ b/scripts/miscellaneous/computer.m @@ -73,7 +73,7 @@ endfunction -%!assert((isstr (computer ()) +%!assert((ischar (computer ()) %! && computer () == octave_config_info ("canonical_host_type"))); %!warning a =computer(2); diff --git a/scripts/miscellaneous/version.m b/scripts/miscellaneous/version.m --- a/scripts/miscellaneous/version.m +++ b/scripts/miscellaneous/version.m @@ -34,7 +34,7 @@ endfunction -%!assert(isstr (version ()) && strcmp (version (), OCTAVE_VERSION)); +%!assert(ischar (version ()) && strcmp (version (), OCTAVE_VERSION)); %!warning version (1); diff --git a/scripts/plot/__bar__.m b/scripts/plot/__bar__.m --- a/scripts/plot/__bar__.m +++ b/scripts/plot/__bar__.m @@ -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; diff --git a/scripts/plot/__quiver__.m b/scripts/plot/__quiver__.m --- a/scripts/plot/__quiver__.m +++ b/scripts/plot/__quiver__.m @@ -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) diff --git a/scripts/plot/__scatter__.m b/scripts/plot/__scatter__.m --- a/scripts/plot/__scatter__.m +++ b/scripts/plot/__scatter__.m @@ -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; diff --git a/scripts/plot/compass.m b/scripts/plot/compass.m --- a/scripts/plot/compass.m +++ b/scripts/plot/compass.m @@ -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; diff --git a/scripts/plot/feather.m b/scripts/plot/feather.m --- a/scripts/plot/feather.m +++ b/scripts/plot/feather.m @@ -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; diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -348,6 +348,11 @@ New typedefs. (octave_mex_file_list::do_remove): Use them. +2008-05-03 Rafael Laboissiere + + * DLD-FUNCTIONS/time.cc, file_io.cc: Use ischar instead of + deprecated isstr. + 2008-04-30 John W. Eaton * dynamic-ld.cc (octave_dynamic_loader::do_load_oct): diff --git a/src/DLD-FUNCTIONS/time.cc b/src/DLD-FUNCTIONS/time.cc --- a/src/DLD-FUNCTIONS/time.cc +++ b/src/DLD-FUNCTIONS/time.cc @@ -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 strftime (); diff --git a/src/file-io.cc b/src/file-io.cc --- a/src/file-io.cc +++ b/src/file-io.cc @@ -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\ diff --git a/test/ChangeLog b/test/ChangeLog --- a/test/ChangeLog +++ b/test/ChangeLog @@ -3,6 +3,10 @@ * fntests.m: Use puts instead of printf where appropriate. Fix missing newline in message. +2008-05-03 Rafael Laboissiere + + * test_io.m, test_system.m: Use ischar instead of deprecated isstr. + 2008-03-26 David Bateman * test_index-wfi-f.m: Split large block of tests. New tests. diff --git a/test/test_io.m b/test/test_io.m --- a/test/test_io.m +++ b/test/test_io.m @@ -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 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 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); diff --git a/test/test_system.m b/test/test_system.m --- a/test/test_system.m +++ b/test/test_system.m @@ -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 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 lstat (); @@ -241,7 +241,7 @@ %!error 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 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