From ba145c57f0a11e2000fa5829717783849e7dfaf8 Mon Sep 17 00:00:00 2001 From: "Joseph C. Osborn" Date: Thu, 30 Oct 2025 08:58:11 -0700 Subject: [PATCH 1/3] Fix warnings Except for deps and the parts that are specifically pipewire includes, this compiles under pedantic and C89 for me on Linux. Mostly this was fixing issues, but in pipewire's case it involved ignoring some errors. --- Makefile.emscripten | 2 +- audio/common/pipewire.c | 20 ++++-- audio/common/pipewire.h | 4 +- audio/drivers/alsathread.c | 3 +- audio/drivers/pipewire.c | 30 +++++++-- audio/drivers/sdl_audio.c | 3 +- camera/drivers/pipewire.c | 19 +++++- command.c | 2 +- cores/libretro-ffmpeg/ffmpeg_core.c | 2 +- .../video_processor_v4l2.c | 17 ++--- gfx/common/wayland_common.c | 4 +- gfx/drivers_context/sdl_gl_ctx.c | 3 +- gfx/drivers_context/wayland_ctx.c | 3 +- gfx/video_crt_switch.c | 12 ++-- input/bsv/uint32s_index.c | 6 +- input/drivers_joypad/test_joypad.c | 4 +- libretro-common/include/libchdr/chd.h | 8 +-- libretro-common/include/retro_miscellaneous.h | 2 + libretro-common/net/cacert.h | 5 ++ menu/menu_setting.c | 4 +- record/drivers/record_ffmpeg.c | 2 +- runloop.h | 64 +++++++++---------- tasks/task_autodetect.c | 8 +-- 23 files changed, 143 insertions(+), 84 deletions(-) diff --git a/Makefile.emscripten b/Makefile.emscripten index 8446a1e9640c..a42b8089cc28 100644 --- a/Makefile.emscripten +++ b/Makefile.emscripten @@ -283,7 +283,7 @@ endif ifeq ($(DEBUG), 1) LDFLAGS += -O0 -g -gsource-map -s SAFE_HEAP=2 -s STACK_OVERFLOW_CHECK=2 -s ASSERTIONS=1 # -O0 in cflags gives "too many locals" errors - CFLAGS += -O1 -g -gsource-map + CFLAGS += -O1 -g -gsource-map -Wall -Werror else LDFLAGS += -O3 # WARNING: some optimizations can break some cores (ex: LTO breaks tyrquake) diff --git a/audio/common/pipewire.c b/audio/common/pipewire.c index c2ff2f882e02..f81db9a64b75 100644 --- a/audio/common/pipewire.c +++ b/audio/common/pipewire.c @@ -27,9 +27,11 @@ static void core_error_cb(void *data, uint32_t id, int seq, int res, const char { pipewire_core_t *pw = (pipewire_core_t*)data; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" RARCH_ERR("[PipeWire] Error id:%u seq:%d res:%d (%s): %s.\n", id, seq, res, spa_strerror(res), message); - +#pragma GCC diagnostic pop pw_thread_loop_stop(pw->thread_loop); } @@ -54,8 +56,10 @@ static const struct pw_core_events core_events = { void pipewire_core_wait_resync(pipewire_core_t *pw) { retro_assert(pw); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" pw->pending_seq = pw_core_sync(pw->core, PW_ID_CORE, pw->pending_seq); - +#pragma GCC diagnostic pop for (;;) { pw_thread_loop_wait(pw->thread_loop); @@ -116,16 +120,21 @@ bool pipewire_core_init(pipewire_core_t **pw, const char *loop_name, const struc if (!(*pw)->core) goto unlock; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" if (pw_core_add_listener((*pw)->core, &(*pw)->core_listener, &core_events, *pw) < 0) goto unlock; - +#pragma GCC diagnostic pop if (events) { (*pw)->registry = pw_core_get_registry((*pw)->core, PW_VERSION_REGISTRY, 0); spa_zero((*pw)->registry_listener); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" pw_registry_add_listener((*pw)->registry, &(*pw)->registry_listener, events, *pw); +#pragma GCC diagnostic pop } return true; @@ -138,7 +147,10 @@ bool pipewire_core_init(pipewire_core_t **pw, const char *loop_name, const struc void pipewire_core_deinit(pipewire_core_t *pw) { if (!pw) - return pw_deinit(); + { + pw_deinit(); + return; + } if (pw->thread_loop) pw_thread_loop_stop(pw->thread_loop); diff --git a/audio/common/pipewire.h b/audio/common/pipewire.h index 7156c9bc4602..66b09dbaa256 100644 --- a/audio/common/pipewire.h +++ b/audio/common/pipewire.h @@ -18,10 +18,12 @@ #define _RETROARCH_PIPEWIRE #include - +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" #include #include #include +#pragma GCC diagnostic pop #include diff --git a/audio/drivers/alsathread.c b/audio/drivers/alsathread.c index b21ccb859ed3..a9f77c3b7bd1 100644 --- a/audio/drivers/alsathread.c +++ b/audio/drivers/alsathread.c @@ -212,10 +212,11 @@ static void alsa_microphone_worker_thread(void *mic_context) RARCH_DBG("[ALSA] [capture thread %p] Ending microphone worker thread.\n", thread_id); } -static int alsa_thread_microphone_read(void *driver_context, void *mic_context, void *s, size_t len) +static int alsa_thread_microphone_read(void *driver_context, void *mic_context, void *sv, size_t len) { snd_pcm_state_t state; size_t _len = 0; + uint8_t *s = (uint8_t *)sv; alsa_thread_microphone_t *alsa = (alsa_thread_microphone_t*)driver_context; alsa_thread_microphone_handle_t *mic = (alsa_thread_microphone_handle_t*)mic_context; diff --git a/audio/drivers/pipewire.c b/audio/drivers/pipewire.c index 4655dfac496e..ee4a7be549cd 100644 --- a/audio/drivers/pipewire.c +++ b/audio/drivers/pipewire.c @@ -12,12 +12,14 @@ * You should have received a copy of the GNU General Public License along with RetroArch. * If not, see . */ - +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" #include #include #include #include #include +#pragma GCC diagnostic pop #include #include @@ -132,12 +134,16 @@ static void pwire_capture_process_cb(void *data) if (!(b = pw_stream_dequeue_buffer(mic->stream))) { RARCH_ERR("[Microphone] [PipeWire] Out of buffers: %s.\n", strerror(errno)); - return pw_thread_loop_signal(mic->pw->thread_loop, false); + pw_thread_loop_signal(mic->pw->thread_loop, false); + return; } buf = b->buffer; if ((p = buf->datas[0].data) == NULL) - return pw_thread_loop_signal(mic->pw->thread_loop, false); + { + pw_thread_loop_signal(mic->pw->thread_loop, false); + return; + } offs = MIN(buf->datas[0].chunk->offset, buf->datas[0].maxsize); n_bytes = MIN(buf->datas[0].chunk->size, buf->datas[0].maxsize - offs); @@ -216,8 +222,10 @@ static void *pwire_microphone_init(void) struct pw_properties *props = NULL; const char *error = NULL; pipewire_core_t *pw = NULL; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer)); - +#pragma GCC diagnostic pop if (!pipewire_core_init(&pw, "microphone_driver", &pwire_mic_registry_events)) goto error; @@ -336,7 +344,10 @@ static void *pwire_microphone_open_mic(void *driver_context, const struct spa_pod *params[1]; struct pw_properties *props = NULL; const char *error = NULL; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer)); +#pragma GCC diagnostic pop pipewire_microphone_t *mic = NULL; if (!driver_context || (mic = calloc(1, sizeof(pipewire_microphone_t))) == NULL) @@ -494,12 +505,16 @@ static void pwire_playback_process_cb(void *data) if ((b = pw_stream_dequeue_buffer(audio->stream)) == NULL) { RARCH_WARN("[PipeWire] Out of buffers: %s.\n", strerror(errno)); - return pw_thread_loop_signal(audio->pw->thread_loop, false); + pw_thread_loop_signal(audio->pw->thread_loop, false); + return; } buf = b->buffer; if ((p = buf->datas[0].data) == NULL) - return pw_thread_loop_signal(audio->pw->thread_loop, false); + { + pw_thread_loop_signal(audio->pw->thread_loop, false); + return; + } /* calculate the total no of bytes to read data from buffer */ n_bytes = buf->datas[0].maxsize; @@ -596,7 +611,10 @@ static void *pwire_init(const char *device, unsigned rate, struct pw_properties *props = NULL; const char *error = NULL; pipewire_audio_t *audio = (pipewire_audio_t*)calloc(1, sizeof(*audio)); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer)); +#pragma GCC diagnostic pop if (!audio) return NULL; diff --git a/audio/drivers/sdl_audio.c b/audio/drivers/sdl_audio.c index b36f493f7cd2..66141c24e260 100644 --- a/audio/drivers/sdl_audio.c +++ b/audio/drivers/sdl_audio.c @@ -313,11 +313,12 @@ static void sdl_microphone_set_nonblock_state(void *driver_context, bool state) sdl->nonblock = state; } -static int sdl_microphone_read(void *driver_context, void *mic_context, void *s, size_t len) +static int sdl_microphone_read(void *driver_context, void *mic_context, void *sv, size_t len) { int ret = 0; sdl_microphone_t *sdl = (sdl_microphone_t*)driver_context; sdl_microphone_handle_t *mic = (sdl_microphone_handle_t*)mic_context; + uint8_t *s = (uint8_t *)sv; if (!sdl || !mic || !s) return -1; diff --git a/camera/drivers/pipewire.c b/camera/drivers/pipewire.c index d868650771fb..c421c786b3fa 100644 --- a/camera/drivers/pipewire.c +++ b/camera/drivers/pipewire.c @@ -13,6 +13,8 @@ * If not, see . */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" #include #include #include @@ -21,6 +23,7 @@ #include #include #include +#pragma GCC diagnostic pop #include #include @@ -209,8 +212,10 @@ static void stream_param_changed_cb(void *data, uint32_t id, const struct spa_po uint8_t params_buffer[1024]; const struct spa_pod *params[5]; pipewire_camera_t *camera = (pipewire_camera_t*)data; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" struct spa_pod_builder b = SPA_POD_BUILDER_INIT(params_buffer, sizeof(params_buffer)); - +#pragma GCC diagnostic pop if (param && id == SPA_PARAM_Tag) { spa_debug_pod(0, NULL, param); @@ -258,6 +263,8 @@ static void stream_param_changed_cb(void *data, uint32_t id, const struct spa_po return; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" struct spa_pod_frame frame; spa_pod_builder_push_object(&b, &frame, SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers); spa_pod_builder_add(&b, @@ -270,7 +277,6 @@ static void stream_param_changed_cb(void *data, uint32_t id, const struct spa_po 0); params[0] = spa_pod_builder_pop(&b, &frame); - params[1] = spa_pod_builder_add_object(&b, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header), @@ -281,6 +287,7 @@ static void stream_param_changed_cb(void *data, uint32_t id, const struct spa_po SPA_PARAM_META_type, SPA_POD_Id(SPA_META_VideoTransform), SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_videotransform))); #endif +#pragma GCC diagnostic pop camera->buffer_output = (uint32_t *) malloc(camera->size.width * camera->size.height * sizeof(uint32_t)); @@ -372,8 +379,11 @@ static void *pipewire_init(const char *device, uint64_t caps, struct pw_properties *props; uint8_t buffer[1024]; pipewire_camera_t *camera = (pipewire_camera_t*)calloc(1, sizeof(*camera)); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer)); - +#pragma GCC diagnostic pop + if (!camera) goto error; @@ -420,7 +430,10 @@ static void *pipewire_init(const char *device, uint64_t caps, if (res < 0) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" RARCH_ERR("[Camera] [PipeWire] Can't connect: %s.\n", spa_strerror(res)); +#pragma GCC diagnostic pop goto error; } diff --git a/command.c b/command.c index 75f4a5c3495d..6f5cfdcc8dcc 100644 --- a/command.c +++ b/command.c @@ -826,7 +826,7 @@ bool command_seek_replay(command_t *cmd, const char *arg) { _len = strlcpy(reply, "OK ", sizeof(reply)); _len += snprintf(reply+_len, sizeof(reply)-_len, - "%lld", input_st->bsv_movie_state.seek_target_frame); + "%" PRId64, input_st->bsv_movie_state.seek_target_frame); } else _len = strlcpy(reply, "NO", sizeof(reply)); diff --git a/cores/libretro-ffmpeg/ffmpeg_core.c b/cores/libretro-ffmpeg/ffmpeg_core.c index 90272e8e2e24..051b5e3e4aee 100644 --- a/cores/libretro-ffmpeg/ffmpeg_core.c +++ b/cores/libretro-ffmpeg/ffmpeg_core.c @@ -98,7 +98,7 @@ static video_buffer_t *video_buffer; static tpool_t *tpool; #ifndef FFMPEG3 -#define FFMPEG3 ((LIBAVUTIL_VERSION_INT < (56, 6, 100)) || \ +#define FFMPEG3 ((LIBAVUTIL_VERSION_INT < AV_VERSION_INT(56, 6, 100)) || \ (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100))) #endif #ifndef FFMPEG8 diff --git a/cores/libretro-video-processor/video_processor_v4l2.c b/cores/libretro-video-processor/video_processor_v4l2.c index 34a40a37439a..5618db074533 100644 --- a/cores/libretro-video-processor/video_processor_v4l2.c +++ b/cores/libretro-video-processor/video_processor_v4l2.c @@ -78,7 +78,7 @@ struct v4l2_resolution struct v4l2_resolution v4l2_resolutions[] = { - //4:3 + /*4:3*/ {160,120}, {320,240}, {480,320}, @@ -92,7 +92,7 @@ struct v4l2_resolution v4l2_resolutions[] = {1440,1080}, {1600,1200}, {1920,1440}, - //16:9 + /*16:9*/ {640,360}, {960,540}, {1280,720}, @@ -291,7 +291,7 @@ static void enumerate_audio_devices(char *s, size_t len) continue; } - //todo: add more info to make picking audio device more user friendly + /*todo: add more info to make picking audio device more user friendly*/ descr = snd_device_name_get_hint(*n, "DESC"); if (!descr) { @@ -305,7 +305,7 @@ static void enumerate_audio_devices(char *s, size_t len) appendstr(s, name, len); ++ndevs; - // not sure if this is necessary but ensuring things are free/null + /* not sure if this is necessary but ensuring things are free/null*/ if(name != NULL) { free(name); @@ -593,6 +593,7 @@ RETRO_API void VIDEOPROC_CORE_PREFIX(retro_get_system_av_info)(struct retro_syst } else { + bool nodouble; /* * Query the device cropping limits. If available, we can use this to find the capture pixel aspect. */ @@ -618,14 +619,14 @@ RETRO_API void VIDEOPROC_CORE_PREFIX(retro_get_system_av_info)(struct retro_syst printf("Resolution postfix %ux%u\n", info->geometry.base_width, info->geometry.base_height); } - // no doubling for interlaced or deinterlaced capture - bool nodouble = strcmp(video_capture_mode, "deinterlaced") == 0 || strcmp(video_capture_mode, "interlaced") == 0; + /* no doubling for interlaced or deinterlaced capture*/ + nodouble = strcmp(video_capture_mode, "deinterlaced") == 0 || strcmp(video_capture_mode, "interlaced") == 0; info->geometry.max_height = nodouble ? video_format.fmt.pix.height : video_format.fmt.pix.height * 2; /* TODO Only double if frames ARE fields (progressive or deinterlaced, full framerate) * *2 for fields */ - // defaulting to 60 if this this doesn't return a usable number + /* defaulting to 60 if this this doesn't return a usable number*/ if(video_standard.frameperiod.denominator == 0 || video_standard.frameperiod.numerator == 0) info->timing.fps = 60; else @@ -1281,7 +1282,7 @@ RETRO_API bool VIDEOPROC_CORE_PREFIX(retro_load_game)(const struct retro_game_in fmt.fmt.pix.colorspace = V4L2_COLORSPACE_SRGB; fmt.fmt.pix.quantization = V4L2_QUANTIZATION_LIM_RANGE; - // applied set resolution if not set to auto + /* applied set resolution if not set to auto */ if (strcmp(video_capture_resolution, "auto") != 0) { strcpy(splitresolution, video_capture_resolution); diff --git a/gfx/common/wayland_common.c b/gfx/common/wayland_common.c index b5647a11ccee..00d88abce190 100644 --- a/gfx/common/wayland_common.c +++ b/gfx/common/wayland_common.c @@ -630,7 +630,7 @@ static bool wl_create_toplevel_icon(gfx_ctx_wayland_data_t *wl, struct xdg_tople return true; } - +#ifndef HAVE_LIBDECOR_H static void shm_buffer_paint_checkerboard( shm_buffer_t *buffer, int width, int height, int scale, @@ -659,7 +659,6 @@ static void shm_buffer_paint_checkerboard( } } } - static bool wl_draw_splash_screen(gfx_ctx_wayland_data_t *wl) { if (wl->single_pixel_manager) @@ -705,6 +704,7 @@ static bool wl_draw_splash_screen(gfx_ctx_wayland_data_t *wl) return true; } +#endif bool gfx_ctx_wl_init_common( const toplevel_listener_t *toplevel_listener, gfx_ctx_wayland_data_t **wwl) diff --git a/gfx/drivers_context/sdl_gl_ctx.c b/gfx/drivers_context/sdl_gl_ctx.c index e4ccebb1dbe0..5766c44bf45e 100644 --- a/gfx/drivers_context/sdl_gl_ctx.c +++ b/gfx/drivers_context/sdl_gl_ctx.c @@ -406,7 +406,8 @@ static void sdl_ctx_input_driver(void *data, static gfx_ctx_proc_t sdl_ctx_get_proc_address(const char *name) { - return (gfx_ctx_proc_t)SDL_GL_GetProcAddress(name); + void *addr = SDL_GL_GetProcAddress(name); + return *((gfx_ctx_proc_t*)(&addr)); } static void sdl_ctx_show_mouse(void *data, bool state) { SDL_ShowCursor(state); } diff --git a/gfx/drivers_context/wayland_ctx.c b/gfx/drivers_context/wayland_ctx.c index 4e2fa98c2a33..ea95ad80e0fa 100644 --- a/gfx/drivers_context/wayland_ctx.c +++ b/gfx/drivers_context/wayland_ctx.c @@ -155,8 +155,7 @@ static const toplevel_listener_t toplevel_listener = { }, }; -static const toplevel_listener_t xdg_toplevel_listener = { -}; +static const toplevel_listener_t xdg_toplevel_listener = {0}; #ifdef HAVE_EGL #define WL_EGL_ATTRIBS_BASE \ diff --git a/gfx/video_crt_switch.c b/gfx/video_crt_switch.c index 5bab8a54e02d..850fcb714ad8 100644 --- a/gfx/video_crt_switch.c +++ b/gfx/video_crt_switch.c @@ -179,12 +179,14 @@ static bool crt_sr2_init(videocrt_switch_t *p_switch, if (!p_switch->sr2_active) { + void (*logp)(const char *, ...) = &RARCH_LOG; + void (*dbgp)(const char *, ...) = &RARCH_DBG; + void (*errp)(const char *, ...) = &RARCH_ERR; sr_init(); -#if (__STDC_VERSION__ >= 199409L) /* no logs for C98 or less */ - sr_set_log_callback_info(RARCH_LOG); - sr_set_log_callback_debug(RARCH_DBG); - sr_set_log_callback_error(RARCH_ERR); -#endif + + sr_set_log_callback_info(*(void **)(&logp)); + sr_set_log_callback_debug(*(void **)(&dbgp)); + sr_set_log_callback_error(*(void **)(&errp)); switch (crt_mode) { diff --git a/input/bsv/uint32s_index.c b/input/bsv/uint32s_index.c index 226cf62b4d6d..d49f3f8c2a4e 100644 --- a/input/bsv/uint32s_index.c +++ b/input/bsv/uint32s_index.c @@ -17,7 +17,10 @@ uint32s_index_t *uint32s_index_new(size_t object_size, uint8_t commit_interval, uint32s_index_t *index = malloc(sizeof(uint32s_index_t)); index->object_size = object_size; index->index = NULL; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wtautological-compare" RHMAP_FIT(index->index, HASHMAP_CAP); +#pragma GCC diagnostic pop index->objects = NULL; index->counts = NULL; index->hashes = NULL; @@ -270,10 +273,9 @@ uint32_t *uint32s_index_get(uint32s_index_t *index, uint32_t which) void uint32s_index_pop(uint32s_index_t *index) { uint32_t idx = RBUF_LEN(index->objects)-1; - uint32_t *object = RBUF_POP(index->objects); - size_t size_bytes = index->object_size * sizeof(uint32_t); uint32_t hash = index->hashes[idx]; struct uint32s_bucket *bucket = RHMAP_PTR(index->index, hash); + RBUF_RESIZE(index->objects, idx); RBUF_RESIZE(index->counts, idx); RBUF_RESIZE(index->hashes, idx); uint32s_bucket_remove(bucket, idx); diff --git a/input/drivers_joypad/test_joypad.c b/input/drivers_joypad/test_joypad.c index f469c01bbe6f..8fc8e1a96df4 100644 --- a/input/drivers_joypad/test_joypad.c +++ b/input/drivers_joypad/test_joypad.c @@ -290,8 +290,8 @@ static const char *test_joypad_name(unsigned pad) static void test_joypad_autodetect_add(unsigned autoconf_pad) { - int vid = 0; - int pid = 0; + unsigned int vid = 0; + unsigned int pid = 0; sscanf(strstr(test_joypads[autoconf_pad].name, "(") + 1, "%04x:%04x", &vid, &pid); RARCH_DBG("[Test input] Autoconf vid/pid %x:%x.\n", vid, pid); diff --git a/libretro-common/include/libchdr/chd.h b/libretro-common/include/libchdr/chd.h index 72b591a2b6ca..c8fcc13a35a5 100644 --- a/libretro-common/include/libchdr/chd.h +++ b/libretro-common/include/libchdr/chd.h @@ -241,16 +241,16 @@ extern "C" { /* standard CD-ROM metadata */ #define CDROM_OLD_METADATA_TAG CHD_MAKE_TAG('C','H','C','D') #define CDROM_TRACK_METADATA_TAG CHD_MAKE_TAG('C','H','T','R') -#define CDROM_TRACK_METADATA_FORMAT "TRACK:%d TYPE:%s SUBTYPE:%s FRAMES:%d" +#define CDROM_TRACK_METADATA_FORMAT "TRACK:%u TYPE:%s SUBTYPE:%s FRAMES:%u" #define CDROM_TRACK_METADATA2_TAG CHD_MAKE_TAG('C','H','T','2') -#define CDROM_TRACK_METADATA2_FORMAT "TRACK:%d TYPE:%s SUBTYPE:%s FRAMES:%d PREGAP:%d PGTYPE:%s PGSUB:%s POSTGAP:%d" +#define CDROM_TRACK_METADATA2_FORMAT "TRACK:%u TYPE:%s SUBTYPE:%s FRAMES:%u PREGAP:%u PGTYPE:%s PGSUB:%s POSTGAP:%u" #define GDROM_OLD_METADATA_TAG CHD_MAKE_TAG('C','H','G','T') #define GDROM_TRACK_METADATA_TAG CHD_MAKE_TAG('C', 'H', 'G', 'D') -#define GDROM_TRACK_METADATA_FORMAT "TRACK:%d TYPE:%s SUBTYPE:%s FRAMES:%d PAD:%d PREGAP:%d PGTYPE:%s PGSUB:%s POSTGAP:%d" +#define GDROM_TRACK_METADATA_FORMAT "TRACK:%u TYPE:%s SUBTYPE:%s FRAMES:%u PAD:%u PREGAP:%u PGTYPE:%s PGSUB:%s POSTGAP:%u" /* standard A/V metadata */ #define AV_METADATA_TAG CHD_MAKE_TAG('A','V','A','V') -#define AV_METADATA_FORMAT "FPS:%d.%06d WIDTH:%d HEIGHT:%d INTERLACED:%d CHANNELS:%d SAMPLERATE:%d" +#define AV_METADATA_FORMAT "FPS:%d.%06d WIDTH:%du HEIGHT:%du INTERLACED:%du CHANNELS:%du SAMPLERATE:%du" /* A/V laserdisc frame metadata */ #define AV_LD_METADATA_TAG CHD_MAKE_TAG('A','V','L','D') diff --git a/libretro-common/include/retro_miscellaneous.h b/libretro-common/include/retro_miscellaneous.h index 24b18c938ff1..6731c63a556a 100644 --- a/libretro-common/include/retro_miscellaneous.h +++ b/libretro-common/include/retro_miscellaneous.h @@ -510,6 +510,8 @@ typedef struct # endif #elif defined(PS2) # define PRI_SIZET "u" +#elif defined(__EMSCRIPTEN__) +# define PRI_SIZET "zu" #else # if (SIZE_MAX == 0xFFFF) # define PRI_SIZET "hu" diff --git a/libretro-common/net/cacert.h b/libretro-common/net/cacert.h index d1d57171d76d..9056b09c8f17 100644 --- a/libretro-common/net/cacert.h +++ b/libretro-common/net/cacert.h @@ -2,6 +2,9 @@ * https://curl.haxx.se/docs/caextract.html * NOTE: Newlines are necessary for the file to be parsed correctly! */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Woverlength-strings" + static const char cacert_pem[] = { "##\n" "## Bundle of CA Root Certificates\n" @@ -3803,3 +3806,5 @@ static const char cacert_pem[] = { "q5Rm+K37DwhuJi1/FwcJsoz7UMCflo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM=\n" "-----END CERTIFICATE-----\n" }; + +#pragma GCC diagnostic pop diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 5f731aa093f2..13702a607110 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -8005,8 +8005,8 @@ static size_t get_string_representation_input_device_reservation_type( static size_t setting_get_string_representation_input_device_reserved_device_name( rarch_setting_t *setting, char *s, size_t len) { - int dev_vendor_id; - int dev_product_id; + unsigned int dev_vendor_id; + unsigned int dev_product_id; if (!setting) return 0; if (string_is_empty(setting->value.target.string)) diff --git a/record/drivers/record_ffmpeg.c b/record/drivers/record_ffmpeg.c index 41063495c88e..cfe0b6acd0a0 100644 --- a/record/drivers/record_ffmpeg.c +++ b/record/drivers/record_ffmpeg.c @@ -70,7 +70,7 @@ extern "C" { #include "../../verbosity.h" #ifndef FFMPEG3 -#define FFMPEG3 ((LIBAVUTIL_VERSION_INT < (56, 6, 100)) || \ +#define FFMPEG3 ((LIBAVUTIL_VERSION_INT < AV_VERSION_INT(56, 6, 100)) || \ (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100))) #endif diff --git a/runloop.h b/runloop.h index e9c72b72dc3e..881881fb4428 100644 --- a/runloop.h +++ b/runloop.h @@ -95,38 +95,38 @@ enum poll_type_override_t enum runloop_flags { - RUNLOOP_FLAG_MAX_FRAMES_SCREENSHOT = (1 << 0), - RUNLOOP_FLAG_HAS_SET_CORE = (1 << 1), - RUNLOOP_FLAG_CORE_SET_SHARED_CONTEXT = (1 << 2), - RUNLOOP_FLAG_IGNORE_ENVIRONMENT_CB = (1 << 3), - RUNLOOP_FLAG_IS_SRAM_LOAD_DISABLED = (1 << 4), - RUNLOOP_FLAG_IS_SRAM_SAVE_DISABLED = (1 << 5), - RUNLOOP_FLAG_USE_SRAM = (1 << 6), - RUNLOOP_FLAG_PATCH_BLOCKED = (1 << 7), - RUNLOOP_FLAG_REQUEST_SPECIAL_SAVESTATE = (1 << 8), - RUNLOOP_FLAG_OVERRIDES_ACTIVE = (1 << 9), - RUNLOOP_FLAG_GAME_OPTIONS_ACTIVE = (1 << 10), - RUNLOOP_FLAG_FOLDER_OPTIONS_ACTIVE = (1 << 11), - RUNLOOP_FLAG_REMAPS_CORE_ACTIVE = (1 << 12), - RUNLOOP_FLAG_REMAPS_GAME_ACTIVE = (1 << 13), - RUNLOOP_FLAG_REMAPS_CONTENT_DIR_ACTIVE = (1 << 14), - RUNLOOP_FLAG_SHUTDOWN_INITIATED = (1 << 15), - RUNLOOP_FLAG_CORE_SHUTDOWN_INITIATED = (1 << 16), - RUNLOOP_FLAG_CORE_RUNNING = (1 << 17), - RUNLOOP_FLAG_AUTOSAVE = (1 << 18), - RUNLOOP_FLAG_HAS_VARIABLE_UPDATE = (1 << 19), - RUNLOOP_FLAG_INPUT_IS_DIRTY = (1 << 20), - RUNLOOP_FLAG_RUNAHEAD_SAVE_STATE_SIZE_KNOWN = (1 << 21), - RUNLOOP_FLAG_RUNAHEAD_AVAILABLE = (1 << 22), - RUNLOOP_FLAG_RUNAHEAD_SECONDARY_CORE_AVAILABLE = (1 << 23), - RUNLOOP_FLAG_RUNAHEAD_FORCE_INPUT_DIRTY = (1 << 24), - RUNLOOP_FLAG_SLOWMOTION = (1 << 25), - RUNLOOP_FLAG_FASTMOTION = (1 << 26), - RUNLOOP_FLAG_PAUSED = (1 << 27), - RUNLOOP_FLAG_IDLE = (1 << 28), - RUNLOOP_FLAG_FOCUSED = (1 << 29), - RUNLOOP_FLAG_FORCE_NONBLOCK = (1 << 30), - RUNLOOP_FLAG_IS_INITED = (1 << 31) + RUNLOOP_FLAG_MAX_FRAMES_SCREENSHOT = (1U << 0), + RUNLOOP_FLAG_HAS_SET_CORE = (1U << 1), + RUNLOOP_FLAG_CORE_SET_SHARED_CONTEXT = (1U << 2), + RUNLOOP_FLAG_IGNORE_ENVIRONMENT_CB = (1U << 3), + RUNLOOP_FLAG_IS_SRAM_LOAD_DISABLED = (1U << 4), + RUNLOOP_FLAG_IS_SRAM_SAVE_DISABLED = (1U << 5), + RUNLOOP_FLAG_USE_SRAM = (1U << 6), + RUNLOOP_FLAG_PATCH_BLOCKED = (1U << 7), + RUNLOOP_FLAG_REQUEST_SPECIAL_SAVESTATE = (1U << 8), + RUNLOOP_FLAG_OVERRIDES_ACTIVE = (1U << 9), + RUNLOOP_FLAG_GAME_OPTIONS_ACTIVE = (1U << 10), + RUNLOOP_FLAG_FOLDER_OPTIONS_ACTIVE = (1U << 11), + RUNLOOP_FLAG_REMAPS_CORE_ACTIVE = (1U << 12), + RUNLOOP_FLAG_REMAPS_GAME_ACTIVE = (1U << 13), + RUNLOOP_FLAG_REMAPS_CONTENT_DIR_ACTIVE = (1U << 14), + RUNLOOP_FLAG_SHUTDOWN_INITIATED = (1U << 15), + RUNLOOP_FLAG_CORE_SHUTDOWN_INITIATED = (1U << 16), + RUNLOOP_FLAG_CORE_RUNNING = (1U << 17), + RUNLOOP_FLAG_AUTOSAVE = (1U << 18), + RUNLOOP_FLAG_HAS_VARIABLE_UPDATE = (1U << 19), + RUNLOOP_FLAG_INPUT_IS_DIRTY = (1U << 20), + RUNLOOP_FLAG_RUNAHEAD_SAVE_STATE_SIZE_KNOWN = (1U << 21), + RUNLOOP_FLAG_RUNAHEAD_AVAILABLE = (1U << 22), + RUNLOOP_FLAG_RUNAHEAD_SECONDARY_CORE_AVAILABLE = (1U << 23), + RUNLOOP_FLAG_RUNAHEAD_FORCE_INPUT_DIRTY = (1U << 24), + RUNLOOP_FLAG_SLOWMOTION = (1U << 25), + RUNLOOP_FLAG_FASTMOTION = (1U << 26), + RUNLOOP_FLAG_PAUSED = (1U << 27), + RUNLOOP_FLAG_IDLE = (1U << 28), + RUNLOOP_FLAG_FOCUSED = (1U << 29), + RUNLOOP_FLAG_FORCE_NONBLOCK = (1U << 30), + RUNLOOP_FLAG_IS_INITED = (0x80000000) }; /* Contains the current retro_fastforwarding_override diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index 811c3a92e86c..5453b9e9b914 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -443,8 +443,8 @@ static void reallocate_port_if_needed(unsigned detected_port, int vendor_id, char settings_value[NAME_MAX_LENGTH]; char settings_value_device_name[NAME_MAX_LENGTH]; unsigned prev_assigned_player_slots[MAX_USERS] = {0}; - int settings_value_vendor_id; - int settings_value_product_id; + unsigned int settings_value_vendor_id; + unsigned int settings_value_product_id; unsigned first_free_player_slot = MAX_USERS + 1; bool device_has_reserved_slot = false; bool no_reservation_at_all = true; @@ -505,8 +505,8 @@ static void reallocate_port_if_needed(unsigned detected_port, int vendor_id, || string_is_equal(device_display_name, settings_value_device_name); } else - device_has_reserved_slot = ( vendor_id == settings_value_vendor_id - && product_id == settings_value_product_id); + device_has_reserved_slot = ( vendor_id == (int)settings_value_vendor_id + && product_id == (int)settings_value_product_id); if (device_has_reserved_slot) { From 596a50164f2d74887c484c050d03116c2c9dd522 Mon Sep 17 00:00:00 2001 From: "Joseph C. Osborn" Date: Fri, 31 Oct 2025 09:48:48 -0700 Subject: [PATCH 2/3] Remove runloop change entirely --- runloop.h | 64 +++++++++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/runloop.h b/runloop.h index 881881fb4428..e9c72b72dc3e 100644 --- a/runloop.h +++ b/runloop.h @@ -95,38 +95,38 @@ enum poll_type_override_t enum runloop_flags { - RUNLOOP_FLAG_MAX_FRAMES_SCREENSHOT = (1U << 0), - RUNLOOP_FLAG_HAS_SET_CORE = (1U << 1), - RUNLOOP_FLAG_CORE_SET_SHARED_CONTEXT = (1U << 2), - RUNLOOP_FLAG_IGNORE_ENVIRONMENT_CB = (1U << 3), - RUNLOOP_FLAG_IS_SRAM_LOAD_DISABLED = (1U << 4), - RUNLOOP_FLAG_IS_SRAM_SAVE_DISABLED = (1U << 5), - RUNLOOP_FLAG_USE_SRAM = (1U << 6), - RUNLOOP_FLAG_PATCH_BLOCKED = (1U << 7), - RUNLOOP_FLAG_REQUEST_SPECIAL_SAVESTATE = (1U << 8), - RUNLOOP_FLAG_OVERRIDES_ACTIVE = (1U << 9), - RUNLOOP_FLAG_GAME_OPTIONS_ACTIVE = (1U << 10), - RUNLOOP_FLAG_FOLDER_OPTIONS_ACTIVE = (1U << 11), - RUNLOOP_FLAG_REMAPS_CORE_ACTIVE = (1U << 12), - RUNLOOP_FLAG_REMAPS_GAME_ACTIVE = (1U << 13), - RUNLOOP_FLAG_REMAPS_CONTENT_DIR_ACTIVE = (1U << 14), - RUNLOOP_FLAG_SHUTDOWN_INITIATED = (1U << 15), - RUNLOOP_FLAG_CORE_SHUTDOWN_INITIATED = (1U << 16), - RUNLOOP_FLAG_CORE_RUNNING = (1U << 17), - RUNLOOP_FLAG_AUTOSAVE = (1U << 18), - RUNLOOP_FLAG_HAS_VARIABLE_UPDATE = (1U << 19), - RUNLOOP_FLAG_INPUT_IS_DIRTY = (1U << 20), - RUNLOOP_FLAG_RUNAHEAD_SAVE_STATE_SIZE_KNOWN = (1U << 21), - RUNLOOP_FLAG_RUNAHEAD_AVAILABLE = (1U << 22), - RUNLOOP_FLAG_RUNAHEAD_SECONDARY_CORE_AVAILABLE = (1U << 23), - RUNLOOP_FLAG_RUNAHEAD_FORCE_INPUT_DIRTY = (1U << 24), - RUNLOOP_FLAG_SLOWMOTION = (1U << 25), - RUNLOOP_FLAG_FASTMOTION = (1U << 26), - RUNLOOP_FLAG_PAUSED = (1U << 27), - RUNLOOP_FLAG_IDLE = (1U << 28), - RUNLOOP_FLAG_FOCUSED = (1U << 29), - RUNLOOP_FLAG_FORCE_NONBLOCK = (1U << 30), - RUNLOOP_FLAG_IS_INITED = (0x80000000) + RUNLOOP_FLAG_MAX_FRAMES_SCREENSHOT = (1 << 0), + RUNLOOP_FLAG_HAS_SET_CORE = (1 << 1), + RUNLOOP_FLAG_CORE_SET_SHARED_CONTEXT = (1 << 2), + RUNLOOP_FLAG_IGNORE_ENVIRONMENT_CB = (1 << 3), + RUNLOOP_FLAG_IS_SRAM_LOAD_DISABLED = (1 << 4), + RUNLOOP_FLAG_IS_SRAM_SAVE_DISABLED = (1 << 5), + RUNLOOP_FLAG_USE_SRAM = (1 << 6), + RUNLOOP_FLAG_PATCH_BLOCKED = (1 << 7), + RUNLOOP_FLAG_REQUEST_SPECIAL_SAVESTATE = (1 << 8), + RUNLOOP_FLAG_OVERRIDES_ACTIVE = (1 << 9), + RUNLOOP_FLAG_GAME_OPTIONS_ACTIVE = (1 << 10), + RUNLOOP_FLAG_FOLDER_OPTIONS_ACTIVE = (1 << 11), + RUNLOOP_FLAG_REMAPS_CORE_ACTIVE = (1 << 12), + RUNLOOP_FLAG_REMAPS_GAME_ACTIVE = (1 << 13), + RUNLOOP_FLAG_REMAPS_CONTENT_DIR_ACTIVE = (1 << 14), + RUNLOOP_FLAG_SHUTDOWN_INITIATED = (1 << 15), + RUNLOOP_FLAG_CORE_SHUTDOWN_INITIATED = (1 << 16), + RUNLOOP_FLAG_CORE_RUNNING = (1 << 17), + RUNLOOP_FLAG_AUTOSAVE = (1 << 18), + RUNLOOP_FLAG_HAS_VARIABLE_UPDATE = (1 << 19), + RUNLOOP_FLAG_INPUT_IS_DIRTY = (1 << 20), + RUNLOOP_FLAG_RUNAHEAD_SAVE_STATE_SIZE_KNOWN = (1 << 21), + RUNLOOP_FLAG_RUNAHEAD_AVAILABLE = (1 << 22), + RUNLOOP_FLAG_RUNAHEAD_SECONDARY_CORE_AVAILABLE = (1 << 23), + RUNLOOP_FLAG_RUNAHEAD_FORCE_INPUT_DIRTY = (1 << 24), + RUNLOOP_FLAG_SLOWMOTION = (1 << 25), + RUNLOOP_FLAG_FASTMOTION = (1 << 26), + RUNLOOP_FLAG_PAUSED = (1 << 27), + RUNLOOP_FLAG_IDLE = (1 << 28), + RUNLOOP_FLAG_FOCUSED = (1 << 29), + RUNLOOP_FLAG_FORCE_NONBLOCK = (1 << 30), + RUNLOOP_FLAG_IS_INITED = (1 << 31) }; /* Contains the current retro_fastforwarding_override From 884ce45915fff4f4a6e0c5f1cdc64fa88db176d4 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Sat, 7 Feb 2026 16:46:36 -0500 Subject: [PATCH 3/3] Apply suggestion from @RobLoach --- audio/drivers/sdl_audio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/audio/drivers/sdl_audio.c b/audio/drivers/sdl_audio.c index a2109cc9027a..d2558b1781c1 100644 --- a/audio/drivers/sdl_audio.c +++ b/audio/drivers/sdl_audio.c @@ -319,7 +319,6 @@ static int sdl_microphone_read(void *driver_context, void *mic_context, void *sv uint8_t *s = (uint8_t*)sv; sdl_microphone_t *sdl = (sdl_microphone_t*)driver_context; sdl_microphone_handle_t *mic = (sdl_microphone_handle_t*)mic_context; - uint8_t *s = (uint8_t *)sv; if (!sdl || !mic || !s) return -1;