Cleanup some warnings

This commit is contained in:
Twinaphex 2019-06-22 13:44:10 +02:00
parent 98c1f04635
commit 9180cc5ba2
6 changed files with 14 additions and 15 deletions

View File

@ -467,7 +467,7 @@ static int rcheevos_read_number(void* userdata,
}
else if (ud->is_console_id)
{
ud->patchdata->console_id = strtol(number, NULL, 10);
ud->patchdata->console_id = (unsigned)strtol(number, NULL, 10);
ud->is_console_id = 0;
}

View File

@ -2943,12 +2943,11 @@ static void rgui_render_osk(rgui_t *rgui, menu_animation_ctx_ticker_t *ticker)
/* Draw input buffer text */
{
unsigned input_str_length;
unsigned input_str_char_offset;
int input_str_x, input_str_y;
int text_cursor_x;
unsigned input_str_length = (unsigned)strlen(input_str);
input_str_length = strlen(input_str);
if (input_str_length > input_str_max_length)
{
input_str_char_offset = input_str_length - input_str_max_length;
@ -3347,7 +3346,7 @@ static void rgui_render(void *data, bool is_idle)
percent_str[powerstate_len] = '\0';
powerstate_len += 2;
powerstate_x = term_end_x - (powerstate_len * FONT_WIDTH_STRIDE);
powerstate_x = term_end_x - (powerstate_len * FONT_WIDTH_STRIDE);
/* Draw symbol */
blit_symbol(fb_width, powerstate_x, title_y, powerstate_symbol,
@ -3378,7 +3377,7 @@ static void rgui_render(void *data, bool is_idle)
string_to_upper(title_buf);
title_len = utf8len(title_buf);
title_x = rgui_term_layout.start_x +
title_x = rgui_term_layout.start_x +
(rgui_term_layout.width - title_len) * FONT_WIDTH_STRIDE / 2;
/* Title is always centred, unless it is long enough
@ -3472,7 +3471,7 @@ static void rgui_render(void *data, bool is_idle)
if (settings->bools.menu_rgui_full_width_layout)
{
/* Resize fields according to actual length of value string */
entry_value_len = strlen(entry_value);
entry_value_len = (unsigned)strlen(entry_value);
entry_value_len = entry_value_len > rgui_term_layout.value_maxlen ?
rgui_term_layout.value_maxlen : entry_value_len;
}

View File

@ -390,7 +390,7 @@ bool menu_widgets_msg_queue_push(
if (task)
{
msg_widget->msg = strdup(title);
msg_widget->msg_len = strlen(title);
msg_widget->msg_len = (unsigned)strlen(title);
msg_widget->task_error = task->error;
msg_widget->task_cancelled = task->cancelled;
@ -412,7 +412,7 @@ bool menu_widgets_msg_queue_push(
{
/* Compute rect width, wrap if necessary */
/* Single line text > two lines text > two lines text with expanded width */
unsigned title_length = strlen(title);
unsigned title_length = (unsigned)strlen(title);
char *msg = strdup(title);
unsigned width = msg_queue_default_rect_width;
unsigned text_width = font_driver_get_message_width(font_regular, title, title_length, msg_queue_text_scale_factor);
@ -440,7 +440,7 @@ bool menu_widgets_msg_queue_push(
}
msg_widget->msg = msg;
msg_widget->msg_len = strlen(msg);
msg_widget->msg_len = (unsigned)strlen(msg);
msg_widget->width = width + simple_widget_padding/2;
}
@ -457,7 +457,7 @@ bool menu_widgets_msg_queue_push(
if (task->title != msg_widget->task_title_ptr)
{
unsigned len = strlen(task->title);
unsigned len = (unsigned)strlen(task->title);
unsigned new_width = font_driver_get_message_width(font_regular, task->title, len, msg_queue_text_scale_factor);
if (msg_widget->msg_new)
@ -836,7 +836,7 @@ void menu_widgets_iterate(void)
/* Regular messages are always above tasks */
else
{
unsigned idx = current_msgs->size - msg_queue_tasks_count;
unsigned idx = current_msgs->size - msg_queue_tasks_count;
file_list_insert(current_msgs,
NULL,
NULL,
@ -956,7 +956,7 @@ static int menu_widgets_draw_indicator(video_frame_info_t *video_info,
{
unsigned height = simple_widget_height;
const char *txt = msg_hash_to_str(msg);
width = font_driver_get_message_width(font_regular, txt, strlen(txt), 1) + simple_widget_padding*2;
width = font_driver_get_message_width(font_regular, txt, (unsigned)strlen(txt), 1) + simple_widget_padding*2;
menu_display_draw_quad(video_info,
top_right_x_advance - width, y,

View File

@ -148,7 +148,7 @@ static bool playlist_path_equal(const char *real_path, const char *entry_path)
if (delim)
{
char compressed_path_b[PATH_MAX_LENGTH] = {0};
unsigned len = 1 + delim - full_path;
unsigned len = (unsigned)(1 + delim - full_path);
strlcpy(compressed_path_b, full_path,
(len < PATH_MAX_LENGTH ? len : PATH_MAX_LENGTH) * sizeof(char));

View File

@ -17550,7 +17550,7 @@ void rarch_send_debug_info(void)
2, 180, true,
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
param_buf_pos = strlcpy(param_buf, "info=", param_buf_size);
param_buf_pos = (int)strlcpy(param_buf, "info=", param_buf_size);
param_buf_tmp = param_buf + param_buf_pos;
net_http_urlencode(&param_buf_tmp, info_buf);

View File

@ -770,7 +770,7 @@ retro_subsystem_info *content_file_init_subsystem(
char *msg = (char*)malloc(path_size);
struct string_list *subsystem = path_get_subsystem_list();
const struct retro_subsystem_info *special = libretro_find_subsystem_info(
subsystem_data, subsystem_current_count,
subsystem_data, (unsigned)subsystem_current_count,
path_get(RARCH_PATH_SUBSYSTEM));
msg[0] = '\0';