Skip to content

Commit 0a253e3

Browse files
committed
Silence warnings backport
1 parent 59d74a0 commit 0a253e3

16 files changed

Lines changed: 58 additions & 38 deletions

File tree

audio/common/pipewire.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,10 @@ bool pipewire_core_init(pipewire_core_t **pw, const char *loop_name, const struc
138138
void pipewire_core_deinit(pipewire_core_t *pw)
139139
{
140140
if (!pw)
141-
return pw_deinit();
141+
{
142+
pw_deinit();
143+
return;
144+
}
142145

143146
if (pw->thread_loop)
144147
pw_thread_loop_stop(pw->thread_loop);

audio/drivers/alsathread.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,11 @@ static void alsa_microphone_worker_thread(void *mic_context)
212212
RARCH_DBG("[ALSA] [capture thread %p] Ending microphone worker thread.\n", thread_id);
213213
}
214214

215-
static int alsa_thread_microphone_read(void *driver_context, void *mic_context, void *s, size_t len)
215+
static int alsa_thread_microphone_read(void *driver_context, void *mic_context, void *sv, size_t len)
216216
{
217217
snd_pcm_state_t state;
218218
size_t _len = 0;
219+
uint8_t *s = (uint8_t*)sv;
219220
alsa_thread_microphone_t *alsa = (alsa_thread_microphone_t*)driver_context;
220221
alsa_thread_microphone_handle_t *mic = (alsa_thread_microphone_handle_t*)mic_context;
221222

audio/drivers/pipewire.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,16 @@ static void pwire_capture_process_cb(void *data)
132132
if (!(b = pw_stream_dequeue_buffer(mic->stream)))
133133
{
134134
RARCH_ERR("[Microphone] [PipeWire] Out of buffers: %s.\n", strerror(errno));
135-
return pw_thread_loop_signal(mic->pw->thread_loop, false);
135+
pw_thread_loop_signal(mic->pw->thread_loop, false);
136+
return;
136137
}
137138

138139
buf = b->buffer;
139140
if ((p = buf->datas[0].data) == NULL)
140-
return pw_thread_loop_signal(mic->pw->thread_loop, false);
141+
{
142+
pw_thread_loop_signal(mic->pw->thread_loop, false);
143+
return;
144+
}
141145

142146
offs = MIN(buf->datas[0].chunk->offset, buf->datas[0].maxsize);
143147
n_bytes = MIN(buf->datas[0].chunk->size, buf->datas[0].maxsize - offs);
@@ -494,12 +498,16 @@ static void pwire_playback_process_cb(void *data)
494498
if ((b = pw_stream_dequeue_buffer(audio->stream)) == NULL)
495499
{
496500
RARCH_WARN("[PipeWire] Out of buffers: %s.\n", strerror(errno));
497-
return pw_thread_loop_signal(audio->pw->thread_loop, false);
501+
pw_thread_loop_signal(audio->pw->thread_loop, false);
502+
return;
498503
}
499504

500505
buf = b->buffer;
501506
if ((p = buf->datas[0].data) == NULL)
502-
return pw_thread_loop_signal(audio->pw->thread_loop, false);
507+
{
508+
pw_thread_loop_signal(audio->pw->thread_loop, false);
509+
return;
510+
}
503511

504512
/* calculate the total no of bytes to read data from buffer */
505513
n_bytes = buf->datas[0].maxsize;

audio/drivers/sdl_audio.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,10 @@ static void sdl_microphone_set_nonblock_state(void *driver_context, bool state)
313313
sdl->nonblock = state;
314314
}
315315

316-
static int sdl_microphone_read(void *driver_context, void *mic_context, void *s, size_t len)
316+
static int sdl_microphone_read(void *driver_context, void *mic_context, void *sv, size_t len)
317317
{
318-
int ret = 0;
318+
int ret = 0;
319+
uint8_t *s = (uint8_t*)sv;
319320
sdl_microphone_t *sdl = (sdl_microphone_t*)driver_context;
320321
sdl_microphone_handle_t *mic = (sdl_microphone_handle_t*)mic_context;
321322

command.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ bool command_seek_replay(command_t *cmd, const char *arg)
826826
{
827827
_len = strlcpy(reply, "OK ", sizeof(reply));
828828
_len += snprintf(reply+_len, sizeof(reply)-_len,
829-
"%lld", input_st->bsv_movie_state.seek_target_frame);
829+
"%" PRId64, input_st->bsv_movie_state.seek_target_frame);
830830
}
831831
else
832832
_len = strlcpy(reply, "NO", sizeof(reply));

cores/libretro-ffmpeg/ffmpeg_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static video_buffer_t *video_buffer;
9898
static tpool_t *tpool;
9999

100100
#ifndef FFMPEG3
101-
#define FFMPEG3 ((LIBAVUTIL_VERSION_INT < (56, 6, 100)) || \
101+
#define FFMPEG3 ((LIBAVUTIL_VERSION_INT < AV_VERSION_INT(56, 6, 100)) || \
102102
(LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100)))
103103
#endif
104104
#ifndef FFMPEG8

cores/libretro-video-processor/video_processor_v4l2.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ struct v4l2_resolution
7878

