From d2afcaebe5981edcf857f4e581569cd508e0e191 Mon Sep 17 00:00:00 2001 From: tqfx Date: Sat, 6 Apr 2024 17:18:01 +0800 Subject: [PATCH] remove warning C4244 of msvc in cython --- python/src/a.pyx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/src/a.pyx b/python/src/a.pyx index b019619..d56975d 100644 --- a/python/src/a.pyx +++ b/python/src/a.pyx @@ -684,7 +684,7 @@ cdef class pid_fuzzy: self.mkp = num2_new(mkp) self.mki = num2_new(mki) self.mkd = num2_new(mkd) - a_pid_fuzzy_rule(&self.ctx, len(me), + a_pid_fuzzy_rule(&self.ctx, len(me), num2_set(self.me.data, me), num2_set(self.mec.data, mec), num2_set(self.mkp.data, mkp), @@ -902,20 +902,20 @@ cdef class tf: def __get__(self): return self._num def __set__(self, object num): - cdef unsigned int n = len(num) + cdef Py_ssize_t n = len(num) self._num = num_new(n) self.input = num_new(n) - a_tf_set_num(&self.ctx, n, num_set(self._num.data, n, num), self.input.data) + a_tf_set_num(&self.ctx, n, num_set(self._num.data, n, num), self.input.data) cdef readonly array _den cdef readonly array output property den: def __get__(self): return self._den def __set__(self, object den): - cdef unsigned int n = len(den) + cdef Py_ssize_t n = len(den) self._den = num_new(n) self.output = num_new(n) - a_tf_set_den(&self.ctx, n, num_set(self._den.data, n, den), self.output.data) + a_tf_set_den(&self.ctx, n, num_set(self._den.data, n, den), self.output.data) from a.trajbell cimport * -- 2.11.4.GIT