1- use std:: { cell:: RefCell , collections:: HashMap , rc:: Rc } ;
1+ use std:: { cell:: RefCell , collections:: HashMap , rc:: Rc , os :: raw :: c_char } ;
22
33use crosscom:: ComRc ;
44use encoding:: { DecoderTrap , Encoding } ;
@@ -303,7 +303,7 @@ impl SWD5Context {
303303 . map ( |source| source. borrow_mut ( ) . stop ( ) ) ;
304304 }
305305
306- fn storymsg ( & mut self , text : * const i8 ) {
306+ fn storymsg ( & mut self , text : * const c_char ) {
307307 let text = decode_big5 ( text) ;
308308 let [ width, height] = self . ui . ui ( ) . io ( ) . display_size ;
309309
@@ -313,14 +313,14 @@ impl SWD5Context {
313313 } ) ;
314314 }
315315
316- fn talkmsg ( & mut self , name : * const i8 , text : * const i8 ) {
316+ fn talkmsg ( & mut self , name : * const c_char , text : * const c_char ) {
317317 let name = decode_big5 ( name) ;
318318 let text = decode_big5 ( text) ;
319319
320320 self . talk_msg = Some ( TalkMsg { name, text } ) ;
321321 }
322322
323- fn storymsgpos ( & mut self , text : * const i8 , x : f64 , y : f64 ) {
323+ fn storymsgpos ( & mut self , text : * const c_char , x : f64 , y : f64 ) {
324324 let text = decode_big5 ( text) ;
325325 let ( start, size) = calc_43_box ( self . ui . ui ( ) ) ;
326326 let x = x as f32 / 960. * size[ 0 ] ;
@@ -477,7 +477,7 @@ extern "C" fn sleep(state: *mut lua_State) -> i32 {
477477 }
478478}
479479
480- fn decode_big5 ( s : * const i8 ) -> String {
480+ fn decode_big5 ( s : * const c_char ) -> String {
481481 let str = unsafe { std:: ffi:: CStr :: from_ptr ( s) } ;
482482 let str = encoding:: all:: BIG5_2003 . decode ( str. to_bytes ( ) , DecoderTrap :: Ignore ) ;
483483 match str {
0 commit comments