Mercurial > octave
diff libinterp/octave-value/ov-typeinfo.cc @ 27101:097774bed4ed
move some static functions inside octave namespace
In most files that define static functions and use the octave
namespace, define the static fucntions inside the namespace.
Files affected: octave-qscintilla.cc, main-window.cc,
variable-editor-model.cc, variable-editor.cc, welcome-wizard.cc,
call-stack.cc, environment.cc, help.cc, input.cc, load-path.cc,
sysdep.cc, text-renderer.cc, url-handle-manager.cc, __ode15__.cc,
ov-typeinfo.cc, aepbalance.cc, chol.cc, gsvd.cc, file-ops.cc,
lo-array-errwarn.cc, lo-regexp.cc, oct-glob.cc, and oct-sparse.cc.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 21 May 2019 19:50:59 +0000 |
parents | fff643eb3514 |
children | b442ec6dda5c |
line wrap: on
line diff
--- a/libinterp/octave-value/ov-typeinfo.cc Tue May 21 17:39:13 2019 +0000 +++ b/libinterp/octave-value/ov-typeinfo.cc Tue May 21 19:50:59 2019 +0000 @@ -36,33 +36,31 @@ #include "ov-typeinfo.h" #include "ov.h" -// FIXME: we should also store all class names and provide a -// way to list them (calling class with nargin == 0?). - -static NDArray -as_nd_array (const Array<int>& x) -{ - NDArray retval (x.dims ()); - - for (int i = 0; i < x.numel (); i++) - retval.xelem(i) = x(i); - - return retval; -} - -static boolNDArray -as_bool_nd_array (const Array<void *>& x) -{ - boolNDArray retval (x.dims ()); - - for (octave_idx_type i = 0; i < x.numel (); i++) - retval.xelem (i) = x(i); - - return retval; -} - namespace octave { + // FIXME: we should also store all class names and provide a + // way to list them (calling class with nargin == 0?). + + static NDArray as_nd_array (const Array<int>& x) + { + NDArray retval (x.dims ()); + + for (int i = 0; i < x.numel (); i++) + retval.xelem(i) = x(i); + + return retval; + } + + static boolNDArray as_bool_nd_array (const Array<void *>& x) + { + boolNDArray retval (x.dims ()); + + for (octave_idx_type i = 0; i < x.numel (); i++) + retval.xelem (i) = x(i); + + return retval; + } + type_info::type_info (int init_tab_sz) : num_types (0), types (dim_vector (init_tab_sz, 1), ""), vals (dim_vector (init_tab_sz, 1)),