Skip to content

Commit

Permalink
implement uint16_t conversion (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemkaKun authored Sep 8, 2023
1 parent bb8c478 commit 0eb7eda
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/c2v.v
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,9 @@ fn convert_type(typ_ string) Type {
'int16_t' {
'i16'
}
'uint16_t' {
'u16'
}
'uint8_t' {
'u8'
}
Expand Down Expand Up @@ -1239,7 +1242,7 @@ fn (mut c C2V) case_st(mut child Node, is_enum bool) bool {
default:
MD_UNREACHABLE();
*/
//c.gen('/*TODO fallthrough*/')
// c.gen('/*TODO fallthrough*/')
} else {
c.statement(mut a)
}
Expand Down
3 changes: 3 additions & 0 deletions tests/18.header_types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include <stdint.h>

uint16_t ts_f32tof16(float f);
8 changes: 8 additions & 0 deletions tests/18.header_types.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[translated]
module tests

fn C.ts_f32tof16(f f32) u16

pub fn ts_f32tof16(f f32) u16 {
return C.ts_f32tof16(f)
}

0 comments on commit 0eb7eda

Please sign in to comment.