mirror of
https://github.com/libretro/RetroArch
synced 2025-01-27 12:35:23 +00:00
Fixing compiler warnings (#17001)
This commit is contained in:
parent
39c48f7310
commit
b557bc9523
@ -1534,7 +1534,7 @@ static void scan_states(settings_t *settings,
|
||||
{
|
||||
/* Gap index: lowest free slot in the wraparound range */
|
||||
if (gap_idx == UINT_MAX)
|
||||
gap_idx = i;
|
||||
gap_idx = (unsigned)i;
|
||||
}
|
||||
/* Occupied save slots */
|
||||
else
|
||||
@ -1543,7 +1543,7 @@ static void scan_states(settings_t *settings,
|
||||
after gap index */
|
||||
if (gap_idx < UINT_MAX &&
|
||||
del_idx == UINT_MAX)
|
||||
del_idx = i;
|
||||
del_idx = (unsigned)i;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -368,7 +368,7 @@ void CORE_PREFIX(retro_reset)(void)
|
||||
reset_triggered = true;
|
||||
}
|
||||
|
||||
static void print_ffmpeg_version()
|
||||
static void print_ffmpeg_version(void)
|
||||
{
|
||||
PRINT_VERSION(avformat)
|
||||
PRINT_VERSION(avcodec)
|
||||
@ -491,7 +491,7 @@ static void check_variables(bool firststart)
|
||||
}
|
||||
else
|
||||
{
|
||||
sw_decoder_threads = strtoul(sw_threads_var.value, NULL, 0);
|
||||
sw_decoder_threads = (unsigned)strtoul(sw_threads_var.value, NULL, 0);
|
||||
}
|
||||
/* Scale the sws threads based on core count but use at least 2 and at most 4 threads */
|
||||
sw_sws_threads = MIN(MAX(2, sw_decoder_threads / 2), 4);
|
||||
@ -877,7 +877,7 @@ void CORE_PREFIX(retro_run)(void)
|
||||
if (!temporal_interpolation)
|
||||
mix_factor = 1.0f;
|
||||
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, hw_render.get_current_framebuffer());
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, (GLuint)hw_render.get_current_framebuffer());
|
||||
glClearColor(0, 0, 0, 1);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glViewport(0, 0, media.width, media.height);
|
||||
@ -1750,7 +1750,7 @@ static void decode_thread(void *data)
|
||||
if (video_stream_index >= 0)
|
||||
{
|
||||
frame_size = av_image_get_buffer_size(AV_PIX_FMT_RGB32, media.width, media.height, 1);
|
||||
video_buffer = video_buffer_create(4, frame_size, media.width, media.height);
|
||||
video_buffer = video_buffer_create(4, (int)frame_size, media.width, media.height);
|
||||
tpool = tpool_create(sw_sws_threads);
|
||||
log_cb(RETRO_LOG_INFO, "[FFMPEG] Configured worker threads: %d\n", sw_sws_threads);
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ typedef struct packet_buffer packet_buffer_t;
|
||||
*
|
||||
* Returns: A packet buffer.
|
||||
*/
|
||||
packet_buffer_t *packet_buffer_create();
|
||||
packet_buffer_t *packet_buffer_create(void);
|
||||
|
||||
/**
|
||||
* packet_buffer_destroy:
|
||||
|
@ -637,7 +637,7 @@ static void retropad_update_input(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void open_UDP_socket()
|
||||
static void open_UDP_socket(void)
|
||||
{
|
||||
socket_target_t in_target;
|
||||
|
||||
|
2
deps/libFLAC/include/share/compat.h
vendored
2
deps/libFLAC/include/share/compat.h
vendored
@ -63,7 +63,9 @@
|
||||
#endif
|
||||
|
||||
#if HAVE_INTTYPES_H
|
||||
#ifndef __STDC_FORMAT_MACROS
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#endif
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
|
@ -1568,9 +1568,6 @@ static void gl3_set_viewport(gl3_t *gl,
|
||||
unsigned viewport_height,
|
||||
bool force_full, bool allow_rotate)
|
||||
{
|
||||
unsigned height = gl->video_height;
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
settings_t *settings = config_get_ptr();
|
||||
float device_aspect = (float)viewport_width / viewport_height;
|
||||
bool video_scale_integer = settings->bools.video_scale_integer;
|
||||
|
@ -607,7 +607,7 @@ static void sdl2_poke_set_texture_frame(void *data,
|
||||
sdl_refresh_input_size(vid, true, rgb32, width, height,
|
||||
width * (rgb32 ? 4 : 2));
|
||||
|
||||
SDL_UpdateTexture(vid->menu.tex, NULL, frame, vid->menu.pitch);
|
||||
SDL_UpdateTexture(vid->menu.tex, NULL, frame, (int)vid->menu.pitch);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2619,7 +2619,7 @@ void Framebuffer::init(DeferredDisposer *disposer)
|
||||
info.extent.width = size.width;
|
||||
info.extent.height = size.height;
|
||||
info.extent.depth = 1;
|
||||
info.mipLevels = MIN(max_levels, _y);
|
||||
info.mipLevels = (uint32_t)MIN(max_levels, _y);
|
||||
info.arrayLayers = 1;
|
||||
info.samples = VK_SAMPLE_COUNT_1_BIT;
|
||||
info.tiling = VK_IMAGE_TILING_OPTIMAL;
|
||||
|
@ -325,7 +325,6 @@ static void sdl_input_free(void *data)
|
||||
#ifndef HAVE_SDL2
|
||||
SDL_Event event;
|
||||
#endif
|
||||
sdl_input_t *sdl = (sdl_input_t*)data;
|
||||
|
||||
if (!data)
|
||||
return;
|
||||
|
@ -529,7 +529,7 @@ static void apple_gamecontroller_joypad_disconnect(GCController* controller)
|
||||
}
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
static void apple_gamecontroller_device_haptics_setup() IPHONE_RUMBLE_AVAIL
|
||||
static void apple_gamecontroller_device_haptics_setup(void) IPHONE_RUMBLE_AVAIL
|
||||
{
|
||||
if (!CHHapticEngine.capabilitiesForHardware.supportsHaptics)
|
||||
return;
|
||||
@ -596,14 +596,14 @@ static id<CHHapticPatternPlayer> apple_gamecontroller_device_haptics_create_play
|
||||
return player;
|
||||
}
|
||||
|
||||
static id<CHHapticPatternPlayer> apple_gamecontroller_device_haptics_strong_player() IPHONE_RUMBLE_AVAIL
|
||||
static id<CHHapticPatternPlayer> apple_gamecontroller_device_haptics_strong_player(void) IPHONE_RUMBLE_AVAIL
|
||||
{
|
||||
if (!deviceStrongPlayer)
|
||||
deviceStrongPlayer = apple_gamecontroller_device_haptics_create_player(1.0f);
|
||||
return deviceStrongPlayer;
|
||||
}
|
||||
|
||||
static id<CHHapticPatternPlayer> apple_gamecontroller_device_haptics_weak_player() IPHONE_RUMBLE_AVAIL
|
||||
static id<CHHapticPatternPlayer> apple_gamecontroller_device_haptics_weak_player(void) IPHONE_RUMBLE_AVAIL
|
||||
{
|
||||
if (!deviceWeakPlayer)
|
||||
deviceWeakPlayer = apple_gamecontroller_device_haptics_create_player(0.5f);
|
||||
|
@ -123,6 +123,7 @@
|
||||
/**
|
||||
* TODO/FIXME: clock_gettime function is part of iOS 10 now
|
||||
**/
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 100000
|
||||
static int ra_clock_gettime(int clk_ik, struct timespec *t)
|
||||
{
|
||||
struct timeval now;
|
||||
@ -134,6 +135,7 @@ static int ra_clock_gettime(int clk_ik, struct timespec *t)
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__MACH__) && __IPHONE_OS_VERSION_MIN_REQUIRED < 100000
|
||||
#else
|
||||
|
@ -4215,7 +4215,6 @@ static int action_ok_file_load_ffmpeg(const char *path,
|
||||
char new_path[PATH_MAX_LENGTH];
|
||||
const char *menu_path = NULL;
|
||||
struct menu_state *menu_st = menu_state_get_ptr();
|
||||
menu_handle_t *menu = menu_st->driver_data;
|
||||
menu_list_t *menu_list = menu_st->entries.list;
|
||||
file_list_t *menu_stack = MENU_LIST_GET(menu_list, 0);
|
||||
|
||||
|
@ -8178,7 +8178,7 @@ static enum menu_action ozone_parse_menu_entry_action(
|
||||
|
||||
if ( !menu_navigation_wraparound_enable
|
||||
&& selection == ozone->system_tab_end + horizontal_list_size)
|
||||
new_selection = selection;
|
||||
new_selection = (int)selection;
|
||||
|
||||
if (new_selection != (int)selection)
|
||||
{
|
||||
|
@ -39,13 +39,13 @@ extern int ptrace(int request, pid_t pid, caddr_t addr, int data);
|
||||
#define PT_TRACE_ME 0 /* child declares it's being traced */
|
||||
#define PT_SIGEXC 12 /* signals as exceptions for current_proc */
|
||||
|
||||
static void *exception_handler(void *argument) {
|
||||
#if !TARGET_OS_TV
|
||||
static void *exception_handler(void *argument) {
|
||||
mach_port_t port = *(mach_port_t *)argument;
|
||||
mach_msg_server(exc_server, 2048, port, 0);
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static bool jb_has_debugger_attached(void) {
|
||||
int flags;
|
||||
|
@ -12,6 +12,7 @@
|
||||
#define kRetroArchAppGroup @"group.com.libretro.dist.tvos.RetroArchAppGroup"
|
||||
#endif
|
||||
|
||||
API_AVAILABLE(tvos(13.0))
|
||||
@interface ContentProvider : TVTopShelfContentProvider
|
||||
|
||||
|
||||
|
@ -1800,20 +1800,12 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
CODE_SIGN_ENTITLEMENTS = "$(TVOS_CODE_SIGN_ENTITLEMENTS)";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/tvOS/Frameworks",
|
||||
);
|
||||
INFOPLIST_FILE = "$(SRCROOT)/tvOS/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/Frameworks/MoltenVK.framework",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(PROJECT_DIR)/tvOS/modules",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "$(TVOS_BUNDLE_IDENTIFIER)";
|
||||
PRODUCT_NAME = RetroArchTV;
|
||||
SDKROOT = appletvos;
|
||||
@ -1827,20 +1819,12 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
CODE_SIGN_ENTITLEMENTS = "$(TVOS_CODE_SIGN_ENTITLEMENTS)";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/tvOS/Frameworks",
|
||||
);
|
||||
INFOPLIST_FILE = "$(SRCROOT)/tvOS/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/Frameworks/MoltenVK.framework",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(PROJECT_DIR)/tvOS/modules",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "$(TVOS_BUNDLE_IDENTIFIER)";
|
||||
PRODUCT_NAME = RetroArchTV;
|
||||
SDKROOT = appletvos;
|
||||
@ -1942,10 +1926,7 @@
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.entertainment";
|
||||
IOS_BUNDLE_IDENTIFIER = com.libretro.RetroArchiOS11;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(PROJECT_DIR)/iOS/modules",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = "";
|
||||
LLVM_LTO = YES_THIN;
|
||||
MARKETING_VERSION = 1.19.1;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
@ -2004,10 +1985,7 @@
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.entertainment";
|
||||
IOS_BUNDLE_IDENTIFIER = com.libretro.RetroArchiOS11;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(PROJECT_DIR)/iOS/modules",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = "";
|
||||
LLVM_LTO = YES_THIN;
|
||||
MARKETING_VERSION = 1.19.1;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
|
@ -48,7 +48,7 @@ static NSDateFormatter* _dateFormatterISO8601 = nil;
|
||||
static dispatch_queue_t _dateFormatterQueue = NULL;
|
||||
|
||||
// TODO: Handle RFC 850 and ANSI C's asctime() format
|
||||
void GCDWebServerInitializeFunctions() {
|
||||
void GCDWebServerInitializeFunctions(void) {
|
||||
GWS_DCHECK([NSThread isMainThread]); // NSDateFormatter should be initialized on main thread
|
||||
if (_dateFormatterRFC822 == nil) {
|
||||
_dateFormatterRFC822 = [[NSDateFormatter alloc] init];
|
||||
|
@ -69,7 +69,9 @@ extern "C" {
|
||||
#include "../../retroarch.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
#ifndef FFMPEG3
|
||||
#define FFMPEG3 (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100))
|
||||
#endif
|
||||
#define HAVE_CH_LAYOUT (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100))
|
||||
|
||||
struct ff_video_info
|
||||
@ -1083,7 +1085,7 @@ static bool ffmpeg_push_video(void *data,
|
||||
unsigned avail;
|
||||
|
||||
slock_lock(handle->lock);
|
||||
avail = FIFO_WRITE_AVAIL(handle->attr_fifo);
|
||||
avail = (unsigned)FIFO_WRITE_AVAIL(handle->attr_fifo);
|
||||
slock_unlock(handle->lock);
|
||||
|
||||
if (!handle->alive)
|
||||
@ -1115,7 +1117,7 @@ static bool ffmpeg_push_video(void *data,
|
||||
if (attr_data.is_dupe)
|
||||
attr_data.width = attr_data.height = attr_data.pitch = 0;
|
||||
else
|
||||
attr_data.pitch = attr_data.width * handle->video.pix_size;
|
||||
attr_data.pitch = (int)(attr_data.width * handle->video.pix_size);
|
||||
|
||||
fifo_write(handle->attr_fifo, &attr_data, sizeof(attr_data));
|
||||
|
||||
@ -1145,7 +1147,7 @@ static bool ffmpeg_push_audio(void *data,
|
||||
unsigned avail;
|
||||
|
||||
slock_lock(handle->lock);
|
||||
avail = FIFO_WRITE_AVAIL(handle->audio_fifo);
|
||||
avail = (unsigned)FIFO_WRITE_AVAIL(handle->audio_fifo);
|
||||
slock_unlock(handle->lock);
|
||||
|
||||
if (!handle->alive)
|
||||
@ -1184,7 +1186,7 @@ static bool encode_video(ffmpeg_t *handle, AVFrame *frame)
|
||||
|
||||
pkt = handle->pkt;
|
||||
pkt->data = handle->video.outbuf;
|
||||
pkt->size = handle->video.outbuf_size;
|
||||
pkt->size = (int)handle->video.outbuf_size;
|
||||
|
||||
ret = avcodec_send_frame(handle->video.codec, frame);
|
||||
if (ret < 0)
|
||||
@ -1346,14 +1348,14 @@ static bool encode_audio(ffmpeg_t *handle, bool dry)
|
||||
pkt = handle->pkt;
|
||||
|
||||
pkt->data = handle->audio.outbuf;
|
||||
pkt->size = handle->audio.outbuf_size;
|
||||
pkt->size = (int)handle->audio.outbuf_size;
|
||||
|
||||
frame = av_frame_alloc();
|
||||
|
||||
if (!frame)
|
||||
return false;
|
||||
|
||||
frame->nb_samples = handle->audio.frames_in_buffer;
|
||||
frame->nb_samples = (int)handle->audio.frames_in_buffer;
|
||||
frame->format = handle->audio.codec->sample_fmt;
|
||||
#if HAVE_CH_LAYOUT
|
||||
av_channel_layout_copy(&frame->ch_layout, &handle->audio.codec->ch_layout);
|
||||
@ -1373,7 +1375,7 @@ static bool encode_audio(ffmpeg_t *handle, bool dry)
|
||||
samples_size = av_samples_get_buffer_size(
|
||||
NULL,
|
||||
nb_channels,
|
||||
handle->audio.frames_in_buffer,
|
||||
(int)handle->audio.frames_in_buffer,
|
||||
handle->audio.codec->sample_fmt, 0);
|
||||
|
||||
av_frame_get_buffer(frame, 0);
|
||||
|
@ -73,7 +73,7 @@ static bool wav_write_hdr(record_wav_t *handle, unsigned channels, unsigned samp
|
||||
handle->frame = 2 * channels;
|
||||
/* set initial size to 4 hours; to be fixed inside record_wav_finalize */
|
||||
length = 4 * 60 * 60 * samplerate * handle->frame;
|
||||
header.riff_size = swap_if_big32(sizeof(wav_hdr_t) - offsetof(wav_hdr_t, fourcc) + length),
|
||||
header.riff_size = swap_if_big32(sizeof(wav_hdr_t) - offsetof(wav_hdr_t, fourcc) + length);
|
||||
memcpy(header.fourcc, "WAVE", sizeof(header.fourcc));
|
||||
memcpy(header.fmt_tag, "fmt ", sizeof(header.fmt_tag));
|
||||
header.fmt_size = swap_if_big32(sizeof(header.fmt));
|
||||
|
@ -722,7 +722,8 @@ enum
|
||||
#endif
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
[MXMetricManager.sharedManager addSubscriber:self];
|
||||
if (@available(iOS 13.0, *))
|
||||
[MXMetricManager.sharedManager addSubscriber:self];
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MFI
|
||||
@ -900,7 +901,7 @@ enum
|
||||
- (void)supportOtherAudioSessions { }
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
- (void)didReceiveMetricPayloads:(NSArray<MXMetricPayload *> *)payloads
|
||||
- (void)didReceiveMetricPayloads:(NSArray<MXMetricPayload *> *)payloads API_AVAILABLE(ios(13.0))
|
||||
{
|
||||
for (MXMetricPayload *payload in payloads)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user