comparison libinterp/corefcn/data.cc @ 19777:67f2c76f9f4d

Remove unnecessary checking of error_state after is_string validation. * data.cc (#NATIVE_REDUCTION, Fcumsum, Fprod, Fsum): Remove if (error_state) check. * debug.cc (Fdbstep): Remove if (error_state) check. * dlmread.cc (Fdlmread): Remove if (error_state) check. * graphics.cc (Fwaitfor): Remove if (error_state) check. * lu.cc (Flu): Remove if (error_state) check. * utils.cc (Ferrno): Remove if (error_state) check. * variables.cc (is_valid_function): Remove if (error_state) check. * fftw.cc (Ffftw): Remove if (error_state) check.
author Rik <rik@octave.org>
date Tue, 17 Feb 2015 17:34:48 -0800
parents 3fa35defe495
children c913247c85a8
comparison
equal deleted inserted replaced
19776:55a4173f1624 19777:67f2c76f9f4d
902 \ 902 \
903 if (nargin > 1 && args(nargin - 1).is_string ()) \ 903 if (nargin > 1 && args(nargin - 1).is_string ()) \
904 { \ 904 { \
905 std::string str = args(nargin - 1).string_value (); \ 905 std::string str = args(nargin - 1).string_value (); \
906 \ 906 \
907 if (! error_state) \ 907 if (str == "native") \
908 { \ 908 isnative = true; \
909 if (str == "native") \ 909 else if (str == "double") \
910 isnative = true; \ 910 isdouble = true; \
911 else if (str == "double") \ 911 else \
912 isdouble = true; \ 912 error ("sum: unrecognized string argument"); \
913 else \ 913 nargin --; \
914 error ("sum: unrecognized string argument"); \
915 nargin --; \
916 } \
917 } \ 914 } \
918 \ 915 \
919 if (nargin == 1 || nargin == 2) \ 916 if (nargin == 1 || nargin == 2) \
920 { \ 917 { \
921 octave_value arg = args(0); \ 918 octave_value arg = args(0); \
1196 1193
1197 if (nargin > 1 && args(nargin - 1).is_string ()) 1194 if (nargin > 1 && args(nargin - 1).is_string ())
1198 { 1195 {
1199 std::string str = args(nargin - 1).string_value (); 1196 std::string str = args(nargin - 1).string_value ();
1200 1197
1201 if (! error_state) 1198 if (str == "native")
1202 { 1199 isnative = true;
1203 if (str == "native") 1200 else if (str == "double")
1204 isnative = true; 1201 isdouble = true;
1205 else if (str == "double") 1202 else
1206 isdouble = true; 1203 error ("cumsum: unrecognized string argument");
1207 else 1204 nargin --;
1208 error ("cumsum: unrecognized string argument");
1209 nargin --;
1210 }
1211 } 1205 }
1212 1206
1213 if (error_state) 1207 if (error_state)
1214 return retval; 1208 return retval;
1215 1209
1497 1491
1498 if (nargin > 1 && args(nargin - 1).is_string ()) 1492 if (nargin > 1 && args(nargin - 1).is_string ())
1499 { 1493 {
1500 std::string str = args(nargin - 1).string_value (); 1494 std::string str = args(nargin - 1).string_value ();
1501 1495
1502 if (! error_state) 1496 if (str == "native")
1503 { 1497 isnative = true;
1504 if (str == "native") 1498 else if (str == "double")
1505 isnative = true; 1499 isdouble = true;
1506 else if (str == "double") 1500 else
1507 isdouble = true; 1501 error ("prod: unrecognized type argument '%s'", str.c_str ());
1508 else 1502 nargin --;
1509 error ("prod: unrecognized type argument '%s'", str.c_str ());
1510 nargin --;
1511 }
1512 } 1503 }
1513 1504
1514 if (error_state) 1505 if (error_state)
1515 return retval; 1506 return retval;
1516 1507
2989 2980
2990 if (nargin > 1 && args(nargin - 1).is_string ()) 2981 if (nargin > 1 && args(nargin - 1).is_string ())
2991 { 2982 {
2992 std::string str = args(nargin - 1).string_value (); 2983 std::string str = args(nargin - 1).string_value ();
2993 2984
2994 if (! error_state) 2985 if (str == "native")
2995 { 2986 isnative = true;
2996 if (str == "native") 2987 else if (str == "double")
2997 isnative = true; 2988 isdouble = true;
2998 else if (str == "double") 2989 else if (str == "extra")
2999 isdouble = true; 2990 isextra = true;
3000 else if (str == "extra") 2991 else
3001 isextra = true; 2992 error ("sum: unrecognized type argument '%s'", str.c_str ());
3002 else 2993 nargin --;
3003 error ("sum: unrecognized type argument '%s'", str.c_str ());
3004 nargin --;
3005 }
3006 } 2994 }
3007 2995
3008 if (error_state) 2996 if (error_state)
3009 return retval; 2997 return retval;
3010 2998