@@ -6,8 +6,14 @@ pub fn generate_ffi_type(ret: Option<&FfiType>) -> dart::Tokens {
66 return quote ! ( Void )
77 } ;
88 match * ret_type {
9+ FfiType :: UInt8 => quote ! ( Uint8 ) ,
10+ FfiType :: UInt16 => quote ! ( Uint16 ) ,
911 FfiType :: UInt32 => quote ! ( Uint32 ) ,
10- FfiType :: Int8 => quote ! ( Uint8 ) ,
12+ FfiType :: UInt64 => quote ! ( Uint64 ) ,
13+ FfiType :: Int8 => quote ! ( Int8 ) ,
14+ FfiType :: Int16 => quote ! ( Int16 ) ,
15+ FfiType :: Int32 => quote ! ( Int32 ) ,
16+ FfiType :: Int64 => quote ! ( Int64 ) ,
1117 FfiType :: RustBuffer ( ref inner) => match inner {
1218 Some ( i) => quote ! ( $i) ,
1319 _ => quote ! ( RustBuffer ) ,
@@ -22,8 +28,14 @@ pub fn generate_ffi_dart_type(ret: Option<&FfiType>) -> dart::Tokens {
2228 return quote ! ( void)
2329 } ;
2430 match * ret_type {
31+ FfiType :: UInt8 => quote ! ( int) ,
32+ FfiType :: UInt16 => quote ! ( int) ,
2533 FfiType :: UInt32 => quote ! ( int) ,
34+ FfiType :: UInt64 => quote ! ( int) ,
2635 FfiType :: Int8 => quote ! ( int) ,
36+ FfiType :: Int16 => quote ! ( int) ,
37+ FfiType :: Int32 => quote ! ( int) ,
38+ FfiType :: Int64 => quote ! ( int) ,
2739 FfiType :: RustBuffer ( ref inner) => match inner {
2840 Some ( i) => quote ! ( $i) ,
2941 _ => quote ! ( RustBuffer ) ,
@@ -35,7 +47,16 @@ pub fn generate_ffi_dart_type(ret: Option<&FfiType>) -> dart::Tokens {
3547
3648pub fn generate_type ( ty : & Type ) -> dart:: Tokens {
3749 match ty {
38- Type :: UInt8 | Type :: UInt32 => quote ! ( int) ,
50+ Type :: UInt8
51+ | Type :: UInt32
52+ | Type :: Int8
53+ | Type :: Int16
54+ | Type :: Int64
55+ | Type :: UInt16
56+ | Type :: Int32
57+ | Type :: UInt64
58+ | Type :: Float32
59+ | Type :: Float64 => quote ! ( int) ,
3960 Type :: String => quote ! ( String ) ,
4061 Type :: Object ( name) => quote ! ( $name) ,
4162 Type :: Boolean => quote ! ( bool ) ,
@@ -87,7 +108,16 @@ pub fn convert_to_rust_buffer(ty: &Type, inner: dart::Tokens) -> dart::Tokens {
87108
88109pub fn type_lift_fn ( ty : & Type , inner : dart:: Tokens ) -> dart:: Tokens {
89110 match ty {
90- Type :: UInt32 => inner,
111+ Type :: Int8
112+ | Type :: UInt8
113+ | Type :: Int16
114+ | Type :: UInt16
115+ | Type :: Int32
116+ | Type :: Int64
117+ | Type :: UInt32
118+ | Type :: UInt64
119+ | Type :: Float32
120+ | Type :: Float64 => inner,
91121 Type :: Boolean => quote ! ( ( $inner) > 0 ) ,
92122 Type :: String => quote ! ( liftString( api, $inner) ) ,
93123 Type :: Object ( name) => quote ! ( $name. lift( api, $inner) ) ,
@@ -100,7 +130,17 @@ pub fn type_lift_fn(ty: &Type, inner: dart::Tokens) -> dart::Tokens {
100130
101131pub fn type_lower_fn ( ty : & Type , inner : dart:: Tokens ) -> dart:: Tokens {
102132 match ty {
103- Type :: UInt32 | Type :: Boolean => inner,
133+ Type :: UInt32
134+ | Type :: Int8
135+ | Type :: UInt8
136+ | Type :: Int16
137+ | Type :: UInt16
138+ | Type :: Int32
139+ | Type :: Int64
140+ | Type :: UInt64
141+ | Type :: Float32
142+ | Type :: Float64
143+ | Type :: Boolean => inner,
104144 Type :: String => quote ! ( lowerString( api, $inner) ) ,
105145 Type :: Object ( name) => quote ! ( $name. lower( api, $inner) ) ,
106146 Type :: Optional ( o) => {
0 commit comments