File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -58,8 +58,8 @@ static void _twin_fbdev_put_span(twin_coord_t left,
5858 twin_coord_t width = right - left ;
5959 off_t off = top * screen -> width + left ;
6060 uint32_t * dest =
61- (uint32_t * ) ((uintptr_t ) tx -> fb_base + (off * sizeof (uint32_t )));
62- memcpy (dest , pixels , width * sizeof (uint32_t ));
61+ (uint32_t * ) ((uintptr_t ) tx -> fb_base + (off * sizeof (* dest )));
62+ memcpy (dest , pixels , width * sizeof (* dest ));
6363}
6464
6565static void twin_fbdev_get_screen_size (twin_fbdev_t * tx ,
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ static void _twin_sdl_put_span(twin_coord_t left,
5050 }
5151 if ((top + 1 - tx -> image_y ) == tx -> height ) {
5252 SDL_UpdateTexture (tx -> texture , NULL , tx -> pixels ,
53- screen -> width * sizeof (uint32_t ));
53+ screen -> width * sizeof (* pixels ));
5454 SDL_RenderCopy (tx -> render , tx -> texture , NULL , NULL );
5555 SDL_RenderPresent (tx -> render );
5656 }
@@ -157,8 +157,8 @@ twin_context_t *twin_sdl_init(int width, int height)
157157 goto bail ;
158158 }
159159
160- tx -> pixels = malloc (width * height * sizeof (uint32_t ));
161- memset (tx -> pixels , 255 , width * height * sizeof (uint32_t ));
160+ tx -> pixels = malloc (width * height * sizeof (* tx -> pixels ));
161+ memset (tx -> pixels , 255 , width * height * sizeof (* tx -> pixels ));
162162
163163 tx -> render = SDL_CreateRenderer (tx -> win , -1 , SDL_RENDERER_ACCELERATED );
164164 if (!tx -> render ) {
You can’t perform that action at this time.
0 commit comments