changeset 11777:c5d9aaeb306a release-3-0-x

use ischar instead of isstr
author John W. Eaton <jwe@octave.org>
date Mon, 02 Jun 2008 09:50:09 -0400
parents 78d3faa70aaa
children 45e71c7d7bb9
files scripts/ChangeLog scripts/linear-algebra/cond.m scripts/miscellaneous/news.m scripts/plot/__bar__.m scripts/plot/__quiver__.m scripts/plot/__scatter__.m scripts/plot/compass.m scripts/plot/feather.m test/ChangeLog test/octave.test/io/sprintf-1.m test/octave.test/io/sscanf-1.m test/octave.test/io/tmpnam-1.m test/octave.test/system/computer-1.m test/octave.test/system/file_in_path-1.m test/octave.test/system/lstat-1.m test/octave.test/system/pwd-1.m test/octave.test/system/stat-1.m test/octave.test/system/strftime-1.m test/octave.test/system/version-1.m test/test_io.m test/test_system.m
diffstat 21 files changed, 57 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,10 @@
+2008-06-02  John W. Eaton  <jwe@octave.org>
+
+	* 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  <dbateman@free.fr>
 
 	* general/rem.m, general/mod.m: Treat integer types correctly.
--- 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;
--- 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
--- 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;
--- 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)
--- 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;
--- 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;
--- 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;
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,13 @@
+2008-06-02  John W. Eaton  <jwe@octave.org>
+
+	* 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  <jwe@octave.org>
 
 	Version 3.0.1 released.
--- 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
--- 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))
--- a/test/octave.test/io/tmpnam-1.m
+++ b/test/octave.test/io/tmpnam-1.m
@@ -1,1 +1,1 @@
-isstr (tmpnam ())
+ischar (tmpnam ())
--- 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"))
--- 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"))
--- 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))
--- a/test/octave.test/system/pwd-1.m
+++ b/test/octave.test/system/pwd-1.m
@@ -1,1 +1,1 @@
-isstr (pwd ())
+ischar (pwd ())
--- 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))
--- 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 ()))))
--- 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)
--- 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 <Invalid call to sscanf.*> 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 <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
+++ 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 <Invalid call to strftime.*> 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 <Invalid call to stat.*> 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 <Invalid call to lstat.*> lstat ();
@@ -365,7 +365,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);
@@ -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 <Invalid call to endgrent.*> 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);