mirror of
https://github.com/libretro/RetroArch.git
synced 2025-12-28 05:24:00 +00:00
Some CXX_BUILD buildfixes
This commit is contained in:
parent
6efdb108ae
commit
151d49311d
@ -1110,7 +1110,7 @@ static bool wasapi_microphone_mic_alive(const void *driver_context, const void *
|
||||
|
||||
static struct string_list *wasapi_microphone_device_list_new(const void *driver_context)
|
||||
{
|
||||
return mmdevice_list_new(driver_context, 1 /* eCapture */);
|
||||
return (struct string_list*)mmdevice_list_new(driver_context, 1 /* eCapture */);
|
||||
}
|
||||
|
||||
static void wasapi_microphone_device_list_free(const void *driver_context, struct string_list *devices)
|
||||
|
||||
@ -94,7 +94,9 @@ static int ffmpeg_camera_get_initial_options(
|
||||
|
||||
if (result < 0)
|
||||
{
|
||||
RARCH_ERR("[FFMPEG] Failed to set option: %s.\n", av_err2str(result));
|
||||
char msg[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_make_error_string(msg, AV_ERROR_MAX_STRING_SIZE, result);
|
||||
RARCH_ERR("[FFMPEG] Failed to set option: %s.\n", msg);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
@ -153,14 +155,18 @@ static int ffmpeg_camera_open_device(ffmpeg_camera_t *ffmpeg)
|
||||
|
||||
if (result < 0)
|
||||
{
|
||||
RARCH_ERR("[FFMPEG] Failed to copy options: %s.\n", av_err2str(result));
|
||||
char msg[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_make_error_string(msg, AV_ERROR_MAX_STRING_SIZE, result);
|
||||
RARCH_ERR("[FFMPEG] Failed to copy options: %s.\n", msg);
|
||||
goto done;
|
||||
}
|
||||
|
||||
result = avformat_open_input(&ffmpeg->format_context, ffmpeg->url, ffmpeg->input_format, &options);
|
||||
if (result < 0)
|
||||
{
|
||||
RARCH_WARN("[FFMPEG] Failed to open video input device \"%s\": %s.\n", ffmpeg->url, av_err2str(result));
|
||||
char msg[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_make_error_string(msg, AV_ERROR_MAX_STRING_SIZE, result);
|
||||
RARCH_WARN("[FFMPEG] Failed to open video input device \"%s\": %s.\n", ffmpeg->url, msg);
|
||||
|
||||
if (ffmpeg->options)
|
||||
{ /* If we're not already requesting the default format... */
|
||||
@ -168,7 +174,9 @@ static int ffmpeg_camera_open_device(ffmpeg_camera_t *ffmpeg)
|
||||
result = avformat_open_input(&ffmpeg->format_context, ffmpeg->url, ffmpeg->input_format, NULL);
|
||||
if (result < 0)
|
||||
{
|
||||
RARCH_ERR("[FFMPEG] Failed to open the same device in its default format: %s.\n", av_err2str(result));
|
||||
char msg[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_make_error_string(msg, AV_ERROR_MAX_STRING_SIZE, result);
|
||||
RARCH_ERR("[FFMPEG] Failed to open the same device in its default format: %s.\n", msg);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
@ -177,8 +185,8 @@ static int ffmpeg_camera_open_device(ffmpeg_camera_t *ffmpeg)
|
||||
done:
|
||||
if (options)
|
||||
{
|
||||
const AVDictionaryEntry prev;
|
||||
while ((e = av_dict_get(options, "", &prev, AV_DICT_IGNORE_SUFFIX)))
|
||||
const AVDictionaryEntry *prev = NULL;
|
||||
while ((e = av_dict_get(options, "", prev, AV_DICT_IGNORE_SUFFIX)))
|
||||
{
|
||||
/* av_dict_iterate isn't always available, so we use av_dict_get's legacy behavior instead */
|
||||
RARCH_WARN("[FFMPEG] Unrecognized option on video input device: %s=%s.\n", e->key, e->value);
|
||||
@ -232,7 +240,9 @@ static void *ffmpeg_camera_init(const char *device, uint64_t caps, unsigned widt
|
||||
result = ffmpeg_camera_get_initial_options(ffmpeg->input_format, &ffmpeg->options, caps, width, height);
|
||||
if (result < 0)
|
||||
{
|
||||
RARCH_ERR("[FFMPEG] Failed to get initial options: %s.\n", av_err2str(result));
|
||||
char msg[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_make_error_string(msg, AV_ERROR_MAX_STRING_SIZE, result);
|
||||
RARCH_ERR("[FFMPEG] Failed to get initial options: %s.\n", msg);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@ -245,7 +255,9 @@ static void *ffmpeg_camera_init(const char *device, uint64_t caps, unsigned widt
|
||||
|
||||
if (num_sources < 0)
|
||||
{
|
||||
RARCH_ERR("[FFMPEG] Failed to list video input sources: %s.\n", av_err2str(num_sources));
|
||||
char msg[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_make_error_string(msg, AV_ERROR_MAX_STRING_SIZE, num_sources);
|
||||
RARCH_ERR("[FFMPEG] Failed to list video input sources: %s.\n", msg);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@ -263,7 +275,7 @@ error:
|
||||
static void ffmpeg_camera_stop(void *data);
|
||||
static void ffmpeg_camera_free(void *data)
|
||||
{
|
||||
ffmpeg_camera_t *ffmpeg = data;
|
||||
ffmpeg_camera_t *ffmpeg = (ffmpeg_camera_t*)data;
|
||||
|
||||
if (!ffmpeg)
|
||||
return;
|
||||
@ -279,16 +291,17 @@ static void ffmpeg_camera_poll_thread(void *data);
|
||||
|
||||
static bool ffmpeg_camera_start(void *data)
|
||||
{
|
||||
ffmpeg_camera_t *ffmpeg = data;
|
||||
int result = 0;
|
||||
AVStream *stream = NULL;
|
||||
AVDictionary *options = NULL;
|
||||
const AVDictionaryEntry *prev = NULL;
|
||||
ffmpeg_camera_t *ffmpeg = (ffmpeg_camera_t*)data;
|
||||
int result = 0;
|
||||
AVStream *stream = NULL;
|
||||
AVDictionary *options = NULL;
|
||||
const AVDictionaryEntry *e = NULL;
|
||||
const AVDictionaryEntry prev;
|
||||
int target_buffer_length = 0;
|
||||
int target_buffer_length = 0;
|
||||
|
||||
/* TODO: Check the actual format context, not just the pointer */
|
||||
if (ffmpeg->format_context)
|
||||
{ // TODO: Check the actual format context, not just the pointer
|
||||
{
|
||||
RARCH_LOG("[FFMPEG] Camera %s is already started, no action needed.\n", ffmpeg->format_context->url);
|
||||
return true;
|
||||
}
|
||||
@ -300,18 +313,22 @@ static bool ffmpeg_camera_start(void *data)
|
||||
result = av_dict_copy(&options, ffmpeg->options, 0);
|
||||
if (result < 0)
|
||||
{
|
||||
RARCH_ERR("[FFMPEG] Failed to copy options: %s.\n", av_err2str(result));
|
||||
char msg[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_make_error_string(msg, AV_ERROR_MAX_STRING_SIZE, result);
|
||||
RARCH_ERR("[FFMPEG] Failed to copy options: %s.\n", msg);
|
||||
goto error;
|
||||
}
|
||||
|
||||
result = avformat_find_stream_info(ffmpeg->format_context, &options);
|
||||
if (result < 0)
|
||||
{
|
||||
RARCH_ERR("[FFMPEG] Failed to find stream info: %s.\n", av_err2str(result));
|
||||
char msg[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_make_error_string(msg, AV_ERROR_MAX_STRING_SIZE, result);
|
||||
RARCH_ERR("[FFMPEG] Failed to find stream info: %s.\n", msg);
|
||||
goto error;
|
||||
}
|
||||
|
||||
while ((e = av_dict_get(options, "", &prev, AV_DICT_IGNORE_SUFFIX)))
|
||||
while ((e = av_dict_get(options, "", prev, AV_DICT_IGNORE_SUFFIX)))
|
||||
{
|
||||
RARCH_WARN("[FFMPEG] Unrecognized option on video input device: %s=%s.\n", e->key, e->value);
|
||||
}
|
||||
@ -320,7 +337,9 @@ static bool ffmpeg_camera_start(void *data)
|
||||
AVMEDIA_TYPE_VIDEO, -1, -1, &ffmpeg->decoder, 0);
|
||||
if (result < 0)
|
||||
{
|
||||
RARCH_ERR("[FFMPEG] Failed to find video stream: %s.\n", av_err2str(result));
|
||||
char msg[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_make_error_string(msg, AV_ERROR_MAX_STRING_SIZE, result);
|
||||
RARCH_ERR("[FFMPEG] Failed to find video stream: %s.\n", msg);
|
||||
goto error;
|
||||
}
|
||||
stream = ffmpeg->format_context->streams[result];
|
||||
@ -337,7 +356,9 @@ static bool ffmpeg_camera_start(void *data)
|
||||
result = avcodec_parameters_to_context(ffmpeg->decoder_context, stream->codecpar);
|
||||
if (result < 0)
|
||||
{
|
||||
RARCH_ERR("[FFMPEG] Failed to copy codec parameters to decoder context: %s.\n", av_err2str(result));
|
||||
char msg[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_make_error_string(msg, AV_ERROR_MAX_STRING_SIZE, result);
|
||||
RARCH_ERR("[FFMPEG] Failed to copy codec parameters to decoder context: %s.\n", msg);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@ -350,18 +371,22 @@ static bool ffmpeg_camera_start(void *data)
|
||||
result = av_dict_copy(&ffmpeg->options, options, 0);
|
||||
if (result < 0)
|
||||
{
|
||||
RARCH_ERR("[FFMPEG] Failed to copy options: %s.\n", av_err2str(result));
|
||||
char msg[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_make_error_string(msg, AV_ERROR_MAX_STRING_SIZE, result);
|
||||
RARCH_ERR("[FFMPEG] Failed to copy options: %s.\n", msg);
|
||||
goto error;
|
||||
}
|
||||
|
||||
result = avcodec_open2(ffmpeg->decoder_context, ffmpeg->decoder, &options);
|
||||
if (result < 0)
|
||||
{
|
||||
RARCH_ERR("[FFMPEG] Failed to open decoder: %s.\n", av_err2str(result));
|
||||
char msg[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_make_error_string(msg, AV_ERROR_MAX_STRING_SIZE, result);
|
||||
RARCH_ERR("[FFMPEG] Failed to open decoder: %s.\n", msg);
|
||||
goto error;
|
||||
}
|
||||
|
||||
while ((e = av_dict_get(options, "", &prev, AV_DICT_IGNORE_SUFFIX)))
|
||||
while ((e = av_dict_get(options, "", prev, AV_DICT_IGNORE_SUFFIX)))
|
||||
{
|
||||
RARCH_WARN("[FFMPEG] Unrecognized option on video input device: %s=%s.\n", e->key, e->value);
|
||||
}
|
||||
@ -395,14 +420,16 @@ static bool ffmpeg_camera_start(void *data)
|
||||
);
|
||||
if (target_buffer_length < 0)
|
||||
{
|
||||
RARCH_ERR("[FFMPEG] Failed to allocate target plane: %s.\n", av_err2str(target_buffer_length));
|
||||
char msg[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_make_error_string(msg, AV_ERROR_MAX_STRING_SIZE, target_buffer_length);
|
||||
RARCH_ERR("[FFMPEG] Failed to allocate target plane: %s.\n", msg);
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* target buffer aligned to 4 bytes because it's exposed to the core as a uint32_t[] */
|
||||
ffmpeg->target_buffer_length = target_buffer_length;
|
||||
ffmpeg->target_buffers[0] = memalign_alloc(4, target_buffer_length);
|
||||
ffmpeg->target_buffers[1] = memalign_alloc(4, target_buffer_length);
|
||||
ffmpeg->target_buffers[0] = (uint8_t*)memalign_alloc(4, target_buffer_length);
|
||||
ffmpeg->target_buffers[1] = (uint8_t*)memalign_alloc(4, target_buffer_length);
|
||||
ffmpeg->active_buffer = ffmpeg->target_buffers[0];
|
||||
if (!ffmpeg->target_buffers[0] || !ffmpeg->target_buffers[1])
|
||||
{
|
||||
@ -461,7 +488,7 @@ error:
|
||||
|
||||
static void ffmpeg_camera_stop(void *data)
|
||||
{
|
||||
ffmpeg_camera_t *ffmpeg = data;
|
||||
ffmpeg_camera_t *ffmpeg = (ffmpeg_camera_t*)data;
|
||||
|
||||
if (!ffmpeg->format_context)
|
||||
{
|
||||
@ -472,7 +499,9 @@ static void ffmpeg_camera_stop(void *data)
|
||||
int result = avcodec_send_packet(ffmpeg->decoder_context, NULL);
|
||||
if (result < 0)
|
||||
{
|
||||
RARCH_ERR("[FFMPEG] Failed to flush decoder: %s.\n", av_err2str(result));
|
||||
char msg[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_make_error_string(msg, AV_ERROR_MAX_STRING_SIZE, result);
|
||||
RARCH_ERR("[FFMPEG] Failed to flush decoder: %s.\n", msg);
|
||||
}
|
||||
}
|
||||
|
||||
@ -508,7 +537,7 @@ static void ffmpeg_camera_stop(void *data)
|
||||
|
||||
static void ffmpeg_camera_poll_thread(void *data)
|
||||
{
|
||||
ffmpeg_camera_t *ffmpeg = data;
|
||||
ffmpeg_camera_t *ffmpeg = (ffmpeg_camera_t*)data;
|
||||
|
||||
if (!ffmpeg)
|
||||
return;
|
||||
@ -516,9 +545,12 @@ static void ffmpeg_camera_poll_thread(void *data)
|
||||
while (!ffmpeg->done)
|
||||
{
|
||||
int result = av_read_frame(ffmpeg->format_context, ffmpeg->packet);
|
||||
/* Read the raw data from the camera. If that fails... */
|
||||
if (result < 0)
|
||||
{ /* Read the raw data from the camera. If that fails... */
|
||||
RARCH_ERR("[FFMPEG] Failed to read frame: %s.\n", av_err2str(result));
|
||||
{
|
||||
char msg[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_make_error_string(msg, AV_ERROR_MAX_STRING_SIZE, result);
|
||||
RARCH_ERR("[FFMPEG] Failed to read frame: %s.\n", msg);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -531,7 +563,9 @@ static void ffmpeg_camera_poll_thread(void *data)
|
||||
}
|
||||
else
|
||||
{
|
||||
RARCH_ERR("[FFMPEG] Failed to send packet to decoder: %s.\n", av_err2str(result));
|
||||
char msg[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_make_error_string(msg, AV_ERROR_MAX_STRING_SIZE, result);
|
||||
RARCH_ERR("[FFMPEG] Failed to send packet to decoder: %s.\n", msg);
|
||||
}
|
||||
|
||||
goto done_loop;
|
||||
@ -539,11 +573,16 @@ static void ffmpeg_camera_poll_thread(void *data)
|
||||
|
||||
/* video streams consist of exactly one frame per packet */
|
||||
result = avcodec_receive_frame(ffmpeg->decoder_context, ffmpeg->camera_frame);
|
||||
|
||||
/* Send the decoded data to the camera frame. If that fails... */
|
||||
if (result < 0)
|
||||
{ /* Send the decoded data to the camera frame. If that fails... */
|
||||
{
|
||||
/* These error codes mean no new frame, but not necessarily a problem */
|
||||
if (!(result == AVERROR_EOF || result == AVERROR(EAGAIN)))
|
||||
{ /* these error codes mean no new frame, but not necessarily a problem */
|
||||
RARCH_ERR("[FFMPEG] Failed to receive camera frame from decoder: %s.\n", av_err2str(result));
|
||||
{
|
||||
char msg[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_make_error_string(msg, AV_ERROR_MAX_STRING_SIZE, result);
|
||||
RARCH_ERR("[FFMPEG] Failed to receive camera frame from decoder: %s.\n", msg);
|
||||
}
|
||||
|
||||
goto done_loop;
|
||||
@ -561,9 +600,13 @@ static void ffmpeg_camera_poll_thread(void *data)
|
||||
ffmpeg->target_planes,
|
||||
ffmpeg->target_linesizes
|
||||
);
|
||||
|
||||
/* Scale and convert the frame to the target format. If that fails... */
|
||||
if (result < 0)
|
||||
{ /* Scale and convert the frame to the target format. If that fails... */
|
||||
RARCH_ERR("[FFMPEG] Failed to scale frame: %s.\n", av_err2str(result));
|
||||
{
|
||||
char msg[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_make_error_string(msg, AV_ERROR_MAX_STRING_SIZE, result);
|
||||
RARCH_ERR("[FFMPEG] Failed to scale frame: %s.\n", msg);
|
||||
goto done_loop;
|
||||
}
|
||||
|
||||
@ -583,7 +626,9 @@ static void ffmpeg_camera_poll_thread(void *data)
|
||||
slock_unlock(ffmpeg->target_buffer_lock);
|
||||
if (result < 0)
|
||||
{
|
||||
RARCH_ERR("[FFMPEG] Failed to copy frame to buffer: %s.\n", av_err2str(result));
|
||||
char msg[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_make_error_string(msg, AV_ERROR_MAX_STRING_SIZE, result);
|
||||
RARCH_ERR("[FFMPEG] Failed to copy frame to buffer: %s.\n", msg);
|
||||
goto done_loop;
|
||||
}
|
||||
done_loop:
|
||||
@ -595,12 +640,11 @@ static void ffmpeg_camera_poll_thread(void *data)
|
||||
av_packet_unref(ffmpeg->packet);
|
||||
}
|
||||
|
||||
static bool ffmpeg_camera_poll(
|
||||
void *data,
|
||||
static bool ffmpeg_camera_poll(void *data,
|
||||
retro_camera_frame_raw_framebuffer_t frame_raw_cb,
|
||||
retro_camera_frame_opengl_texture_t frame_gl_cb)
|
||||
{
|
||||
ffmpeg_camera_t *ffmpeg = data;
|
||||
ffmpeg_camera_t *ffmpeg = (ffmpeg_camera_t*)data;
|
||||
|
||||
if (!ffmpeg->format_context)
|
||||
{
|
||||
|
||||
@ -1502,7 +1502,7 @@ static void rcheevos_client_load_game_callback(int result,
|
||||
/* Have to "schedule" this. Game image should not be
|
||||
* loaded into memory on background thread */
|
||||
if (!task_is_on_main_thread())
|
||||
rcheevos_locals.queued_command = CMD_CHEEVOS_FINALIZE_LOAD;
|
||||
rcheevos_locals.queued_command = (enum event_command)CMD_CHEEVOS_FINALIZE_LOAD;
|
||||
else
|
||||
#endif
|
||||
rcheevos_finalize_game_load_on_ui_thread();
|
||||
|
||||
@ -310,9 +310,11 @@ void rcheevos_client_http_load_response(const rc_api_request_t* request,
|
||||
void rcheevos_client_server_call(const rc_api_request_t* request,
|
||||
rc_client_server_callback_t callback, void* callback_data, rc_client_t* client)
|
||||
{
|
||||
rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
|
||||
rc_client_http_task_data_t* taskdata = malloc(sizeof(rc_client_http_task_data_t));
|
||||
taskdata->callback = callback;
|
||||
rcheevos_locals_t *rcheevos_locals = (rcheevos_locals_t*)get_rcheevos_locals();
|
||||
rc_client_http_task_data_t *taskdata = (rc_client_http_task_data_t*)
|
||||
malloc(sizeof(rc_client_http_task_data_t));
|
||||
|
||||
taskdata->callback = callback;
|
||||
taskdata->callback_data = callback_data;
|
||||
|
||||
if (request->post_data)
|
||||
@ -423,11 +425,11 @@ static void rcheevos_client_download_task_callback(retro_task_t* task,
|
||||
bool rcheevos_client_download_badge(rc_client_download_queue_t* queue,
|
||||
const char* url, const char* badge_name)
|
||||
{
|
||||
rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
|
||||
rc_client_download_task_data_t* taskdata;
|
||||
char badge_fullpath[512] = "";
|
||||
char* badge_fullname;
|
||||
size_t badge_fullname_size;
|
||||
rc_client_download_task_data_t* taskdata;
|
||||
char badge_fullpath[512] = "";
|
||||
rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
|
||||
|
||||
/* make sure the directory exists */
|
||||
fill_pathname_application_special(badge_fullpath, sizeof(badge_fullpath),
|
||||
@ -440,7 +442,7 @@ bool rcheevos_client_download_badge(rc_client_download_queue_t* queue,
|
||||
}
|
||||
|
||||
fill_pathname_slash(badge_fullpath, sizeof(badge_fullpath));
|
||||
badge_fullname = badge_fullpath + strlen(badge_fullpath);
|
||||
badge_fullname = badge_fullpath + strlen(badge_fullpath);
|
||||
badge_fullname_size = sizeof(badge_fullpath) - (badge_fullname - badge_fullpath);
|
||||
snprintf(badge_fullname, badge_fullname_size, "%s" FILE_PATH_PNG_EXTENSION, badge_name);
|
||||
|
||||
@ -472,12 +474,12 @@ void rcheevos_client_download_badge_from_url(const char* url, const char* badge_
|
||||
|
||||
static void rcheevos_client_fetch_next_badge(rc_client_download_queue_t* queue)
|
||||
{
|
||||
const rc_client_achievement_bucket_t* bucket;
|
||||
const rc_client_achievement_t* achievement;
|
||||
const char* next_badge;
|
||||
char badge_name[32];
|
||||
const char* url = NULL;
|
||||
bool done = false;
|
||||
const char* next_badge;
|
||||
const rc_client_achievement_bucket_t *bucket;
|
||||
const rc_client_achievement_t *achievement;
|
||||
const char *url = NULL;
|
||||
bool done = false;
|
||||
|
||||
do
|
||||
{
|
||||
@ -514,20 +516,18 @@ static void rcheevos_client_fetch_next_badge(rc_client_download_queue_t* queue)
|
||||
|
||||
if (queue->pass == 0)
|
||||
{
|
||||
/* first pass - get all unlocked badges */
|
||||
url = achievement->badge_url;
|
||||
/* First pass - get all unlocked badges */
|
||||
url = achievement->badge_url;
|
||||
next_badge = achievement->badge_name;
|
||||
}
|
||||
/* Second pass - don't need locked badge for
|
||||
* achievement player has already unlocked */
|
||||
else if (achievement->unlock_time)
|
||||
{
|
||||
/* second pass - don't need locked badge for achievement player has already unlocked */
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* second pass - get locked badge */
|
||||
/* Second pass - get locked badge */
|
||||
url = achievement->badge_locked_url;
|
||||
|
||||
snprintf(badge_name, sizeof(badge_name), "%s_lock", achievement->badge_name);
|
||||
next_badge = badge_name;
|
||||
}
|
||||
@ -545,11 +545,11 @@ static void rcheevos_client_fetch_next_badge(rc_client_download_queue_t* queue)
|
||||
slock_unlock(queue->lock);
|
||||
#endif
|
||||
|
||||
/* If the badge already exists (download_badge returns false), continue
|
||||
* looping to the next item. otherwise, a download was queued, so break
|
||||
* out of the loop. */
|
||||
if (next_badge)
|
||||
{
|
||||
/* if the badge already exists (download_badge returns false), continue
|
||||
* looping to the next item. otherwise, a download was queued, so break
|
||||
* out of the loop. */
|
||||
if (rcheevos_client_download_badge(queue, url, next_badge))
|
||||
break;
|
||||
}
|
||||
@ -594,7 +594,7 @@ void rcheevos_client_download_game_badge(const rc_client_game_t* game)
|
||||
|
||||
void rcheevos_client_download_achievement_badges(rc_client_t* client)
|
||||
{
|
||||
uint32_t i;
|
||||
size_t i;
|
||||
rc_client_download_queue_t *queue = (rc_client_download_queue_t*)
|
||||
calloc(1, sizeof(*queue));
|
||||
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
|
||||
#include <retro_inline.h>
|
||||
#include <boolean.h>
|
||||
#include <retro_math.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <file/file_path.h>
|
||||
#include <encodings/utf.h>
|
||||
|
||||
@ -29,10 +29,10 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <retro_inline.h>
|
||||
#include <boolean.h>
|
||||
#include <retro_math.h>
|
||||
|
||||
#include <string/stdstring.h>
|
||||
#include <gfx/scaler/pixconv.h>
|
||||
|
||||
@ -26,12 +26,12 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <retro_inline.h>
|
||||
#include <retro_common_api.h>
|
||||
|
||||
#include <boolean.h>
|
||||
#include <retro_math.h>
|
||||
|
||||
#include <string/stdstring.h>
|
||||
#include <file/file_path.h>
|
||||
|
||||
@ -139,7 +139,7 @@ static int d3d9x_win32_font_get_message_width(void* data, const char* msg,
|
||||
font = (ID3DXFont*)d3dfonts->font;
|
||||
|
||||
font->lpVtbl->DrawText(font, NULL,
|
||||
(void*)msg, msg_len ? (INT)msg_len : -1, &box, DT_CALCRECT, 0);
|
||||
(LPCTSTR)msg, msg_len ? (INT)msg_len : -1, &box, DT_CALCRECT, 0);
|
||||
|
||||
return box.right - box.left;
|
||||
}
|
||||
@ -240,12 +240,12 @@ static void d3d9x_win32_font_render_msg(
|
||||
unsigned drop_b = b * drop_mod;
|
||||
|
||||
font->lpVtbl->DrawText(font, NULL,
|
||||
(void*)msg, -1, p_rect_shifted, format,
|
||||
(LPCTSTR)msg, -1, p_rect_shifted, format,
|
||||
D3DCOLOR_ARGB(drop_a , drop_r, drop_g, drop_b));
|
||||
}
|
||||
|
||||
font->lpVtbl->DrawText(font, NULL,
|
||||
(void*)msg, -1, p_rect, format,
|
||||
(LPCTSTR)msg, -1, p_rect, format,
|
||||
D3DCOLOR_ARGB(a, r, g, b));
|
||||
}
|
||||
|
||||
|
||||
@ -3258,7 +3258,7 @@ static void input_overlay_poll_mouse(settings_t *settings,
|
||||
static bool pending_click;
|
||||
|
||||
input_overlay_get_mouse_scale(settings,
|
||||
&mouse_st->scale_x, &mouse_st->scale_y,
|
||||
(float*)&mouse_st->scale_x, &mouse_st->scale_y,
|
||||
&swipe_thres_x, &swipe_thres_y);
|
||||
|
||||
/* Check for pointer count changes */
|
||||
@ -3691,7 +3691,7 @@ static void input_poll_overlay(
|
||||
if ((orig_bits & (1 << j)) != (new_bits & (1 << j)))
|
||||
{
|
||||
unsigned rk = i * 32 + j;
|
||||
uint32_t c = input_keymaps_translate_rk_to_ascii(rk, key_mod);
|
||||
uint32_t c = input_keymaps_translate_rk_to_ascii((enum retro_key)rk, (enum retro_mod)key_mod);
|
||||
input_keyboard_event(new_bits & (1 << j),
|
||||
rk, c, key_mod, RETRO_DEVICE_POINTER);
|
||||
}
|
||||
@ -6093,8 +6093,10 @@ bool bsv_movie_load_checkpoint(bsv_movie_t *handle, uint8_t compression, uint8_t
|
||||
retro_ctx_serialize_info_t serial_info;
|
||||
input_driver_state_t *input_st = input_state_get_ptr();
|
||||
uint32_t compressed_encoded_size, encoded_size, size;
|
||||
uint8_t *compressed_data = NULL, *encoded_data = NULL, *state = NULL;
|
||||
bool ret = true;
|
||||
uint8_t *compressed_data = NULL;
|
||||
uint8_t *encoded_data = NULL;
|
||||
uint8_t *state = NULL;
|
||||
bool ret = true;
|
||||
|
||||
if (intfstream_read(handle->file, &(size),
|
||||
sizeof(uint32_t)) != sizeof(uint32_t))
|
||||
@ -6117,10 +6119,10 @@ bool bsv_movie_load_checkpoint(bsv_movie_t *handle, uint8_t compression, uint8_t
|
||||
ret = false;
|
||||
goto exit;
|
||||
}
|
||||
size = swap_if_big32(size);
|
||||
encoded_size = swap_if_big32(encoded_size);
|
||||
size = swap_if_big32(size);
|
||||
encoded_size = swap_if_big32(encoded_size);
|
||||
compressed_encoded_size = swap_if_big32(compressed_encoded_size);
|
||||
compressed_data = malloc(compressed_encoded_size);
|
||||
compressed_data = (uint8_t*)malloc(compressed_encoded_size);
|
||||
if (intfstream_read(handle->file, compressed_data, compressed_encoded_size) != (int64_t)compressed_encoded_size)
|
||||
{
|
||||
RARCH_ERR("[Replay] Truncated checkpoint, terminating movie\n");
|
||||
@ -6131,7 +6133,7 @@ bool bsv_movie_load_checkpoint(bsv_movie_t *handle, uint8_t compression, uint8_t
|
||||
switch (compression)
|
||||
{
|
||||
case REPLAY_CHECKPOINT2_COMPRESSION_NONE:
|
||||
encoded_data = compressed_data;
|
||||
encoded_data = compressed_data;
|
||||
compressed_data = NULL;
|
||||
break;
|
||||
#ifdef HAVE_ZLIB
|
||||
@ -6142,7 +6144,7 @@ bool bsv_movie_load_checkpoint(bsv_movie_t *handle, uint8_t compression, uint8_t
|
||||
#else
|
||||
uint32_t uncompressed_size_zlib = encoded_size;
|
||||
#endif
|
||||
encoded_data = calloc(encoded_size, sizeof(uint8_t));
|
||||
encoded_data = (uint8_t*)calloc(encoded_size, sizeof(uint8_t));
|
||||
if (uncompress(encoded_data, &uncompressed_size_zlib, compressed_data, compressed_encoded_size) != Z_OK)
|
||||
{
|
||||
ret = false;
|
||||
@ -6159,7 +6161,7 @@ bool bsv_movie_load_checkpoint(bsv_movie_t *handle, uint8_t compression, uint8_t
|
||||
margin. but, how could the margin be known without
|
||||
calling the function that takes the compressed frames as
|
||||
an input? */
|
||||
encoded_data = calloc(encoded_size, sizeof(uint8_t));
|
||||
encoded_data = (uint8_t*)calloc(encoded_size, sizeof(uint8_t));
|
||||
uncompressed_size_big = ZSTD_decompress(encoded_data, encoded_size, compressed_data, compressed_encoded_size);
|
||||
if (ZSTD_isError(uncompressed_size_big))
|
||||
{
|
||||
@ -6176,8 +6178,8 @@ bool bsv_movie_load_checkpoint(bsv_movie_t *handle, uint8_t compression, uint8_t
|
||||
switch (encoding)
|
||||
{
|
||||
case REPLAY_CHECKPOINT2_ENCODING_RAW:
|
||||
size = encoded_size;
|
||||
state = encoded_data;
|
||||
size = encoded_size;
|
||||
state = encoded_data;
|
||||
encoded_data = NULL;
|
||||
break;
|
||||
default:
|
||||
@ -6206,13 +6208,15 @@ bool bsv_movie_write_checkpoint(bsv_movie_t *handle, uint8_t compression, uint8_
|
||||
{
|
||||
bool ret = true;
|
||||
uint32_t encoded_size, compressed_encoded_size, size_;
|
||||
uint8_t *encoded_data = NULL, *compressed_encoded_data = NULL;
|
||||
bool owns_encoded = false, owns_compressed_encoded = false;
|
||||
uint8_t *encoded_data = NULL;
|
||||
uint8_t *compressed_encoded_data = NULL;
|
||||
bool owns_encoded = false;
|
||||
bool owns_compressed_encoded = false;
|
||||
switch (encoding)
|
||||
{
|
||||
case REPLAY_CHECKPOINT2_ENCODING_RAW:
|
||||
encoded_size = serial_info.size;
|
||||
encoded_data = serial_info.data;
|
||||
encoded_data = (uint8_t*)serial_info.data;
|
||||
break;
|
||||
default:
|
||||
RARCH_ERR("[Replay] Unrecognized encoding scheme %d\n", encoding);
|
||||
@ -6223,13 +6227,13 @@ bool bsv_movie_write_checkpoint(bsv_movie_t *handle, uint8_t compression, uint8_
|
||||
{
|
||||
case REPLAY_CHECKPOINT2_COMPRESSION_NONE:
|
||||
compressed_encoded_size = encoded_size;
|
||||
compressed_encoded_data = encoded_data;
|
||||
compressed_encoded_data = (uint8_t*)encoded_data;
|
||||
break;
|
||||
#ifdef HAVE_ZLIB
|
||||
case REPLAY_CHECKPOINT2_COMPRESSION_ZLIB:
|
||||
{
|
||||
uLongf zlib_compressed_encoded_size = compressBound(encoded_size);
|
||||
compressed_encoded_data = calloc(zlib_compressed_encoded_size, sizeof(uint8_t));
|
||||
compressed_encoded_data = (uint8_t*)calloc(zlib_compressed_encoded_size, sizeof(uint8_t));
|
||||
owns_compressed_encoded = true;
|
||||
if (compress2(compressed_encoded_data, &zlib_compressed_encoded_size, encoded_data, encoded_size, 6) != Z_OK)
|
||||
{
|
||||
@ -6244,7 +6248,7 @@ bool bsv_movie_write_checkpoint(bsv_movie_t *handle, uint8_t compression, uint8_
|
||||
case REPLAY_CHECKPOINT2_COMPRESSION_ZSTD:
|
||||
{
|
||||
size_t compressed_encoded_size_big = ZSTD_compressBound(encoded_size);
|
||||
compressed_encoded_data = calloc(compressed_encoded_size_big, sizeof(uint8_t));
|
||||
compressed_encoded_data = (uint8_t*)calloc(compressed_encoded_size_big, sizeof(uint8_t));
|
||||
owns_compressed_encoded = true;
|
||||
compressed_encoded_size_big = ZSTD_compress(compressed_encoded_data, compressed_encoded_size_big, encoded_data, encoded_size, 9);
|
||||
if (ZSTD_isError(compressed_encoded_size_big))
|
||||
@ -6355,7 +6359,7 @@ void bsv_movie_read_next_events(bsv_movie_t *handle)
|
||||
return;
|
||||
}
|
||||
_len = swap_if_big64(_len);
|
||||
state = calloc(_len, sizeof(uint8_t));
|
||||
state = (uint8_t*)calloc(_len, sizeof(uint8_t));
|
||||
if (intfstream_read(handle->file, state, _len) != (int64_t)_len)
|
||||
{
|
||||
/* Unnatural EOF */
|
||||
@ -6673,7 +6677,7 @@ static bool replay_check_same_timeline(bsv_movie_t *movie,
|
||||
|
||||
bool replay_set_serialized_data(void* buf)
|
||||
{
|
||||
uint8_t *buffer = buf;
|
||||
uint8_t *buffer = (uint8_t*)buf;
|
||||
input_driver_state_t *input_st = &input_driver_st;
|
||||
bool playback = (input_st->bsv_movie_state.flags & BSV_FLAG_MOVIE_PLAYBACK) ? true : false;
|
||||
bool recording = (input_st->bsv_movie_state.flags & BSV_FLAG_MOVIE_RECORDING) ? true : false;
|
||||
|
||||
@ -323,6 +323,19 @@ typedef struct input_overlay_state
|
||||
int touch_count;
|
||||
} input_overlay_state_t;
|
||||
|
||||
typedef struct input_overlay_mouse_state
|
||||
{
|
||||
float scale_x;
|
||||
float scale_y;
|
||||
|
||||
int16_t prev_screen_x;
|
||||
int16_t prev_screen_y;
|
||||
|
||||
/* Bits 0-2 used for LMB, RMB, MMB */
|
||||
uint8_t click;
|
||||
uint8_t hold;
|
||||
} input_overlay_mouse_state_t;
|
||||
|
||||
/* Non-hitbox input state for pointer, mouse, and lightgun */
|
||||
typedef struct input_overlay_pointer_state
|
||||
{
|
||||
@ -344,18 +357,7 @@ typedef struct input_overlay_pointer_state
|
||||
unsigned multitouch_id;
|
||||
} lightgun;
|
||||
|
||||
struct input_overlay_mouse_state
|
||||
{
|
||||
float scale_x;
|
||||
float scale_y;
|
||||
|
||||
int16_t prev_screen_x;
|
||||
int16_t prev_screen_y;
|
||||
|
||||
/* Bits 0-2 used for LMB, RMB, MMB */
|
||||
uint8_t click;
|
||||
uint8_t hold;
|
||||
} mouse;
|
||||
input_overlay_mouse_state_t mouse;
|
||||
|
||||
/* Mask of requested devices
|
||||
* to avoid unnecessary polling */
|
||||
|
||||
@ -80,6 +80,31 @@ static slock_t *conn_pool_lock = NULL;
|
||||
#define UNLOCK_POOL()
|
||||
#endif
|
||||
|
||||
typedef struct response
|
||||
{
|
||||
char *data;
|
||||
struct string_list *headers;
|
||||
size_t pos;
|
||||
size_t len;
|
||||
size_t buflen;
|
||||
int status;
|
||||
enum response_part part;
|
||||
enum bodytype bodytype;
|
||||
} response_t;
|
||||
|
||||
typedef struct request
|
||||
{
|
||||
char *domain;
|
||||
char *path;
|
||||
char *method;
|
||||
char *contenttype;
|
||||
void *postdata;
|
||||
char *useragent;
|
||||
char *headers;
|
||||
size_t contentlength;
|
||||
int port;
|
||||
} request_t;
|
||||
|
||||
struct http_t
|
||||
{
|
||||
bool err;
|
||||
@ -88,30 +113,8 @@ struct http_t
|
||||
bool ssl;
|
||||
bool request_sent;
|
||||
|
||||
struct request
|
||||
{
|
||||
char *domain;
|
||||
char *path;
|
||||
char *method;
|
||||
char *contenttype;
|
||||
void *postdata;
|
||||
char *useragent;
|
||||
char *headers;
|
||||
size_t contentlength;
|
||||
int port;
|
||||
} request;
|
||||
|
||||
struct response
|
||||
{
|
||||
char *data;
|
||||
struct string_list *headers;
|
||||
size_t pos;
|
||||
size_t len;
|
||||
size_t buflen;
|
||||
int status;
|
||||
enum response_part part;
|
||||
enum bodytype bodytype;
|
||||
} response;
|
||||
request_t request;
|
||||
response_t response;
|
||||
};
|
||||
|
||||
struct http_connection_t
|
||||
@ -1043,7 +1046,7 @@ static void net_http_send_str(
|
||||
|
||||
static bool net_http_send_request(struct http_t *state)
|
||||
{
|
||||
struct request *request = &state->request;
|
||||
struct request *request = (struct request*)&state->request;
|
||||
|
||||
/* This is a bit lazy, but it works. */
|
||||
if (request->method)
|
||||
@ -1130,7 +1133,8 @@ static bool net_http_send_request(struct http_t *state)
|
||||
net_http_send_str(state, "\r\n", STRLEN_CONST("\r\n"));
|
||||
|
||||
if (request->postdata && request->contentlength)
|
||||
net_http_send_str(state, request->postdata, request->contentlength);
|
||||
net_http_send_str(state, (const char*)request->postdata,
|
||||
request->contentlength);
|
||||
|
||||
state->request_sent = true;
|
||||
return state->err;
|
||||
@ -1153,7 +1157,7 @@ int net_http_fd(struct http_t *state)
|
||||
|
||||
static ssize_t net_http_receive_header(struct http_t *state, ssize_t newlen)
|
||||
{
|
||||
struct response *response = &state->response;
|
||||
struct response *response = (struct response*)&state->response;
|
||||
|
||||
response->pos += newlen;
|
||||
|
||||
@ -1244,7 +1248,7 @@ static ssize_t net_http_receive_header(struct http_t *state, ssize_t newlen)
|
||||
|
||||
static bool net_http_receive_body(struct http_t *state, ssize_t newlen)
|
||||
{
|
||||
struct response *response = &state->response;
|
||||
struct response *response = (struct response*)&state->response;
|
||||
|
||||
if (newlen < 0 || state->err)
|
||||
{
|
||||
@ -1377,20 +1381,20 @@ static bool net_http_redirect(struct http_t *state, const char *location)
|
||||
}
|
||||
else
|
||||
{
|
||||
char *path = malloc(PATH_MAX_LENGTH);
|
||||
char *path = (char*)malloc(PATH_MAX_LENGTH);
|
||||
fill_pathname_resolve_relative(path, state->request.path, location, PATH_MAX_LENGTH);
|
||||
free(state->request.path);
|
||||
state->request.path = path;
|
||||
}
|
||||
}
|
||||
state->request_sent = false;
|
||||
state->response.part = P_HEADER_TOP;
|
||||
state->response.status = -1;
|
||||
state->response.buflen = 16 * 1024;
|
||||
state->response.data = realloc(state->response.data, state->response.buflen);
|
||||
state->response.pos = 0;
|
||||
state->response.len = 0;
|
||||
state->response.bodytype = T_FULL;
|
||||
state->request_sent = false;
|
||||
state->response.part = P_HEADER_TOP;
|
||||
state->response.status = -1;
|
||||
state->response.buflen = 16 * 1024;
|
||||
state->response.data = (char*)realloc(state->response.data, state->response.buflen);
|
||||
state->response.pos = 0;
|
||||
state->response.len = 0;
|
||||
state->response.bodytype = T_FULL;
|
||||
/* after this, assume location is invalid */
|
||||
string_list_deinitialize(state->response.headers);
|
||||
string_list_initialize(state->response.headers);
|
||||
@ -1436,7 +1440,7 @@ bool net_http_update(struct http_t *state, size_t* progress, size_t* total)
|
||||
if (!state->request_sent)
|
||||
return net_http_send_request(state);
|
||||
|
||||
response = &state->response;
|
||||
response = (struct response*)&state->response;
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
if (state->ssl && state->conn->ssl_ctx)
|
||||
|
||||
@ -423,8 +423,9 @@ GENERIC_DEFERRED_CURSOR_MANAGER(deferred_push_cursor_manager_list_deferred_query
|
||||
size_t dsize = (desired_size); \
|
||||
if (_len + dsize < size) \
|
||||
break; \
|
||||
reallocated = realloc(newstr2, size += dsize * 2); \
|
||||
if (!reallocated) { \
|
||||
reallocated = (char*)realloc(newstr2, size += dsize * 2); \
|
||||
if (!reallocated) \
|
||||
{ \
|
||||
free(newstr2); \
|
||||
return -1; \
|
||||
} \
|
||||
|
||||
@ -6039,7 +6039,8 @@ border_iterate:
|
||||
{
|
||||
ozone_node_t *sidebar_node = (ozone_node_t*)
|
||||
(ozone->horizontal_list.size)
|
||||
? file_list_get_userdata_at_offset(&ozone->horizontal_list, selection_buf->list[i].entry_idx)
|
||||
? (ozone_node_t*)file_list_get_userdata_at_offset(
|
||||
&ozone->horizontal_list, selection_buf->list[i].entry_idx)
|
||||
: NULL;
|
||||
|
||||
if (sidebar_node && sidebar_node->icon)
|
||||
|
||||
@ -5230,7 +5230,7 @@ static int xmb_draw_item(
|
||||
{
|
||||
xmb_node_t *sidebar_node = (xmb_node_t*)
|
||||
(xmb->horizontal_list.size)
|
||||
? file_list_get_userdata_at_offset(&xmb->horizontal_list, list->list[i].entry_idx)
|
||||
? (xmb_node_t*)file_list_get_userdata_at_offset(&xmb->horizontal_list, list->list[i].entry_idx)
|
||||
: NULL;
|
||||
|
||||
if (sidebar_node && sidebar_node->icon)
|
||||
|
||||
@ -123,9 +123,9 @@ static void webdav_cleanup_digest(void)
|
||||
|
||||
static char *webdav_create_ha1_hash(char *user, char *realm, char *pass)
|
||||
{
|
||||
char *hash = malloc(33);
|
||||
MD5_CTX md5;
|
||||
unsigned char digest[16];
|
||||
MD5_CTX md5;
|
||||
unsigned char digest[16];
|
||||
char *hash = (char*)malloc(33);
|
||||
|
||||
MD5_Init(&md5);
|
||||
MD5_Update(&md5, user, strlen(user));
|
||||
@ -171,7 +171,7 @@ static bool webdav_create_digest_auth(char *digest)
|
||||
{
|
||||
ptr += STRLEN_CONST("realm=\"");
|
||||
_len = strchr(ptr, '"') + 1 - ptr;
|
||||
webdav_st->realm = malloc(_len);
|
||||
webdav_st->realm = (char*)malloc(_len);
|
||||
strlcpy(webdav_st->realm, ptr, _len);
|
||||
ptr += _len;
|
||||
|
||||
@ -207,7 +207,7 @@ static bool webdav_create_digest_auth(char *digest)
|
||||
{
|
||||
ptr += STRLEN_CONST("nonce=\"");
|
||||
_len = strchr(ptr, '"') + 1 - ptr;
|
||||
webdav_st->nonce = malloc(_len);
|
||||
webdav_st->nonce = (char*)malloc(_len);
|
||||
strlcpy(webdav_st->nonce, ptr, _len);
|
||||
ptr += _len;
|
||||
}
|
||||
@ -217,7 +217,7 @@ static bool webdav_create_digest_auth(char *digest)
|
||||
if (strchr(ptr, ','))
|
||||
{
|
||||
_len = strchr(ptr, ',') + 1 - ptr;
|
||||
webdav_st->algo = malloc(_len);
|
||||
webdav_st->algo = (char*)malloc(_len);
|
||||
strlcpy(webdav_st->algo, ptr, _len);
|
||||
ptr += _len;
|
||||
}
|
||||
@ -231,7 +231,7 @@ static bool webdav_create_digest_auth(char *digest)
|
||||
{
|
||||
ptr += STRLEN_CONST("opaque=\"");
|
||||
_len = strchr(ptr, '"') + 1 - ptr;
|
||||
webdav_st->opaque = malloc(_len);
|
||||
webdav_st->opaque = (char*)malloc(_len);
|
||||
strlcpy(webdav_st->opaque, ptr, _len);
|
||||
ptr += _len;
|
||||
}
|
||||
@ -279,7 +279,7 @@ static char *webdav_create_ha1(void)
|
||||
if (!string_is_equal(webdav_st->algo, "MD5-sess"))
|
||||
return strdup(webdav_st->ha1hash);
|
||||
|
||||
hash = malloc(33);
|
||||
hash = (char*)malloc(33);
|
||||
|
||||
MD5_Init(&md5);
|
||||
MD5_Update(&md5, webdav_st->ha1hash, 32);
|
||||
@ -302,7 +302,7 @@ static char *webdav_create_ha2(const char *method, const char *path)
|
||||
MD5_CTX md5;
|
||||
unsigned char digest[16];
|
||||
/* no attempt at supporting auth-int, everything else uses this */
|
||||
char *hash = malloc(33);
|
||||
char *hash = (char*)malloc(33);
|
||||
|
||||
MD5_Init(&md5);
|
||||
MD5_Update(&md5, method, strlen(method));
|
||||
@ -325,7 +325,7 @@ static char *webdav_create_digest_response(const char *method, const char *path)
|
||||
webdav_state_t *webdav_st = webdav_state_get_ptr();
|
||||
char *ha1 = webdav_create_ha1();
|
||||
char *ha2 = webdav_create_ha2(method, path);
|
||||
char *hash = malloc(33);
|
||||
char *hash = (char*)malloc(33);
|
||||
|
||||
MD5_Init(&md5);
|
||||
MD5_Update(&md5, ha1, 32);
|
||||
|
||||
@ -7662,7 +7662,7 @@ static bool netplay_process_savestate1(retro_ctx_serialize_info_t* serial_info)
|
||||
#ifdef HAVE_CHEEVOS
|
||||
const settings_t* settings = config_get_ptr();
|
||||
#endif
|
||||
const uint8_t* input = serial_info->data_const;
|
||||
const uint8_t* input = (const uint8_t*)serial_info->data_const;
|
||||
const uint8_t* stop = input + serial_info->size;
|
||||
bool seen_core = false;
|
||||
|
||||
|
||||
@ -1094,12 +1094,10 @@ void playlist_update_thumbnail_name_flag(playlist_t *playlist, size_t idx,
|
||||
enum playlist_thumbnail_name_flags playlist_get_curr_thumbnail_name_flag(playlist_t *playlist, size_t idx)
|
||||
{
|
||||
struct playlist_entry *entry = NULL;
|
||||
|
||||
if (!playlist || idx >= RBUF_LEN(playlist->entries))
|
||||
return PLAYLIST_THUMBNAIL_FLAG_NONE;
|
||||
|
||||
entry = &playlist->entries[idx];
|
||||
return entry->thumbnail_flags;
|
||||
return (enum playlist_thumbnail_name_flags)entry->thumbnail_flags;
|
||||
}
|
||||
|
||||
|
||||
@ -1109,7 +1107,7 @@ enum playlist_thumbnail_name_flags playlist_get_next_thumbnail_name_flag(playlis
|
||||
|
||||
if (!playlist || idx >= RBUF_LEN(playlist->entries))
|
||||
return PLAYLIST_THUMBNAIL_FLAG_NONE;
|
||||
entry = &playlist->entries[idx];
|
||||
entry = (struct playlist_entry*)&playlist->entries[idx];
|
||||
|
||||
if (entry->thumbnail_flags & PLAYLIST_THUMBNAIL_FLAG_SHORT_NAME)
|
||||
return PLAYLIST_THUMBNAIL_FLAG_NONE;
|
||||
|
||||
@ -142,7 +142,7 @@ struct playlist_entry
|
||||
unsigned last_played_minute;
|
||||
unsigned last_played_second;
|
||||
enum playlist_runtime_status runtime_status;
|
||||
enum playlist_thumbnail_name_flags thumbnail_flags;
|
||||
int thumbnail_flags;
|
||||
};
|
||||
|
||||
/* Holds all configuration parameters required
|
||||
|
||||
@ -120,7 +120,7 @@ static bool wav_fix_hdr_and_close(record_wav_t *handle)
|
||||
|
||||
static void *record_wav_new(const struct record_params *params)
|
||||
{
|
||||
record_wav_t *handle = calloc(1, sizeof(*handle));
|
||||
record_wav_t *handle = (record_wav_t*)calloc(1, sizeof(*handle));
|
||||
if (!handle)
|
||||
return NULL;
|
||||
|
||||
|
||||
35
runloop.c
35
runloop.c
@ -2132,28 +2132,31 @@ bool runloop_environment_cb(unsigned cmd, void *data)
|
||||
|
||||
for (retro_id = 0; retro_id < RARCH_FIRST_CUSTOM_BIND; retro_id++)
|
||||
{
|
||||
enum msg_hash_enums _enum;
|
||||
unsigned bind_index = input_config_bind_order[retro_id];
|
||||
const char *description = sys_info->input_desc_btn[mapped_port][bind_index];
|
||||
|
||||
if (!description)
|
||||
continue;
|
||||
|
||||
_enum = (enum msg_hash_enums)(MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B + bind_index);
|
||||
RARCH_DBG(" \"%s\" => \"%s\"\n",
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B + bind_index),
|
||||
description);
|
||||
msg_hash_to_str(_enum), description);
|
||||
}
|
||||
|
||||
for (retro_id = RARCH_FIRST_CUSTOM_BIND; retro_id < RARCH_ANALOG_BIND_LIST_END; retro_id++)
|
||||
{
|
||||
enum msg_hash_enums _enum;
|
||||
unsigned bind_index = input_config_bind_order[retro_id];
|
||||
const char *description = sys_info->input_desc_btn[mapped_port][bind_index];
|
||||
|
||||
if (!description)
|
||||
continue;
|
||||
|
||||
_enum = (enum msg_hash_enums)(MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_PLUS
|
||||
+ bind_index - RARCH_FIRST_CUSTOM_BIND);
|
||||
RARCH_DBG(" \"%s\" => \"%s\"\n",
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_PLUS + bind_index - RARCH_FIRST_CUSTOM_BIND),
|
||||
description);
|
||||
msg_hash_to_str(_enum), description);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3107,7 +3110,7 @@ bool runloop_environment_cb(unsigned cmd, void *data)
|
||||
|
||||
case RETRO_ENVIRONMENT_GET_AUDIO_VIDEO_ENABLE:
|
||||
{
|
||||
enum retro_av_enable_flags result = (enum retro_av_enable_flags)0;
|
||||
int result = 0;
|
||||
video_driver_state_t *video_st = video_state_get_ptr();
|
||||
audio_driver_state_t *audio_st = audio_state_get_ptr();
|
||||
|
||||
@ -3139,7 +3142,7 @@ bool runloop_environment_cb(unsigned cmd, void *data)
|
||||
if (data)
|
||||
{
|
||||
enum retro_av_enable_flags* result_p = (enum retro_av_enable_flags*)data;
|
||||
*result_p = result;
|
||||
*result_p = (enum retro_av_enable_flags)result;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -4111,7 +4114,7 @@ void runloop_event_deinit_core(void)
|
||||
if (settings->bools.video_frame_delay_auto)
|
||||
video_st->frame_delay_target = 0;
|
||||
|
||||
driver_uninit(DRIVERS_CMD_ALL, 0);
|
||||
driver_uninit(DRIVERS_CMD_ALL, (enum driver_lifetime_flags)0);
|
||||
|
||||
#ifdef HAVE_CONFIGFILE
|
||||
if (runloop_st->flags & RUNLOOP_FLAG_OVERRIDES_ACTIVE)
|
||||
@ -4578,8 +4581,8 @@ static void core_input_state_poll_maybe(void)
|
||||
const enum poll_type_override_t
|
||||
core_poll_type_override = runloop_st->core_poll_type_override;
|
||||
enum poll_type new_poll_type = (core_poll_type_override > POLL_TYPE_OVERRIDE_DONTCARE)
|
||||
? (core_poll_type_override - 1)
|
||||
: runloop_st->current_core.poll_type;
|
||||
? (enum poll_type)(core_poll_type_override - 1)
|
||||
: (enum poll_type)(runloop_st->current_core.poll_type);
|
||||
if (new_poll_type == POLL_TYPE_NORMAL)
|
||||
input_driver_poll();
|
||||
}
|
||||
@ -4591,8 +4594,8 @@ static retro_input_state_t core_input_state_poll_return_cb(void)
|
||||
const enum poll_type_override_t
|
||||
core_poll_type_override = runloop_st->core_poll_type_override;
|
||||
enum poll_type new_poll_type = (core_poll_type_override > POLL_TYPE_OVERRIDE_DONTCARE)
|
||||
? (core_poll_type_override - 1)
|
||||
: runloop_st->current_core.poll_type;
|
||||
? (enum poll_type)(core_poll_type_override - 1)
|
||||
: (enum poll_type)(runloop_st->current_core.poll_type);
|
||||
if (new_poll_type == POLL_TYPE_LATE)
|
||||
return core_input_state_poll_late;
|
||||
return input_driver_state_wrapper;
|
||||
@ -4632,7 +4635,7 @@ static bool runloop_event_load_core(runloop_state_t *runloop_st,
|
||||
unsigned poll_type_behavior)
|
||||
{
|
||||
video_driver_state_t *video_st = video_state_get_ptr();
|
||||
runloop_st->current_core.poll_type = poll_type_behavior;
|
||||
runloop_st->current_core.poll_type = (enum poll_type)poll_type_behavior;
|
||||
|
||||
if (!core_verify_api_version(runloop_st))
|
||||
return false;
|
||||
@ -7715,7 +7718,7 @@ bool core_reset_cheat(void)
|
||||
bool core_set_poll_type(unsigned type)
|
||||
{
|
||||
runloop_state_t *runloop_st = &runloop_state;
|
||||
runloop_st->current_core.poll_type = type;
|
||||
runloop_st->current_core.poll_type = (enum poll_type)type;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -7909,9 +7912,9 @@ void core_run(void)
|
||||
current_core = &runloop_st->current_core;
|
||||
const enum poll_type_override_t
|
||||
core_poll_type_override = runloop_st->core_poll_type_override;
|
||||
enum poll_type new_poll_type = (core_poll_type_override != POLL_TYPE_OVERRIDE_DONTCARE)
|
||||
? (core_poll_type_override - 1)
|
||||
: current_core->poll_type;
|
||||
enum poll_type new_poll_type= (core_poll_type_override != POLL_TYPE_OVERRIDE_DONTCARE)
|
||||
? (enum poll_type)(core_poll_type_override - 1)
|
||||
: (enum poll_type)(current_core->poll_type);
|
||||
bool early_polling = new_poll_type == POLL_TYPE_EARLY;
|
||||
bool late_polling = new_poll_type == POLL_TYPE_LATE;
|
||||
#ifdef HAVE_NETWORKING
|
||||
|
||||
@ -417,7 +417,7 @@ static void task_cloud_sync_build_current_manifest(task_cloud_sync_state_t *sync
|
||||
/* The paths iterated here are not portable, because they are still used for iterating later on */
|
||||
for (i = 0; i < dirlist->size; i++)
|
||||
task_cloud_sync_manifest_append_dir(sync_state->current_manifest,
|
||||
dirlist->elems[i].userdata, dirlist->elems[i].data);
|
||||
(const char*)dirlist->elems[i].userdata, dirlist->elems[i].data);
|
||||
|
||||
file_list_sort_on_alt(sync_state->current_manifest);
|
||||
sync_state->phase = CLOUD_SYNC_PHASE_DIFF;
|
||||
@ -489,12 +489,12 @@ static INLINE int task_cloud_sync_key_cmp(struct item_file *left, struct item_fi
|
||||
|
||||
static char *task_cloud_sync_md5_rfile(RFILE *file)
|
||||
{
|
||||
MD5_CTX md5;
|
||||
int rv;
|
||||
char *hash = malloc(33);
|
||||
int rv;
|
||||
MD5_CTX md5;
|
||||
unsigned char buf[4096];
|
||||
unsigned char digest[16];
|
||||
libretro_vfs_implementation_file *hfile = filestream_get_vfs_handle(file);
|
||||
char *hash = (char*)malloc(33);
|
||||
|
||||
if (!hash)
|
||||
return NULL;
|
||||
@ -504,12 +504,14 @@ static char *task_cloud_sync_md5_rfile(RFILE *file)
|
||||
if (hfile && hfile->mapped)
|
||||
MD5_Update(&md5, hfile->mapped, hfile->size);
|
||||
else
|
||||
{
|
||||
do
|
||||
{
|
||||
rv = (int)filestream_read(file, buf, sizeof(buf));
|
||||
if (rv > 0)
|
||||
MD5_Update(&md5, buf, rv);
|
||||
} while (rv > 0);
|
||||
}
|
||||
MD5_Final(digest, &md5);
|
||||
|
||||
snprintf(hash, 33, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
|
||||
@ -631,7 +633,9 @@ static void task_cloud_sync_fetch_server_file(task_cloud_sync_state_t *sync_stat
|
||||
{
|
||||
if (!string_starts_with(key, dirlist->elems[i].data))
|
||||
continue;
|
||||
fill_pathname_join_special(filename, dirlist->elems[i].userdata, path, sizeof(filename));
|
||||
fill_pathname_join_special(filename,
|
||||
(const char*)dirlist->elems[i].userdata,
|
||||
path, sizeof(filename));
|
||||
pathname_conform_slashes_to_os(filename);
|
||||
break;
|
||||
}
|
||||
@ -639,7 +643,8 @@ static void task_cloud_sync_fetch_server_file(task_cloud_sync_state_t *sync_stat
|
||||
{
|
||||
/* how did this end up here? we don't know where to put it... */
|
||||
RARCH_WARN(CSPFX "Don't know where to put %s!\n", key);
|
||||
task_cloud_sync_add_to_updated_manifest(sync_state, key, CS_FILE_HASH(server_file), true);
|
||||
task_cloud_sync_add_to_updated_manifest(sync_state,
|
||||
key, CS_FILE_HASH(server_file), true);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -652,7 +657,7 @@ static void task_cloud_sync_fetch_server_file(task_cloud_sync_state_t *sync_stat
|
||||
|
||||
fill_pathname_basedir(directory, filename, sizeof(directory));
|
||||
path_mkdir(directory);
|
||||
fetch_state = malloc(sizeof(task_cloud_sync_fetch_state_t));
|
||||
fetch_state = (task_cloud_sync_fetch_state_t*)malloc(sizeof(task_cloud_sync_fetch_state_t));
|
||||
if (!fetch_state)
|
||||
{
|
||||
RARCH_WARN(CSPFX "Wanted to fetch %s but failed to malloc.\n", key);
|
||||
|
||||
@ -188,13 +188,13 @@ int detect_ps1_game(intfstream_t *fd, char *s, size_t len, const char *filename)
|
||||
{
|
||||
int pos;
|
||||
char raw_game_id[50];
|
||||
char *disc_data = malloc(DISC_DATA_SIZE_PS1);
|
||||
char *disc_data = (char*)malloc(DISC_DATA_SIZE_PS1);
|
||||
|
||||
if (!disc_data)
|
||||
return false;
|
||||
|
||||
/* Load data into buffer and use pointers */
|
||||
if (intfstream_seek(fd, 0, SEEK_SET) < 0
|
||||
if ( intfstream_seek(fd, 0, SEEK_SET) < 0
|
||||
|| intfstream_read(fd, disc_data, DISC_DATA_SIZE_PS1) <= 0)
|
||||
{
|
||||
free(disc_data);
|
||||
@ -295,7 +295,7 @@ int detect_ps2_game(intfstream_t *fd, char *s, size_t len, const char *filename)
|
||||
if (intfstream_seek(fd, 0, SEEK_SET) < 0)
|
||||
return false;
|
||||
|
||||
disc_data = malloc(DISC_DATA_SIZE_PS2);
|
||||
disc_data = (char*)malloc(DISC_DATA_SIZE_PS2);
|
||||
|
||||
if (intfstream_read(fd, disc_data, DISC_DATA_SIZE_PS2) <= 0)
|
||||
{
|
||||
@ -419,7 +419,7 @@ int detect_psp_game(intfstream_t *fd, char *s, size_t len, const char *filename)
|
||||
{
|
||||
#define DISC_DATA_SIZE_PSP 300000
|
||||
int pos;
|
||||
char *disc_data = malloc(DISC_DATA_SIZE_PSP);
|
||||
char *disc_data = (char*)malloc(DISC_DATA_SIZE_PSP);
|
||||
|
||||
if (!disc_data)
|
||||
return false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user