Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -2693,7 +2693,10 @@ ifeq ($(HAVE_STATIC_VIDEO_FILTERS), 1)
gfx/video_filters/upscale_240x160_320x240.o \
gfx/video_filters/upscale_mix_240x160_320x240.o \
gfx/video_filters/dedither.o \
gfx/video_filters/pixel_art_aa.o
gfx/video_filters/pixel_art_aa.o \
gfx/video_filters/crop_borders.o \
gfx/video_filters/ntsc.o \
gfx/video_filters/ntsc_crt.o
endif

ifeq ($(WANT_IOSUHAX), 1)
Expand Down
8 changes: 4 additions & 4 deletions audio/drivers/openal.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static void *al_init(const char *device, unsigned rate, unsigned latency,
if (string_is_equal(device, list->elems[i].data))
{
RARCH_DBG("[OpenAL] Found device #%d: \"%s\".\n", i, list->elems[i].data);
idx_found = i;
idx_found = (int32_t)i;
dev_id = strdup(list->elems[i].data);
break;
}
Expand All @@ -144,7 +144,7 @@ static void *al_init(const char *device, unsigned rate, unsigned latency,

if (idx_found == -1 && isdigit(device[0]))
{
idx_found = strtoul(device, NULL, 0);
idx_found = (int32_t)strtoul(device, NULL, 0);
RARCH_LOG("[OpenAL] Fallback, device index is a single number index instead: %d.\n", idx_found);

if (idx_found != -1)
Expand Down Expand Up @@ -190,7 +190,7 @@ static void *al_init(const char *device, unsigned rate, unsigned latency,
_latency = latency * rate * 2 * sizeof(int16_t);
}

al->num_buffers = _latency / (1000 * OPENAL_BUFSIZE);
al->num_buffers = (ALsizei)(_latency / (1000 * OPENAL_BUFSIZE));
if (al->num_buffers < 2)
al->num_buffers = 2;

Expand Down Expand Up @@ -263,7 +263,7 @@ static ssize_t al_write(void *data, const void *s, size_t len)
if (!al_get_buffer(al, &buffer))
break;

alBufferData(buffer, al->format, buf, rc, al->rate);
alBufferData(buffer, al->format, buf, (ALsizei)rc, al->rate);
alSourceQueueBuffers(al->source, 1, &buffer);

_len += rc;
Expand Down
6 changes: 3 additions & 3 deletions cheevos/cheevos_rvz.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ static uint32_t rvz_get_group_decompression_size(rcheevos_rvz_file_t* rvz,
/* This is a partition data group */
/* Calculate blocks per group based on chunk_size
* chunk_size is in ISO space (with headers), convert to decrypted space */
uint32_t adjusted_chunk_size = ((uint64_t)chunk_size * RVZ_WII_SECTOR_DATA_SIZE) / RVZ_WII_SECTOR_SIZE;
uint32_t adjusted_chunk_size = (uint32_t)(((uint64_t)chunk_size * RVZ_WII_SECTOR_DATA_SIZE) / RVZ_WII_SECTOR_SIZE);
uint32_t blocks_per_group = adjusted_chunk_size / RVZ_WII_SECTOR_DATA_SIZE;
uint32_t group_offset_in_partition = group_index - pdata->group_index;
uint32_t total_blocks = pdata->number_of_sectors;
Expand Down Expand Up @@ -2262,7 +2262,7 @@ static int rvz_calculate_partition_offsets_stateless(
offsets->file_offset = (offsets->block_index * RVZ_WII_SECTOR_DATA_SIZE) + offsets->offset_in_block;

/* Calculate effective chunk size (decrypted group size) */
effective_chunk_size = ((uint64_t)chunk_size * RVZ_WII_SECTOR_DATA_SIZE) / RVZ_WII_SECTOR_SIZE;
effective_chunk_size = (uint32_t)(((uint64_t)chunk_size * RVZ_WII_SECTOR_DATA_SIZE) / RVZ_WII_SECTOR_SIZE);

/* Calculate group index */
file_block = offsets->file_offset / effective_chunk_size;
Expand Down Expand Up @@ -2307,7 +2307,7 @@ static size_t rvz_read_partition_data_stateless(
uint64_t bytes_left_in_block;

/* Calculate effective chunk size (decrypted group size) */
effective_chunk_size = ((uint64_t)chunk_size * RVZ_WII_SECTOR_DATA_SIZE) / RVZ_WII_SECTOR_SIZE;
effective_chunk_size = (uint32_t)(((uint64_t)chunk_size * RVZ_WII_SECTOR_DATA_SIZE) / RVZ_WII_SECTOR_SIZE);

/* Get the decompressed chunk data */
chunk_data = rvz_get_chunk(handle, offsets->group_index, &chunk_data_size);
Expand Down
24 changes: 13 additions & 11 deletions configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -4653,14 +4653,16 @@ static bool config_load_file(global_t *global,
if (!(bool)RHMAP_HAS_STR(conf->entries_map, "user_language"))
msg_hash_set_uint(MSG_HASH_USER_LANGUAGE, frontend_driver_get_user_language());

if (frontend_driver_has_gamemode() &&
!frontend_driver_set_gamemode(settings->bools.gamemode_enable) &&
settings->bools.gamemode_enable)
{
RARCH_WARN("[Config] GameMode unsupported - disabling...\n");
configuration_set_bool(settings,
settings->bools.gamemode_enable, false);
}
/* If GameMode is enabled in the config but libgamemode is not
* available, warn once. Do NOT clear the setting: that would
* silently overwrite the user's preference in retroarch.cfg, so
* a transient failure (sandbox path issue, library not yet
* installed, etc.) would force them to re-enable it manually on
* every subsequent launch. The probe is latched inside the
* frontend driver, so it will not be retried this session. */
if ( settings->bools.gamemode_enable
&& frontend_driver_has_gamemode())
frontend_driver_set_gamemode(true);

/* If this is the first run of an existing installation
* after the independent favourites playlist size limit was
Expand Down Expand Up @@ -5436,7 +5438,7 @@ void input_config_get_prefix(char *s, char len, char user, bool meta)
*/
static void input_config_save_keybinds_user(config_file_t *conf, unsigned user)
{
size_t i = 0;
unsigned i;
for (i = 0; input_config_bind_map_get_valid(i); i++)
{
char key[64];
Expand Down Expand Up @@ -5482,7 +5484,7 @@ static void input_config_save_keybinds_user_override(config_file_t *conf,
unsigned user, unsigned bind_id,
const struct retro_keybind *override_bind)
{
size_t i = bind_id;
unsigned i = bind_id;

if (input_config_bind_map_get_valid(i))
{
Expand Down Expand Up @@ -5533,7 +5535,7 @@ static void input_config_save_keybinds_user_override(config_file_t *conf,
static void input_config_save_keybinds_user_minimal(config_file_t *conf,
unsigned user, const retro_keybind_set default_binds)
{
size_t i = 0;
unsigned i;
for (i = 0; input_config_bind_map_get_valid(i); i++)
{
char key[64];
Expand Down
6 changes: 3 additions & 3 deletions cores/libretro-ffmpeg/ffmpeg_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1918,7 +1918,7 @@ static void check_variables(bool firststart)
fft_ms_var.key = "ffmpeg_fft_multisample";

if (CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_GET_VARIABLE, &fft_ms_var) && fft_ms_var.value)
FFT_MULTISAMPLE_STR = strtoul(fft_ms_var.value, NULL, 0);
FFT_MULTISAMPLE_STR = (unsigned)strtoul(fft_ms_var.value, NULL, 0);
#endif

color_var.key = "ffmpeg_color_space";
Expand Down Expand Up @@ -2502,7 +2502,7 @@ void CORE_PREFIX(retro_run)(void)
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES3)
else if (FFT_STR)
{
unsigned fft_frames = to_read_frames;
unsigned fft_frames = (unsigned)to_read_frames;
const int16_t *buffer = audio_buffer;

while (fft_frames)
Expand All @@ -2518,7 +2518,7 @@ void CORE_PREFIX(retro_run)(void)
buffer += to_read * 2;
fft_frames -= to_read;
}
hwfft_render(FFT_STR, HW_RENDER_STR.get_current_framebuffer(), FFT_WIDTH_STR, FFT_HEIGHT_STR);
hwfft_render(FFT_STR, (GLuint)HW_RENDER_STR.get_current_framebuffer(), FFT_WIDTH_STR, FFT_HEIGHT_STR);
CORE_PREFIX(video_cb)(RETRO_HW_FRAME_BUFFER_VALID,
FFT_WIDTH_STR, FFT_HEIGHT_STR, FFT_WIDTH_STR * sizeof(uint32_t));
}
Expand Down
3 changes: 2 additions & 1 deletion deps/SPIRV-Cross/spirv_cross_parsed_ir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1005,8 +1005,9 @@ ParsedIR::LoopLock::LoopLock(uint32_t *lock_)
}

ParsedIR::LoopLock::LoopLock(LoopLock &&other) SPIRV_CROSS_NOEXCEPT
: lock(other.lock)
{
*this = std::move(other);
other.lock = nullptr;
}

ParsedIR::LoopLock &ParsedIR::LoopLock::operator=(LoopLock &&other) SPIRV_CROSS_NOEXCEPT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ TVariable* TVariable::clone() const
TFunction::TFunction(const TFunction& copyOf) : TSymbol(copyOf)
{
for (unsigned int i = 0; i < copyOf.parameters.size(); ++i) {
TParameter param;
TParameter param = { nullptr, nullptr, nullptr };
parameters.push_back(param);
parameters.back().copyParam(copyOf.parameters[i]);
}
Expand Down
3 changes: 2 additions & 1 deletion deps/mbedtls/net_sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ int mbedtls_net_accept( mbedtls_net_context *bind_ctx,
struct sockaddr_storage client_addr;

#if defined(__socklen_t_defined) || defined(_SOCKLEN_T) || \
defined(_SOCKLEN_T_DECLARED) || defined(__DEFINED_socklen_t)
defined(_SOCKLEN_T_DECLARED) || defined(__DEFINED_socklen_t) || \
defined(socklen_t) || (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L)
socklen_t n = (socklen_t) sizeof( client_addr );
socklen_t type_len = (socklen_t) sizeof( type );
#else
Expand Down
2 changes: 1 addition & 1 deletion deps/rcheevos/src/rapi/rc_api_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ int rc_api_process_fetch_games_list_server_response(rc_api_fetch_games_list_resp

entry = response->entries;
while (rc_json_get_next_object_field(&iterator, &field)) {
entry->id = strtol(field.name, &end, 10);
entry->id = (uint32_t)strtol(field.name, &end, 10);

field.name = "";
if (!rc_json_get_string(&entry->name, &response->response.buffer, &field, ""))
Expand Down
2 changes: 1 addition & 1 deletion deps/rcheevos/src/rapi/rc_api_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ int rc_api_process_fetch_all_user_progress_server_response(rc_api_fetch_all_user
entry = response->entries;
while (rc_json_get_next_object_field(&iterator, &field))
{
entry->game_id = strtol(field.name, &end, 10);
entry->game_id = (uint32_t)strtol(field.name, &end, 10);

field.name = "";
if (!rc_json_get_required_object(entry_fields, sizeof(entry_fields) / sizeof(entry_fields[0]),
Expand Down
2 changes: 1 addition & 1 deletion deps/rcheevos/src/rcheevos/condition.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static int rc_parse_operator(const char** memaddr) {
void rc_condition_convert_to_operand(const rc_condition_t* condition, rc_operand_t* operand, rc_parse_state_t* parse) {
if (condition->oper == RC_OPERATOR_NONE) {
if (operand != &condition->operand1)
memcpy(operand, &condition->operand1, sizeof(*operand));
*operand = condition->operand1;
}
else {
uint8_t new_size = RC_MEMSIZE_32_BITS;
Expand Down
6 changes: 3 additions & 3 deletions deps/stb/stb_vorbis.h
Original file line number Diff line number Diff line change
Expand Up @@ -3702,12 +3702,12 @@ void stb_vorbis_seek_start(stb_vorbis *f)

unsigned int stb_vorbis_stream_length_in_samples(stb_vorbis *f)
{
unsigned int restore_offset, previous_safe;
unsigned int end, last_page_loc;
uint32_t restore_offset, previous_safe;
uint32_t end, last_page_loc;

if (IS_PUSH_MODE(f)) return error(f, VORBIS_invalid_api_mixing);
if (!f->total_samples) {
unsigned int last;
uint32_t last;
uint32_t lo,hi;
char header[6];

Expand Down
17 changes: 15 additions & 2 deletions frontend/drivers/platform_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -2186,8 +2186,20 @@ static void android_app_destroy(struct android_app *android_app)
static bool frontend_unix_set_gamemode(bool on)
{
#ifdef FERAL_GAMEMODE
int gamemode_status = gamemode_query_status();
bool gamemode_active = (gamemode_status == 2);
/* Once gamemode_query_status() reports failure (typically because
* libgamemode.so is not installed), there is no point repeatedly
* re-probing on every config load or menu toggle - the result will
* not change for the lifetime of the process, and each probe emits
* a warning. Latch the unavailable state and short-circuit. */
static bool gamemode_unavailable = false;
int gamemode_status;
bool gamemode_active;

if (gamemode_unavailable)
return false;

gamemode_status = gamemode_query_status();
gamemode_active = (gamemode_status == 2);

if (gamemode_status < 0)
{
Expand All @@ -2196,6 +2208,7 @@ static bool frontend_unix_set_gamemode(bool on)
"https://github.com/FeralInteractive/gamemode needs to be installed.\n",
gamemode_error_string());

gamemode_unavailable = true;
return false;
}

Expand Down
6 changes: 4 additions & 2 deletions gfx/display_servers/dispserv_apple.m
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,9 @@ static enum rotation apple_display_server_get_screen_orientation(void *data)
&& settings->floats.video_refresh_rate >= 10.0f
&& settings->floats.video_refresh_rate <= 250.0f)
{
float hz = settings->floats.video_refresh_rate;
CocoaView *view = [CocoaView get];
#if defined(IOS)
float hz = settings->floats.video_refresh_rate;
CocoaView *view = [CocoaView get];
if (view && view.displayLink)
{
RARCH_DBG("[Video] Setting initial refresh rate to %.3f Hz\n", hz);
Expand All @@ -571,6 +571,8 @@ static enum rotation apple_display_server_get_screen_orientation(void *data)
view.displayLink.preferredFramesPerSecond = hz;
}
#elif defined(OSX) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 140000
float hz = settings->floats.video_refresh_rate;
CocoaView *view = [CocoaView get];
if (view)
{
if (@available(macOS 14, *))
Expand Down
1 change: 0 additions & 1 deletion gfx/drivers/d3d12.c
Original file line number Diff line number Diff line change
Expand Up @@ -6117,7 +6117,6 @@ static bool d3d12_gpu_hdr_readback_to_bgr24(
d3d12_texture_t sdr_rt = { 0 };
D3D12Resource readback = NULL;
D3D12Resource back_buffer;
D3D12_RESOURCE_DESC sdr_desc;
D3D12_HEAP_PROPERTIES heap_props;
D3D12_RESOURCE_DESC buf_desc;
D3D12_PLACED_SUBRESOURCE_FOOTPRINT footprint;
Expand Down
34 changes: 14 additions & 20 deletions gfx/drivers/metal.m
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ - (void)setRotation:(unsigned)rotation;
{ \
NSObject * __y = y; \
if (x != nil) { \
NSObject * __foo = (__bridge_transfer NSObject *)(__bridge void *)(x); \
__attribute__((unused)) NSObject * __foo = (__bridge_transfer NSObject *)(__bridge void *)(x); \
__foo = nil; \
x = (__bridge __typeof__(x))nil; \
} \
Expand Down Expand Up @@ -561,19 +561,17 @@ static bool metal_display_supports_edr(void)
if (@available(macOS 10.15, *))
{
NSScreen *screen = [NSScreen mainScreen];
if (!screen)
return false;
/* Potential, not current: the value reflects what the display *could*
* produce if EDR were enabled, not what's being used right now.
* That's the right signal for "is HDR an available mode". SDR-only
* displays return exactly 1.0. */
return screen.maximumPotentialExtendedDynamicRangeColorComponentValue > 1.0;
if (screen)
return screen.maximumPotentialExtendedDynamicRangeColorComponentValue > 1.0;
}
return false;
#elif defined(HAVE_COCOATOUCH)
/* TARGET_OS_TV / TARGET_OS_IOS are always defined to 0 or 1, not
* just present — have to test the value, not defined-ness. */
# if TARGET_OS_TV
#if TARGET_OS_TV
/* tvOS: no NSScreen/UIScreen EDR API parallel to macOS. The device
* itself (Apple TV 4K) advertises HDR capability via AVDisplayCriteria
* but that's AVFoundation, not a layer we can plumb into here without
Expand All @@ -582,20 +580,16 @@ static bool metal_display_supports_edr(void)
* is only shipping on HDR-capable hardware (Apple TV 4K). */
if (@available(tvOS 16.0, *))
return true;
return false;
# else
#else
if (@available(iOS 16.0, *))
{
UIScreen *screen = [UIScreen mainScreen];
if (!screen)
return false;
return screen.potentialEDRHeadroom > 1.0;
if (screen)
return screen.potentialEDRHeadroom > 1.0;
}
return false;
# endif
#else
return false;
#endif
#endif
return false;
}
#endif /* METAL_HDR_AVAILABLE */

Expand Down Expand Up @@ -1369,7 +1363,7 @@ - (bool)_initHDRPipelines
ca.sourceAlphaBlendFactor = MTLBlendFactorSourceAlpha;
ca.destinationAlphaBlendFactor = MTLBlendFactorOneMinusSourceAlpha;
}
id<MTLRenderPipelineState> s = [_device newRenderPipelineStateWithDescriptor:psd error:&e];
id<MTLRenderPipelineState> s = [self->_device newRenderPipelineStateWithDescriptor:psd error:&e];
if (e)
{
RARCH_ERR("[Metal] HDR %s pipeline: %s.\n",
Expand Down Expand Up @@ -4958,7 +4952,7 @@ - (BOOL)setShaderFromPath:(NSString *)path

@try
{
size_t i;
unsigned i;
texture_t *source = NULL;
if (!video_shader_load_preset_into_shader(path.UTF8String, shader))
return NO;
Expand Down Expand Up @@ -5602,7 +5596,7 @@ static bool metal_suppress_screensaver(void *data, bool disable)
}

static bool metal_set_shader(void *data,
enum rarch_shader_type type, const char *path)
enum rarch_shader_type type, const char *path)
{
#if defined(HAVE_SLANG) && defined(HAVE_SPIRV_CROSS)
MetalDriver *md = (__bridge MetalDriver *)data;
Expand Down Expand Up @@ -5630,7 +5624,7 @@ static bool metal_set_shader(void *data,

static void metal_free(void *data)
{
MetalDriver *md = (__bridge_transfer MetalDriver *)data;
__attribute__((unused)) MetalDriver *md = (__bridge_transfer MetalDriver *)data;
metal_ctx_data = NULL;
md = nil;
}
Expand Down Expand Up @@ -5748,7 +5742,7 @@ static void metal_unload_texture(void *data,
* buffer is still using it -- the Metal runtime refcounts
* resources across CPU and GPU. No cross-thread
* serialisation needed for unload. */
Texture *t = (__bridge_transfer Texture *)(void *)handle;
__attribute__((unused)) Texture *t = (__bridge_transfer Texture *)(void *)handle;
t = nil;
}

Expand Down
2 changes: 1 addition & 1 deletion gfx/drivers/sdl2_gfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ static bool sdl2_gfx_set_shader(void *data,
return false;
}

#ifdef HAVE_GFX_WIDGETS
#if defined(HAVE_GFX_WIDGETS) && SDL_VERSION_ATLEAST(2, 0, 18)
static bool sdl2_gfx_widgets_enabled(void *data) { (void)data; return true; }
#endif

Expand Down
Loading
Loading