@@ -8,18 +8,20 @@ pub unsafe fn test() {
88 info ! ( "Running graphics output protocol test" ) ;
99 let handle =
1010 boot:: get_handle_for_protocol :: < GraphicsOutput > ( ) . expect ( "missing GraphicsOutput protocol" ) ;
11- let gop = & mut boot:: open_protocol :: < GraphicsOutput > (
12- OpenProtocolParams {
13- handle,
14- agent : boot:: image_handle ( ) ,
15- controller : None ,
16- } ,
17- // For this test, don't open in exclusive mode. That
18- // would break the connection between stdout and the
19- // video console.
20- OpenProtocolAttributes :: GetProtocol ,
21- )
22- . expect ( "failed to open Graphics Output Protocol" ) ;
11+ let gop = unsafe {
12+ & mut boot:: open_protocol :: < GraphicsOutput > (
13+ OpenProtocolParams {
14+ handle,
15+ agent : boot:: image_handle ( ) ,
16+ controller : None ,
17+ } ,
18+ // For this test, don't open in exclusive mode. That
19+ // would break the connection between stdout and the
20+ // video console.
21+ OpenProtocolAttributes :: GetProtocol ,
22+ )
23+ . expect ( "failed to open Graphics Output Protocol" )
24+ } ;
2325
2426 set_graphics_mode ( gop) ;
2527 fill_color ( gop) ;
@@ -73,10 +75,10 @@ fn draw_fb(gop: &mut GraphicsOutput) {
7375
7476 type PixelWriter = unsafe fn ( & mut FrameBuffer , usize , [ u8 ; 3 ] ) ;
7577 unsafe fn write_pixel_rgb ( fb : & mut FrameBuffer , pixel_base : usize , rgb : [ u8 ; 3 ] ) {
76- fb. write_value ( pixel_base, rgb) ;
78+ unsafe { fb. write_value ( pixel_base, rgb) }
7779 }
7880 unsafe fn write_pixel_bgr ( fb : & mut FrameBuffer , pixel_base : usize , rgb : [ u8 ; 3 ] ) {
79- fb. write_value ( pixel_base, [ rgb[ 2 ] , rgb[ 1 ] , rgb[ 0 ] ] ) ;
81+ unsafe { fb. write_value ( pixel_base, [ rgb[ 2 ] , rgb[ 1 ] , rgb[ 0 ] ] ) }
8082 }
8183 let write_pixel: PixelWriter = match mi. pixel_format ( ) {
8284 PixelFormat :: Rgb => write_pixel_rgb,
0 commit comments