File tree 2 files changed +5
-5
lines changed
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,
58
58
twin_coord_t width = right - left ;
59
59
off_t off = top * screen -> width + left ;
60
60
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 ));
63
63
}
64
64
65
65
static 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,
50
50
}
51
51
if ((top + 1 - tx -> image_y ) == tx -> height ) {
52
52
SDL_UpdateTexture (tx -> texture , NULL , tx -> pixels ,
53
- screen -> width * sizeof (uint32_t ));
53
+ screen -> width * sizeof (* pixels ));
54
54
SDL_RenderCopy (tx -> render , tx -> texture , NULL , NULL );
55
55
SDL_RenderPresent (tx -> render );
56
56
}
@@ -157,8 +157,8 @@ twin_context_t *twin_sdl_init(int width, int height)
157
157
goto bail ;
158
158
}
159
159
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 ));
162
162
163
163
tx -> render = SDL_CreateRenderer (tx -> win , -1 , SDL_RENDERER_ACCELERATED );
164
164
if (!tx -> render ) {
You can’t perform that action at this time.
0 commit comments