Browse Source

pylibfdt: Don't incorrectly / unnecessarily override uint64_t typemap

In libfdt.i we set the handling of uint64_t parameters to use
PyLong_AsUnsignedLong.  But for 32-bit platforms, where an unsigned long
is 32-bits, this will truncate the value we need.

It turns out swig's default typemapping for uint64_t correctly handles
conversions both to python ints and python longs, so we don't need this
typemap at all.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
main
David Gibson 6 years ago
parent
commit
04853cad18
  1. 5
      pylibfdt/libfdt.i

5
pylibfdt/libfdt.i

@ -1049,11 +1049,6 @@ typedef uint32_t fdt32_t; @@ -1049,11 +1049,6 @@ typedef uint32_t fdt32_t;
$1 = PyString_AsString($input); /* char *str */
}

/* typemap used for fdt_add_reservemap_entry() */
%typemap(in) uint64_t {
$1 = PyLong_AsUnsignedLong($input);
}

/* typemaps used for fdt_next_node() */
%typemap(in, numinputs=1) int *depth (int depth) {
depth = (int) PyInt_AsLong($input);

Loading…
Cancel
Save