7979
struct v4l2_resolution v4l2_resolutions[] =
8080
{
81-
//4:3
81+
/* 4:3 */
8282
{160,120},
8383
{320,240},
8484
{480,320},
@@ -92,7 +92,7 @@ struct v4l2_resolution v4l2_resolutions[] =
9292
{1440,1080},
9393
{1600,1200},
9494
{1920,1440},
95-
//16:9
95+
/* 16:9 */
9696
{640,360},
9797
{960,540},
9898
{1280,720},
@@ -291,7 +291,8 @@ static void enumerate_audio_devices(char *s, size_t len)
291291
continue;
292292
}
293293

294-
//todo: add more info to make picking audio device more user friendly
294+
/* TODO/FIXME: Add more info to make picking
295+
* audio device more user friendly */
295296
descr = snd_device_name_get_hint(*n, "DESC");
296297
if (!descr)
297298
{
@@ -305,8 +306,9 @@ static void enumerate_audio_devices(char *s, size_t len)
305306
appendstr(s, name, len);
306307
++ndevs;
307308

308-
// not sure if this is necessary but ensuring things are free/null
309-
if(name != NULL)
309+
/* Not sure if this is necessary
310+
* but ensuring things are free/NULL */
311+
if (name)
310312
{
311313
free(name);
312314
name = NULL;
@@ -593,6 +595,7 @@ RETRO_API void VIDEOPROC_CORE_PREFIX(retro_get_system_av_info)(struct retro_syst
593595
}
594596
else
595597
{
598+
bool nodouble;
596599
/*
597600
* Query the device cropping limits. If available, we can use this to find the capture pixel aspect.
598601
*/
@@ -618,14 +621,14 @@ RETRO_API void VIDEOPROC_CORE_PREFIX(retro_get_system_av_info)(struct retro_syst
618621
printf("Resolution postfix %ux%u\n", info->geometry.base_width,
619622
info->geometry.base_height);
620623
}
621-
// no doubling for interlaced or deinterlaced capture
622-
bool nodouble = strcmp(video_capture_mode, "deinterlaced") == 0 || strcmp(video_capture_mode, "interlaced") == 0;
624+
/* no doubling for interlaced or deinterlaced capture */
625+
nodouble = strcmp(video_capture_mode, "deinterlaced") == 0 || strcmp(video_capture_mode, "interlaced") == 0;
623626
info->geometry.max_height = nodouble ? video_format.fmt.pix.height : video_format.fmt.pix.height * 2;
624627

625628
/* TODO Only double if frames ARE fields (progressive or deinterlaced, full framerate)
626629
* *2 for fields
627630
*/
628-
// defaulting to 60 if this this doesn't return a usable number
631+
/* Defaulting to 60 if this this doesn't return a usable number */
629632
if(video_standard.frameperiod.denominator == 0 || video_standard.frameperiod.numerator == 0)
630633
info->timing.fps = 60;
631634
else
@@ -1281,7 +1284,7 @@ RETRO_API bool VIDEOPROC_CORE_PREFIX(retro_load_game)(const struct retro_game_in
12811284
fmt.fmt.pix.colorspace = V4L2_COLORSPACE_SRGB;
12821285
fmt.fmt.pix.quantization = V4L2_QUANTIZATION_LIM_RANGE;
12831286

1284-
// applied set resolution if not set to auto
1287+
/* Applied set resolution if not set to auto */
12851288
if (strcmp(video_capture_resolution, "auto") != 0)
12861289
{
12871290
strcpy(splitresolution, video_capture_resolution);

gfx/common/wayland_common.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ static bool wl_create_toplevel_icon(gfx_ctx_wayland_data_t *wl, struct xdg_tople
631631
return true;
632632
}
633633

634+
#ifndef HAVE_LIBDECOR_H
634635
static void shm_buffer_paint_checkerboard(
635636
shm_buffer_t *buffer,
636637
int width, int height, int scale,
@@ -705,6 +706,7 @@ static bool wl_draw_splash_screen(gfx_ctx_wayland_data_t *wl)
705706

706707
return true;
707708
}
709+
#endif
708710

709711
bool gfx_ctx_wl_init_common(
710712
const toplevel_listener_t *toplevel_listener, gfx_ctx_wayland_data_t **wwl)
@@ -926,7 +928,7 @@ bool gfx_ctx_wl_init_common(
926928

927929
/* Make sure splash screen is on screen and sized */
928930
wl->configured = true;
929-
931+
930932
while (wl->configured)
931933
wl_display_dispatch(wl->input.dpy);
932934
}

gfx/drivers_context/sdl_gl_ctx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,8 @@ static void sdl_ctx_input_driver(void *data,
406406

407407
static gfx_ctx_proc_t sdl_ctx_get_proc_address(const char *name)
408408
{
409-
return (gfx_ctx_proc_t)SDL_GL_GetProcAddress(name);
409+
void *addr = SDL_GL_GetProcAddress(name);
410+
return *((gfx_ctx_proc_t*)(&addr));
410411
}
411412

412413
static void sdl_ctx_show_mouse(void *data, bool state) { SDL_ShowCursor(state); }

gfx/drivers_context/wayland_ctx.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,7 @@ static const toplevel_listener_t toplevel_listener = {
155155
},
156156
};
157157

158-
static const toplevel_listener_t xdg_toplevel_listener = {
159-
};
158+
static const toplevel_listener_t xdg_toplevel_listener = {0};
160159

161160
#ifdef HAVE_EGL
162161
#define WL_EGL_ATTRIBS_BASE \

0 commit comments

Comments
 (0)