comparison python_to_octave.cc @ 406:16e79a1e96b8

Eliminate all remaining uses of "using namespace" * octave_to_python.cc, pycall.cc, pyeval.cc, pyexec.cc, python_to_octave.cc: Eliminate all remaining uses of "using namespace", use fully qualified class and function names from Boost.
author Mike Miller <mtmiller@octave.org>
date Mon, 01 May 2017 08:41:01 -0700
parents 09a1acb81d8b
children b9b8790d1082
comparison
equal deleted inserted replaced
405:478d83448b0b 406:16e79a1e96b8
41 #include "arrayobjectdefs.h" 41 #include "arrayobjectdefs.h"
42 #include "exceptions.h" 42 #include "exceptions.h"
43 #include "oct-py-types.h" 43 #include "oct-py-types.h"
44 #include "oct-py-util.h" 44 #include "oct-py-util.h"
45 #include "python_to_octave.h" 45 #include "python_to_octave.h"
46
47 using namespace boost::python;
48 46
49 namespace pytave 47 namespace pytave
50 { 48 {
51 template <class PythonPrimitive, class OctaveBase> 49 template <class PythonPrimitive, class OctaveBase>
52 static void 50 static void
293 // Create a new descriptor of the data. 291 // Create a new descriptor of the data.
294 PyArray_Descr *view_descr = PyArray_DescrFromType (NPY_CHAR); 292 PyArray_Descr *view_descr = PyArray_DescrFromType (NPY_CHAR);
295 // Create a new view of the NumPy array. 293 // Create a new view of the NumPy array.
296 PyArrayObject *view = (PyArrayObject *)PyArray_View (pyarr, view_descr, 0); 294 PyArrayObject *view = (PyArrayObject *)PyArray_View (pyarr, view_descr, 0);
297 // Store in a handle to ensure proper destruction. 295 // Store in a handle to ensure proper destruction.
298 handle<PyObject> view_handle (allow_null ((PyObject *)view)); 296 boost::python::handle<> view_handle (boost::python::allow_null ((PyObject *)view));
299 // Call recursively. 297 // Call recursively.
300 pyarr_to_octvalue (octvalue, view); 298 pyarr_to_octvalue (octvalue, view);
301 } 299 }
302 } 300 }
303 break; 301 break;
311 } 309 }
312 310
313 void pyobj_to_octvalue (octave_value& oct_value, 311 void pyobj_to_octvalue (octave_value& oct_value,
314 const boost::python::object& py_object) 312 const boost::python::object& py_object)
315 { 313 {
316 extract<numeric::array> arrayx (py_object); 314 boost::python::extract<boost::python::numeric::array> arrayx (py_object);
317 315
318 if (PyBool_Check (py_object.ptr ())) 316 if (PyBool_Check (py_object.ptr ()))
319 oct_value = extract_py_bool (py_object.ptr ()); 317 oct_value = extract_py_bool (py_object.ptr ());
320 #if PY_VERSION_HEX < 0x03000000 318 #if PY_VERSION_HEX < 0x03000000
321 else if (PyInt_Check (py_object.ptr ())) 319 else if (PyInt_Check (py_object.ptr ()))