Mercurial > hg > octave-lyh
changeset 14225:f0d903879eaa
Replace unnecessary strcmpi calls with strcmp.
* __gnuplot_drawnow__.m, __go_draw_axes__.m, surfl.m, uigetfile.m: Replace
unnecessary strcmpi calls with strcmp.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Wed, 18 Jan 2012 21:17:14 -0800 |
parents | f6007bb54f06 |
children | d580d7179f85 |
files | scripts/plot/__gnuplot_drawnow__.m scripts/plot/private/__go_draw_axes__.m scripts/plot/surfl.m scripts/plot/uigetfile.m |
diffstat | 4 files changed, 15 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/plot/__gnuplot_drawnow__.m +++ b/scripts/plot/__gnuplot_drawnow__.m @@ -122,8 +122,8 @@ ## toolkit. [term, opts_str] = gnuplot_trim_term (term); term = lower (term); - if (strcmpi (term, "lua")) - ## Replace "lau tikz" with + if (strcmp (term, "lua")) + ## Replace "lua tikz" with just "tikz" term = "tikz"; opts_str = strrep (opts_str, "tikz", ""); endif @@ -150,7 +150,7 @@ if (output_to_screen (term) && ! strcmp (term, "dumb")) fig.numbertitle = get (h, "numbertitle"); fig.name = strrep (get (h, "name"), "\"", "\\\""); - if (strcmpi (get (h, "numbertitle"), "on")) + if (strcmp (get (h, "numbertitle"), "on")) title_str = sprintf ("Figure %d", h); else title_str = "";
--- a/scripts/plot/private/__go_draw_axes__.m +++ b/scripts/plot/private/__go_draw_axes__.m @@ -453,7 +453,7 @@ endif kids = kids(1:(end-1)); - if (strcmpi (obj.visible, "off")) + if (strcmp (obj.visible, "off")) continue; endif
--- a/scripts/plot/surfl.m +++ b/scripts/plot/surfl.m @@ -80,12 +80,12 @@ ## Check for lighting type. use_cdata = true; if (ischar (varargin{end})) - lstr = varargin{end}; - if (strncmp (tolower (lstr), "light", 5)) + lstr = tolower (varargin{end}); + if (strncmp (lstr, "light", 5)) warning ("light method not supported (yet), using cdata method instead"); ## This can be implemented when light objects are supported. use_cdata = false; - elseif (strncmp (tolower (lstr), "cdata", 5)) + elseif (strncmp (lstr, "cdata", 5)) use_cdata = true; else error ("surfl: unknown lighting method"); @@ -123,7 +123,7 @@ endif endif - tmp = surface (varargin{:}); + htmp = surface (varargin{:}); if (! ishold ()) set (h, "view", [-37.5, 30], "xgrid", "on", "ygrid", "on", "zgrid", "on", "clim", [0 1]); @@ -144,7 +144,7 @@ lv = (R * vv.').'; endif - vn = get (tmp, "vertexnormals"); + vn = get (htmp, "vertexnormals"); dar = get (h, "plotboxaspectratio"); vn(:,:,1) *= dar(1); vn(:,:,2) *= dar(2); @@ -152,21 +152,21 @@ ## Normalize vn. vn = vn ./ repmat (sqrt (sumsq (vn, 3)), [1, 1, 3]); - [nr, nc] = size(get(tmp, "zdata")); + [nr, nc] = size(get(htmp, "zdata")); ## Ambient, diffuse, and specular term. cdata = (r(1) * ones (nr, nc) + r(2) * diffuse (vn(:,:,1), vn(:,:,2), vn(:,:,3), lv) + r(3) * specular (vn(:,:,1), vn(:,:,2), vn(:,:,3), lv, vv, r(4))); - set (tmp, "cdata", cdata ./ sum (r(1:3))); + set (htmp, "cdata", cdata ./ sum (r(1:3))); unwind_protect_cleanup axes (oldh); end_unwind_protect if (nargout > 0) - retval = tmp; + retval = htmp; endif endfunction
--- a/scripts/plot/uigetfile.m +++ b/scripts/plot/uigetfile.m @@ -98,9 +98,10 @@ for i = 1 : length (varargin) val = varargin{i}; if (ischar (val)) - if (strncmpi (val, "multiselect", 11)) + val = tolower (val); + if (strncmp (val, "multiselect", 11)) idx1 = i; - elseif (strncmpi (val, "position", 8)) + elseif (strncmp (val, "position", 8)) idx2 = i; endif endif