lib/c: CByteArray now uses Byte instead of Int
authorLucas Bajolet <r4pass@hotmail.com>
Wed, 22 Jul 2015 17:41:01 +0000 (13:41 -0400)
committerLucas Bajolet <r4pass@hotmail.com>
Wed, 22 Jul 2015 17:48:21 +0000 (13:48 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

lib/c.nit

index a8e0c2f..04f7b20 100644 (file)
--- a/lib/c.nit
+++ b/lib/c.nit
@@ -119,7 +119,7 @@ end
 
 # Wrapper around an array of `unsigned char` in C (`unsigned char*`) with length and destroy state
 class CByteArray
-       super CArray[Int]
+       super CArray[Byte]
        redef type NATIVE: NativeCByteArray
 
        # Allocate a new array of `size`
@@ -128,8 +128,8 @@ class CByteArray
                super size
        end
 
-       # Build from an `Array[Int]`
-       new from(array: Array[Int])
+       # Build from a `SequenceRead[Byte]`
+       new from(array: SequenceRead[Byte])
        do
                var carray = new CByteArray(array.length)
                for i in array.length.times do
@@ -142,7 +142,7 @@ end
 # An array of `unsigned char` in C (`unsigned char*`)
 extern class NativeCByteArray `{ unsigned char* `}
        super NativeCArray
-       redef type E: Int
+       redef type E: Byte
 
        # Allocate a new array of `size`
        new(size: Int) `{ return calloc(size, sizeof(unsigned char)); `}