Commit ef734743 authored by Nikias Bassen's avatar Nikias Bassen

cython: use uint64_t instead of int for Integer get_value and __repr__

parent 1f14105b
from libc.stdint cimport *
cdef extern from "plist/plist.h": cdef extern from "plist/plist.h":
ctypedef void *plist_t ctypedef void *plist_t
ctypedef void *plist_dict_iter ctypedef void *plist_dict_iter
...@@ -17,7 +19,7 @@ cdef class Bool(Node): ...@@ -17,7 +19,7 @@ cdef class Bool(Node):
cdef class Integer(Node): cdef class Integer(Node):
cpdef set_value(self, object value) cpdef set_value(self, object value)
cpdef int get_value(self) cpdef uint64_t get_value(self)
cdef class Key(Node): cdef class Key(Node):
cpdef set_value(self, object value) cpdef set_value(self, object value)
......
...@@ -180,7 +180,7 @@ cdef class Integer(Node): ...@@ -180,7 +180,7 @@ cdef class Integer(Node):
self._c_node = plist_new_uint(int(value)) self._c_node = plist_new_uint(int(value))
def __repr__(self): def __repr__(self):
cdef int i = self.get_value() cdef uint64_t i = self.get_value()
return '<Integer: %s>' % i return '<Integer: %s>' % i
def __int__(self): def __int__(self):
...@@ -207,7 +207,7 @@ cdef class Integer(Node): ...@@ -207,7 +207,7 @@ cdef class Integer(Node):
cpdef set_value(self, object value): cpdef set_value(self, object value):
plist_set_uint_val(self._c_node, int(value)) plist_set_uint_val(self._c_node, int(value))
cpdef int get_value(self): cpdef uint64_t get_value(self):
cdef uint64_t value cdef uint64_t value
plist_get_uint_val(self._c_node, &value) plist_get_uint_val(self._c_node, &value)
return value return value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment