Mercurial > pytave
diff oct-py-types.h @ 374:d362cdd1ddeb
pyobject: add conversion methods for single, intX, and uintX types
* oct-py-types.cc, oct-py-types.h (pytave::extract_py_uint64): New function.
* __py_struct_from_dict__.cc (F__py_uint64_scalar_value__): New function.
(F__py_int64_scalar_value__): Simplify and clean up style. Add %!tests.
* @pyobject/pyobject.m (pyobject.single, pyobject.int8, pyobject.int16,
pyobject.int32, pyobject.uint8, pyobject.uint16, pyobject.uint32,
pyobject.uint64): New conversion methods.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Fri, 26 Aug 2016 18:51:42 -0700 |
parents | eac35d84ef0d |
children | c4b78e449c62 |
line wrap: on
line diff
--- a/oct-py-types.h Fri Aug 26 14:05:37 2016 -0700 +++ b/oct-py-types.h Fri Aug 26 18:51:42 2016 -0700 @@ -103,6 +103,13 @@ int64_t extract_py_int64 (PyObject *obj); +//! Extract the integer value of the given Python int or long object. +//! +//! @param obj Python int or long object +//! @return integer value of @a obj +uint64_t +extract_py_uint64 (PyObject *obj); + //! Create a Python int object with the value of the given @c int32_t value. //! //! @param value integer value