comparison libinterp/corefcn/mex.cc @ 20587:f90c8372b7ba

eliminate many more simple uses of error_state * Cell.cc, __ichol__.cc, __ilu__.cc, balance.cc, bsxfun.cc, colloc.cc, det.cc, dlmread.cc, dynamic-ld.cc, eig.cc, fft.cc, fft2.cc, fftn.cc, gcd.cc, getgrent.cc, getpwent.cc, givens.cc, hess.cc, input.cc, levenshtein.cc, load-path.cc, lookup.cc, ls-mat-ascii.cc, ls-mat4.cc, lsode.cc, lu.cc, max.cc, md5sum.cc, mex.cc, pager.cc, pinv.cc, pr-output.cc, qz.cc, schur.cc, sparse.cc, sqrtm.cc, str2double.cc, strfns.cc, sub2ind.cc, sysdep.cc, time.cc, toplev.cc, tril.cc, tsearch.cc, typecast.cc, __init_gnuplot__.cc, __magick_read__.cc, __osmesa_print__.cc, amd.cc, audiodevinfo.cc, dmperm.cc, fftw.cc, symrcm.cc, ov-base-diag.cc, ov-base-sparse.cc, ov-base.cc, ov-bool-sparse.cc, ov-builtin.cc, ov-complex.cc, ov-cx-diag.cc, ov-cx-mat.cc, ov-cx-sparse.cc, ov-fcn-handle.cc, ov-fcn-inline.cc, ov-float.cc, ov-flt-complex.cc, ov-flt-cx-diag.cc, ov-flt-cx-mat.cc, ov-flt-re-diag.cc, ov-flt-re-mat.cc, ov-lazy-idx.cc, ov-mex-fcn.cc, ov-perm.cc, ov-range.cc, ov-re-diag.cc, ov-re-mat.cc, ov-re-sparse.cc, ov-scalar.cc, ov-str-mat.cc, op-bm-b.cc, op-bm-bm.cc, op-sbm-b.cc, op-sbm-bm.cc, op-str-m.cc, op-str-s.cc, oct-parse.in.yy, pt-cbinop.cc, pt-colon.cc, pt-decl.cc, pt-exp.cc, pt-id.cc, pt-misc.cc, pt-select.cc, pt-unop.cc: Eliminate simple uses of error_state.
author John W. Eaton <jwe@octave.org>
date Mon, 05 Oct 2015 19:29:36 -0400
parents b70cc4bd8109
children
comparison
equal deleted inserted replaced
20586:b7ac1e94266e 20587:f90c8372b7ba
3058 3058
3059 // Convert returned array entries back into octave values. 3059 // Convert returned array entries back into octave values.
3060 3060
3061 octave_value_list retval; 3061 octave_value_list retval;
3062 3062
3063 if (! error_state) 3063 if (nargout == 0 && argout[0])
3064 { 3064 {
3065 if (nargout == 0 && argout[0]) 3065 // We have something for ans.
3066 { 3066 nargout = 1;
3067 // We have something for ans.
3068 nargout = 1;
3069 }
3070
3071 retval.resize (nargout);
3072
3073 for (int i = 0; i < nargout; i++)
3074 retval(i) = mxArray::as_octave_value (argout[i]);
3075 } 3067 }
3068
3069 retval.resize (nargout);
3070
3071 for (int i = 0; i < nargout; i++)
3072 retval(i) = mxArray::as_octave_value (argout[i]);
3076 3073
3077 // Clean up mex resources. 3074 // Clean up mex resources.
3078 frame.run (); 3075 frame.run ();
3079 3076
3080 return retval; 3077 return retval;
3285 3282
3286 if (base) 3283 if (base)
3287 { 3284 {
3288 octave_call_stack::goto_base_frame (); 3285 octave_call_stack::goto_base_frame ();
3289 3286
3290 if (error_state)
3291 return retval;
3292
3293 frame.add_fcn (octave_call_stack::pop); 3287 frame.add_fcn (octave_call_stack::pop);
3294 } 3288 }
3295 3289
3296 val = symbol_table::varval (name); 3290 val = symbol_table::varval (name);
3297 } 3291 }
3348 3342
3349 if (base) 3343 if (base)
3350 { 3344 {
3351 octave_call_stack::goto_base_frame (); 3345 octave_call_stack::goto_base_frame ();
3352 3346
3353 if (error_state)
3354 return 1;
3355
3356 frame.add_fcn (octave_call_stack::pop); 3347 frame.add_fcn (octave_call_stack::pop);
3357 } 3348 }
3358 3349
3359 symbol_table::assign (name, mxArray::as_octave_value (ptr)); 3350 symbol_table::assign (name, mxArray::as_octave_value (ptr));
3360 } 3351 }
3394 3385
3395 const mxArray * 3386 const mxArray *
3396 mexGet (double handle, const char *property) 3387 mexGet (double handle, const char *property)
3397 { 3388 {
3398 mxArray *m = 0; 3389 mxArray *m = 0;
3390
3399 octave_value ret = get_property_from_handle (handle, property, "mexGet"); 3391 octave_value ret = get_property_from_handle (handle, property, "mexGet");
3400 3392
3401 if (!error_state && ret.is_defined ()) 3393 if (ret.is_defined ())
3402 m = ret.as_mxArray (); 3394 m = ret.as_mxArray ();
3395
3403 return m; 3396 return m;
3404 } 3397 }
3405 3398
3406 int 3399 int
3407 mexIsGlobal (const mxArray *ptr) 3400 mexIsGlobal (const mxArray *ptr)