[Pyrex] Pyrex doesn't seem to recognize param type.
Lenard Lindstrom
len-l at telus.net
Fri Feb 24 02:23:15 CET 2006
On 23 Feb 2006 at 12:45, tarkawebfoot at charter.net wrote:
> Hi all,
>
> I'm trying to wrap the decNumber library with Pyrex and have had pretty good success so far. There's only one last problem showing up.
>
> I have an extension class defined like this:
>
> cdef class oetl_decimal:
> .
> .
> .
> cdef void set_buffer(self, decNumber *buffer):
> if buffer[0].digits > self.context.ctx.digits:
> raise InvalidOperation("Context precision is too low to set buffer.")
> decNumberRescale(self.buffer, buffer, self.context.decScale, &self.context.ctx)
> self.context.c_assert()
> .
> .
> .
> def normalized(self):
> cdef decNumber *tmp
> tmp = <decNumber *> alloca(128)
> decNumberNormalize(tmp, self.buffer, &self.context.ctx)
> self.context.c_assert()
> res = oetl_decimal(self.context)
> res.set_buffer(tmp)
> return res
>
You did not declare res. So you cannot access any C methods.
cdef oetl_decimal res
Lenard Lindstrom
<len-l at telus.net>
More information about the Pyrex
mailing list