# HG changeset patch # User Rik # Date 1390435203 28800 # Node ID 1a9be98119c5375758ea0cc71dc2a4d19297ef93 # Parent 925bdd86a479e464c53a8152532c9015e9ed2c5f colstyle.m: Tweaks to improve code style. * colstyle.m: Use a single switch statement with otherwise clause to assign output value 'c'. Check for correct error message in %!test. diff -r 925bdd86a479 -r 1a9be98119c5 scripts/plot/util/colstyle.m --- a/scripts/plot/util/colstyle.m Wed Jan 22 15:35:47 2014 -0800 +++ b/scripts/plot/util/colstyle.m Wed Jan 22 16:00:03 2014 -0800 @@ -36,10 +36,7 @@ try opt = __pltopt__ ("colstyle", style); l = opt.linestyle; - c = opt.color; - m = opt.marker; - msg = []; - switch (c) + switch (opt.color) case [0 0 0] c = "k"; case [1 0 0] @@ -56,7 +53,11 @@ c = "c"; case [0 1 1] c = "w"; + otherwise + c = opt.color; endswitch + m = opt.marker; + msg = []; catch l = c = m = []; msg = lasterr (); @@ -86,5 +87,5 @@ %% Test input validation %!error colstyle () %!error colstyle (1, 2) -%!error colstyle (1.5) +%!error