From ef7347435a77a97444e61a52ce9305c3924d2df6 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 19 Mar 2013 17:13:20 +0100 Subject: cython: use uint64_t instead of int for Integer get_value and __repr__ --- cython/plist.pxd | 6 ++++-- cython/plist.pyx | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cython/plist.pxd b/cython/plist.pxd index d7c70bd..c504599 100644 --- a/cython/plist.pxd +++ b/cython/plist.pxd @@ -1,3 +1,5 @@ +from libc.stdint cimport * + cdef extern from "plist/plist.h": ctypedef void *plist_t ctypedef void *plist_dict_iter @@ -14,10 +16,10 @@ cdef class Node: cdef class Bool(Node): cpdef set_value(self, object value) cpdef bint get_value(self) - + cdef class Integer(Node): cpdef set_value(self, object value) - cpdef int get_value(self) + cpdef uint64_t get_value(self) cdef class Key(Node): cpdef set_value(self, object value) diff --git a/cython/plist.pyx b/cython/plist.pyx index dce5bec..09c0bbc 100644 --- a/cython/plist.pyx +++ b/cython/plist.pyx @@ -180,7 +180,7 @@ cdef class Integer(Node): self._c_node = plist_new_uint(int(value)) def __repr__(self): - cdef int i = self.get_value() + cdef uint64_t i = self.get_value() return '' % i def __int__(self): @@ -207,7 +207,7 @@ cdef class Integer(Node): cpdef set_value(self, object 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 plist_get_uint_val(self._c_node, &value) return value -- cgit v1.1-32-gdbae