search for: pylong_asunsignedlonglong

Displaying 6 results from an estimated 6 matches for "pylong_asunsignedlonglong".

2020 Aug 10
5
[PATCH nbdkit] python: Implement can_extents + extents.
...t) != 3) { + nbdkit_error ("extents method did not return a list of 3-tuples"); + Py_DECREF (r); + return -1; + } + py_offset = PyTuple_GetItem (t, 0); + py_length = PyTuple_GetItem (t, 1); + py_type = PyTuple_GetItem (t, 2); + extent_offset = PyLong_AsUnsignedLongLong (py_offset); + extent_length = PyLong_AsUnsignedLongLong (py_length); + extent_type = PyLong_AsUnsignedLong (py_type); + if (check_python_failure ("PyLong") == -1) { + Py_DECREF (r); + return -1; + } + if (nbdkit_add_extent (extents, +...
2020 Aug 10
0
Re: [PATCH nbdkit] python: Implement can_extents + extents.
...quot;extents method did not return a list of 3-tuples"); > + Py_DECREF (r); > + return -1; > + } > + py_offset = PyTuple_GetItem (t, 0); > + py_length = PyTuple_GetItem (t, 1); > + py_type = PyTuple_GetItem (t, 2); > + extent_offset = PyLong_AsUnsignedLongLong (py_offset); > + extent_length = PyLong_AsUnsignedLongLong (py_length); > + extent_type = PyLong_AsUnsignedLong (py_type); > + if (check_python_failure ("PyLong") == -1) { Is it really right to be doing error checking only once, but after three calls into PyLong_...
2020 Aug 10
2
[PATCH nbdkit] python: Allow extents to return any iterable (which includes lists).
...st of 3-tuples"); + nbdkit_error ("extents method did not return an iterable of 3-tuples"); + Py_DECREF (iter); Py_DECREF (r); return -1; } @@ -1078,16 +1075,26 @@ py_extents (void *handle, uint32_t count, uint64_t offset, extent_length = PyLong_AsUnsignedLongLong (py_length); extent_type = PyLong_AsUnsignedLong (py_type); if (check_python_failure ("PyLong") == -1) { + Py_DECREF (iter); Py_DECREF (r); return -1; } if (nbdkit_add_extent (extents, extent_offset, extent...
2003 Dec 09
3
Interfacing R and Python in MS Windows
Hi all, I need the power of R from within some of my Python programs... I use debian linux (woody) at home and windows XP at work (the latter is where I need to get things done!) This are my packages: R 1.8.0 Python 2.3 RSPython 0.5-3 This is what I've done: (1) Since the Windows Binary of RSPython is compiled against Python 2.2 I downloaded the tarball (2) Followed the instructions in
2020 Aug 10
0
Re: [PATCH nbdkit] python: Implement can_extents + extents.
...quot;extents method did not return a list of 3-tuples"); > + Py_DECREF (r); > + return -1; > + } > + py_offset = PyTuple_GetItem (t, 0); > + py_length = PyTuple_GetItem (t, 1); > + py_type = PyTuple_GetItem (t, 2); > + extent_offset = PyLong_AsUnsignedLongLong (py_offset); > + extent_length = PyLong_AsUnsignedLongLong (py_length); > + extent_type = PyLong_AsUnsignedLong (py_type); > + if (check_python_failure ("PyLong") == -1) { > + Py_DECREF (r); > + return -1; > + } > + if (nbdkit_ad...
2010 Sep 09
2
[PATCH]: add libxl python binding
...long long val) +{ + return PyLong_FromUnsignedLongLong(val); +} + +int genwrap__ull_set(PyObject *v, unsigned long long *val, unsigned long long mask) +{ + unsigned long long tmp; + if ( NULL == v ) { + *val = 0; + return 0; + } + if ( PyLong_Check(v) ) { + tmp = PyLong_AsUnsignedLongLong(v); + }else{ + tmp = (unsigned long long)PyInt_AsLong(v); + } + if ( tmp & ~mask ) { + PyErr_SetString(PyExc_ValueError, "Integer overflow"); + return -1; + } + *val = tmp; + return 0; +} + +PyObject *genwrap__ll_get(long long val) +{ + return...