Mercurial > octave
diff liboctave/cruft/misc/f77-fcn.h @ 22988:cd33c785e80e
put to_f77_int inside octave namespace
* f77-fcn.h (to_f77_int): Move inside octave namespace.
Change all uses.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 30 Dec 2016 14:03:01 -0500 |
parents | 5126040e8f49 |
children | ef4d915df748 |
line wrap: on
line diff
--- a/liboctave/cruft/misc/f77-fcn.h Fri Dec 30 13:52:13 2016 -0500 +++ b/liboctave/cruft/misc/f77-fcn.h Fri Dec 30 14:03:01 2016 -0500 @@ -370,19 +370,20 @@ #if defined (__cplusplus) -inline F77_INT -to_f77_int (octave_idx_type x) +namespace octave { - // FIXME: How to do this job in C, not knowing in advance the actual - // type of F77_INT? + inline F77_INT + to_f77_int (octave_idx_type x) + { + if (x < std::numeric_limits<F77_INT>::min () + || x > std::numeric_limits<F77_INT>::max ()) + (*current_liboctave_error_handler) + ("integer dimension or index out of range for Fortran INTEGER type"); - if (x < std::numeric_limits<F77_INT>::min () - || x > std::numeric_limits<F77_INT>::max ()) - (*current_liboctave_error_handler) - ("integer dimension or index out of range for Fortran INTEGER type"); + return static_cast<F77_INT> (x); + } +} - return static_cast<F77_INT> (x); -} #endif #if defined (__cplusplus)