It looks like a bug: the docs (https://docs.raku.org/language/nativetypes)
specify that 'byte' and 'uint8' are the same and correspond to uint8_t in C.
Substituting 'uint8' to 'byte' in your code returns the same result.

Out of curiosity, if it is something meant for the public, what native call
interface are you working on?

On Sun, Dec 8, 2019 at 8:08 PM Marcel Timmerman <mt1...@gmail.com> wrote:

> Hello,
>
> I have a nasty problem using native call interface. I get an array of
> bytes from a call representing a pixel buffer. I am storing it in a
> CArray[byte]. Golfing it down it comes to the following (REPL)
>
>
>  > use NativeCall
>  > my CArray[byte] $ba .= new( 255, 254, 3, 4);
> NativeCall::Types::CArray[byte].new
>  > $ba[0].WHAT
> (Int)
>  > $ba[0..*-1]
> (-1 -2 3 4)
>
>
> This means (for me) that there is an implicit type conversion from
> unsigned to signed integer and it is not possible to use positive
> numbers only, afterwards.
>
> Regards,
> Marcel
>


-- 
Fernando Santagata

Reply via email to