# HG changeset patch # User John W. Eaton # Date 1212414609 14400 # Node ID c5d9aaeb306a23ceff77cdbb357d80f8989af4b8 # Parent 78d3faa70aaa88e3174ddb2ca327f02f8ef0fbdd use ischar instead of isstr diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,10 @@ +2008-06-02 John W. Eaton + + * linear-algebra/cond.m, miscellaneous/news.m, + miscellaneous/unpack.m, plot/__bar__.m, plot/__quiver__.m, + plot/__scatter__.m, plot/compass.m, plot/feather.m: + Call ischar instead of isstr. + 2008-05-22 David Bateman * general/rem.m, general/mod.m: Treat integer types correctly. 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/news.m b/scripts/miscellaneous/news.m --- a/scripts/miscellaneous/news.m +++ b/scripts/miscellaneous/news.m @@ -28,7 +28,7 @@ if (exist (newsfile, "file")) f = fopen (newsfile, "r"); - while (isstr (line = fgets (f))) + while (ischar (line = fgets (f))) printf (line); endwhile else 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/test/ChangeLog b/test/ChangeLog --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,13 @@ +2008-06-02 John W. Eaton + + * test_io.m, test_system.m, octave.test/io/sprintf-1.m, + octave.test/io/sscanf-1.m, octave.test/io/tmpnam-1.m, + octave.test/system/computer-1.m, + octave.test/system/file_in_path-1.m, octave.test/system/lstat-1.m, + octave.test/system/pwd-1.m, octave.test/system/stat-1.m, + octave.test/system/strftime-1.m, octave.test/system/version-1.m: + Call ischar instead of isstr. + 2008-04-21 John W. Eaton Version 3.0.1 released. diff --git a/test/octave.test/io/sprintf-1.m b/test/octave.test/io/sprintf-1.m --- a/test/octave.test/io/sprintf-1.m +++ b/test/octave.test/io/sprintf-1.m @@ -1,3 +1,3 @@ [s, msg, status] = sprintf ("%s: %d\n", "test", 1); -s == "test: 1\n" && isstr (msg) && status == 8 +s == "test: 1\n" && ischar (msg) && status == 8 diff --git a/test/octave.test/io/sscanf-1.m b/test/octave.test/io/sscanf-1.m --- a/test/octave.test/io/sscanf-1.m +++ b/test/octave.test/io/sscanf-1.m @@ -3,5 +3,5 @@ [v2, c2, m2] = sscanf ("1 2 bar 3 4 5 6", "%d"); (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)) diff --git a/test/octave.test/io/tmpnam-1.m b/test/octave.test/io/tmpnam-1.m --- a/test/octave.test/io/tmpnam-1.m +++ b/test/octave.test/io/tmpnam-1.m @@ -1,1 +1,1 @@ -isstr (tmpnam ()) +ischar (tmpnam ()) diff --git a/test/octave.test/system/computer-1.m b/test/octave.test/system/computer-1.m --- a/test/octave.test/system/computer-1.m +++ b/test/octave.test/system/computer-1.m @@ -1,2 +1,2 @@ -(isstr (computer ()) +(ischar (computer ()) && computer () == octave_config_info ("canonical_host_type")) diff --git a/test/octave.test/system/file_in_path-1.m b/test/octave.test/system/file_in_path-1.m --- a/test/octave.test/system/file_in_path-1.m +++ b/test/octave.test/system/file_in_path-1.m @@ -1,1 +1,1 @@ -isstr (file_in_path (LOADPATH, "date.m")) +ischar (file_in_path (LOADPATH, "date.m")) diff --git a/test/octave.test/system/lstat-1.m b/test/octave.test/system/lstat-1.m --- a/test/octave.test/system/lstat-1.m +++ b/test/octave.test/system/lstat-1.m @@ -11,4 +11,4 @@ && struct_contains (s, "atime") && struct_contains (s, "mtime") && struct_contains (s, "ctime") - && isstr (msg)) + && ischar (msg)) diff --git a/test/octave.test/system/pwd-1.m b/test/octave.test/system/pwd-1.m --- a/test/octave.test/system/pwd-1.m +++ b/test/octave.test/system/pwd-1.m @@ -1,1 +1,1 @@ -isstr (pwd ()) +ischar (pwd ()) diff --git a/test/octave.test/system/stat-1.m b/test/octave.test/system/stat-1.m --- a/test/octave.test/system/stat-1.m +++ b/test/octave.test/system/stat-1.m @@ -11,4 +11,4 @@ && struct_contains (s, "atime") && struct_contains (s, "mtime") && struct_contains (s, "ctime") - && isstr (msg)) + && ischar (msg)) diff --git a/test/octave.test/system/strftime-1.m b/test/octave.test/system/strftime-1.m --- a/test/octave.test/system/strftime-1.m +++ b/test/octave.test/system/strftime-1.m @@ -1,5 +1,5 @@ -(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 ())))) +(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 ())))) diff --git a/test/octave.test/system/version-1.m b/test/octave.test/system/version-1.m --- a/test/octave.test/system/version-1.m +++ b/test/octave.test/system/version-1.m @@ -1,1 +1,1 @@ -isstr (version ()) && strcmp (version (), OCTAVE_VERSION) +ischar (version ()) && strcmp (version (), OCTAVE_VERSION) diff --git a/test/test_io.m b/test/test_io.m --- a/test/test_io.m +++ b/test/test_io.m @@ -210,8 +210,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 (); @@ -251,7 +251,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); @@ -340,7 +340,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 @@ -97,11 +97,11 @@ %!error asctime (1, 2); %% test/octave.test/system/strftime-1.m -%!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 ()))))); %% test/octave.test/system/strftime-2.m %!error strftime (); @@ -309,7 +309,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 (); @@ -332,7 +332,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 (); @@ -365,7 +365,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); @@ -487,7 +487,7 @@ %!error cd (1); %% test/octave.test/system/pwd-1.m -%!assert(isstr (pwd ())); +%!assert(ischar (pwd ())); %% test/octave.test/system/ls-1.m %!error ls (1); @@ -602,7 +602,7 @@ %!error endgrent (1); %% test/octave.test/system/computer-1.m -%!assert((isstr (computer ()) +%!assert((ischar (computer ()) %! && computer () == octave_config_info ("canonical_host_type"))); %% test/octave.test/system/computer-2.m @@ -612,7 +612,7 @@ %!assert(isieee () == 1 || isieee () == 0); %% test/octave.test/system/version-1.m -%!assert(isstr (version ()) && strcmp (version (), OCTAVE_VERSION)); +%!assert(ischar (version ()) && strcmp (version (), OCTAVE_VERSION)); %% test/octave.test/system/version-2.m %!warning version (1);