dev: add -Wextra in Makefile and clean warnings

This commit is contained in:
Zy 2024-10-12 19:48:10 +02:00
parent 9264c47494
commit 6592ec43fd
5 changed files with 10 additions and 3 deletions

View file

@ -35,6 +35,7 @@ t_image mlx_new_image(void *mlx_ptr, int width, int height)
int mlx_destroy_image(t_mlx mlx_ptr, t_image img_ptr)
{
(void)mlx_ptr;
if (img_ptr)
free(((t_internal_image *)img_ptr)->data);
free(img_ptr);

View file

@ -22,6 +22,7 @@ void mlx3ds_internal_fatalerror(const char *msg)
void mlx3ds_internal_drawstart(
t_internal_mlx *mlx_ptr, t_internal_win *win_ptr)
{
(void)mlx_ptr;
win_ptr->framebuffer = gfxGetFramebuffer(GFX_TOP, GFX_LEFT,
&win_ptr->framebuffer_height, &win_ptr->framebuffer_width);
gspWaitForVBlank();
@ -30,6 +31,8 @@ void mlx3ds_internal_drawstart(
void mlx3ds_internal_drawend(
t_internal_mlx *mlx_ptr, t_internal_win *win_ptr)
{
(void)mlx_ptr;
(void)win_ptr;
gfxFlushBuffers();
gfxSwapBuffers();
}

View file

@ -73,6 +73,7 @@ char *mlx_int_static_line(char **xpm_data,int *pos,int size)
int len2;
char *str;
(void)size;
str = xpm_data[(*pos)++];
if ((len2 = strlen(str))>len)
{
@ -127,6 +128,7 @@ int mlx_int_xpm_set_pixel(t_internal_image *img, u8 *data, int opp, int col, int
{
int dec;
(void)img;
dec = opp;
while (dec--)
{
@ -293,7 +295,8 @@ t_image mlx_xpm_file_to_image(t_mlx xvar, const char *file,int *width,int *heigh
return (NULL);
ptr = strdup(asset->data);
mlx_int_file_get_rid_comment(ptr, asset->size);
if (img = mlx_int_parse_xpm(xvar,ptr,asset->size,mlx_int_get_line))
img = mlx_int_parse_xpm(xvar,ptr,asset->size,mlx_int_get_line);
if (img)
{
*width = img->width;
*height = img->height;