@@ -89,27 +89,25 @@ impl ForeignFunctionTable {
8989 }
9090
9191 fn map_type_ffi ( & mut self , source : & Atom ) -> * mut ffi_type {
92- unsafe {
93- match source {
94- atom ! ( "sint64" ) => addr_of_mut ! ( types:: sint64) ,
95- atom ! ( "sint32" ) => addr_of_mut ! ( types:: sint32) ,
96- atom ! ( "sint16" ) => addr_of_mut ! ( types:: sint16) ,
97- atom ! ( "sint8" ) => addr_of_mut ! ( types:: sint8) ,
98- atom ! ( "uint64" ) => addr_of_mut ! ( types:: uint64) ,
99- atom ! ( "uint32" ) => addr_of_mut ! ( types:: uint32) ,
100- atom ! ( "uint16" ) => addr_of_mut ! ( types:: uint16) ,
101- atom ! ( "uint8" ) => addr_of_mut ! ( types:: uint8) ,
102- atom ! ( "bool" ) => addr_of_mut ! ( types:: sint8) ,
103- atom ! ( "void" ) => addr_of_mut ! ( types:: void) ,
104- atom ! ( "cstr" ) => addr_of_mut ! ( types:: pointer) ,
105- atom ! ( "ptr" ) => addr_of_mut ! ( types:: pointer) ,
106- atom ! ( "f32" ) => addr_of_mut ! ( types:: float) ,
107- atom ! ( "f64" ) => addr_of_mut ! ( types:: double) ,
108- struct_name => match self . structs . get_mut ( & * struct_name. as_str ( ) ) {
109- Some ( ref mut struct_type) => & mut struct_type. ffi_type ,
110- None => unreachable ! ( ) ,
111- } ,
112- }
92+ match source {
93+ atom ! ( "sint64" ) => addr_of_mut ! ( types:: sint64) ,
94+ atom ! ( "sint32" ) => addr_of_mut ! ( types:: sint32) ,
95+ atom ! ( "sint16" ) => addr_of_mut ! ( types:: sint16) ,
96+ atom ! ( "sint8" ) => addr_of_mut ! ( types:: sint8) ,
97+ atom ! ( "uint64" ) => addr_of_mut ! ( types:: uint64) ,
98+ atom ! ( "uint32" ) => addr_of_mut ! ( types:: uint32) ,
99+ atom ! ( "uint16" ) => addr_of_mut ! ( types:: uint16) ,
100+ atom ! ( "uint8" ) => addr_of_mut ! ( types:: uint8) ,
101+ atom ! ( "bool" ) => addr_of_mut ! ( types:: sint8) ,
102+ atom ! ( "void" ) => addr_of_mut ! ( types:: void) ,
103+ atom ! ( "cstr" ) => addr_of_mut ! ( types:: pointer) ,
104+ atom ! ( "ptr" ) => addr_of_mut ! ( types:: pointer) ,
105+ atom ! ( "f32" ) => addr_of_mut ! ( types:: float) ,
106+ atom ! ( "f64" ) => addr_of_mut ! ( types:: double) ,
107+ struct_name => match self . structs . get_mut ( & * struct_name. as_str ( ) ) {
108+ Some ( ref mut struct_type) => & mut struct_type. ffi_type ,
109+ None => unreachable ! ( ) ,
110+ } ,
113111 }
114112 }
115113
0 commit comments