diff --git a/deps/dr/dr_flac.h b/deps/dr/dr_flac.h index 121cb133a8..a15ca1f9db 100644 --- a/deps/dr/dr_flac.h +++ b/deps/dr/dr_flac.h @@ -1348,12 +1348,12 @@ static DRFLAC_INLINE drflac_bool32 drflac__read_uint32(drflac_bs* bs, unsigned i /* It straddles the cached data. It will never cover more than the next chunk. We just read the number in two parts and combine them. */ drflac_uint32 bitCountHi = DRFLAC_CACHE_L1_BITS_REMAINING(bs); drflac_uint32 bitCountLo = bitCount - bitCountHi; - drflac_uint32 resultHi = DRFLAC_CACHE_L1_SELECT_AND_SHIFT(bs, bitCountHi); + drflac_uint32 resultHi = (drflac_uint32)DRFLAC_CACHE_L1_SELECT_AND_SHIFT(bs, bitCountHi); if (!drflac__reload_cache(bs)) return DRFLAC_FALSE; - *pResultOut = (resultHi << bitCountLo) | DRFLAC_CACHE_L1_SELECT_AND_SHIFT(bs, bitCountLo); + *pResultOut = (drflac_uint32)(resultHi << bitCountLo) | DRFLAC_CACHE_L1_SELECT_AND_SHIFT(bs, bitCountLo); bs->consumedBits += bitCountLo; bs->cache <<= bitCountLo; return DRFLAC_TRUE; diff --git a/deps/rcheevos/src/rcheevos/operand.c b/deps/rcheevos/src/rcheevos/operand.c index f968e0e1c8..d62081a094 100644 --- a/deps/rcheevos/src/rcheevos/operand.c +++ b/deps/rcheevos/src/rcheevos/operand.c @@ -135,7 +135,7 @@ static int rc_parse_operand_memory(rc_operand_t* self, const char** memaddr, rc_ address = 0xffffffffU; } - self->value.memref = rc_alloc_memref_value(parse, address, size, is_bcd); + self->value.memref = rc_alloc_memref_value(parse, (unsigned)address, size, is_bcd); if (parse->offset < 0) return parse->offset; diff --git a/deps/rcheevos/src/rcheevos/richpresence.c b/deps/rcheevos/src/rcheevos/richpresence.c index 85a7a51f57..f7c4d83706 100644 --- a/deps/rcheevos/src/rcheevos/richpresence.c +++ b/deps/rcheevos/src/rcheevos/richpresence.c @@ -208,9 +208,9 @@ static const char* rc_parse_richpresence_lookup(rc_richpresence_lookup_t* lookup } if (number[0] == '0' && number[1] == 'x') - key = strtoul(&number[2], 0, 16); + key = (unsigned)strtoul(&number[2], 0, 16); else - key = strtoul(&number[0], 0, 10); + key = (unsigned)strtoul(&number[0], 0, 10); item = RC_ALLOC(rc_richpresence_lookup_item_t, parse); item->value = key; diff --git a/deps/stb/stb_truetype.h b/deps/stb/stb_truetype.h index 5798c45658..79df4f2000 100644 --- a/deps/stb/stb_truetype.h +++ b/deps/stb/stb_truetype.h @@ -1978,11 +1978,17 @@ static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill, float t; y0 = y_bottom - (y0 - y_top); y1 = y_bottom - (y1 - y_top); - t = y0, y0 = y1, y1 = t; - t = x_bottom, x_bottom = x_top, x_top = t; + t = y0; + y0 = y1; + y1 = t; + t = x_bottom; + x_bottom = x_top; + x_top = t; dx = -dx; dy = -dy; - t = x0, x0 = xb, xb = t; + t = x0; + x0 = xb; + xb = t; } x1 = (int) x_top; @@ -2297,7 +2303,8 @@ static void stbtt__rasterize(stbtt__bitmap *result, stbtt__point *pts, int *wcou e[n].invert = 0; if (invert ? p[j].y > p[k].y : p[j].y < p[k].y) { e[n].invert = 1; - a=j,b=k; + a=j; + b=k; } e[n].x0 = p[a].x * scale_x + shift_x; e[n].y0 = (p[a].y * y_scale_inv + shift_y) * vsubsample; @@ -2400,11 +2407,13 @@ static stbtt__point *stbtt_FlattenCurves(stbtt_vertex *vertices, int num_verts, ++n; start = num_points; - x = vertices[i].x, y = vertices[i].y; + x = vertices[i].x; + y = vertices[i].y; stbtt__add_point(points, num_points++, x,y); break; case STBTT_vline: - x = vertices[i].x, y = vertices[i].y; + x = vertices[i].x; + y = vertices[i].y; stbtt__add_point(points, num_points++, x, y); break; case STBTT_vcurve: @@ -2412,7 +2421,8 @@ static stbtt__point *stbtt_FlattenCurves(stbtt_vertex *vertices, int num_verts, vertices[i].cx, vertices[i].cy, vertices[i].x, vertices[i].y, objspace_flatness_squared, 0); - x = vertices[i].x, y = vertices[i].y; + x = vertices[i].x; + y = vertices[i].y; break; } } @@ -2585,7 +2595,10 @@ STBTT_DEF int stbtt_BakeFontBitmap( gw = x1-x0; gh = y1-y0; if (x + gw + 1 >= pw) - y = bottom_y, x = 1; /* advance to next row */ + { + y = bottom_y; + x = 1; /* advance to next row */ + } if (y + gh + 1 >= ph) /* check if it fits vertically AFTER potentially moving to next row */ return -i; retro_assert(x+gw < pw); diff --git a/deps/stb/stb_vorbis.h b/deps/stb/stb_vorbis.h index be97f0b655..9794f44350 100644 --- a/deps/stb/stb_vorbis.h +++ b/deps/stb/stb_vorbis.h @@ -2311,7 +2311,8 @@ static int do_floor(vorb *f, Mapping *map, int i, int n, float *target, YTYPE *f int hy = finalY[j] * g->floor1_multiplier; int hx = g->Xlist[j]; draw_line(target, lx,ly, hx,hy, n2); - lx = hx, ly = hy; + lx = hx; + ly = hy; } } if (lx < n2) @@ -2527,14 +2528,26 @@ static int vorbis_decode_packet_rest(vorb *f, int *len, Mode *m, int left_start, float a2,m2; if (m[j] > 0) if (a[j] > 0) - m2 = m[j], a2 = m[j] - a[j]; + { + m2 = m[j]; + a2 = m[j] - a[j]; + } else - a2 = m[j], m2 = m[j] + a[j]; + { + a2 = m[j]; + m2 = m[j] + a[j]; + } else if (a[j] > 0) - m2 = m[j], a2 = m[j] + a[j]; + { + m2 = m[j]; + a2 = m[j] + a[j]; + } else - a2 = m[j], m2 = m[j] - a[j]; + { + a2 = m[j]; + m2 = m[j] - a[j]; + } m[j] = m2; a[j] = a2; } diff --git a/libretro-common/formats/libchdr/libchdr_chd.c b/libretro-common/formats/libchdr/libchdr_chd.c index 4713dd6fc5..3e3de49c26 100644 --- a/libretro-common/formats/libchdr/libchdr_chd.c +++ b/libretro-common/formats/libchdr/libchdr_chd.c @@ -637,14 +637,24 @@ static chd_error decompress_v5_map(chd_file* chd, chd_header* header) { uint8_t *rawmap = header->rawmap + (hunknum * 12); if (repcount > 0) - rawmap[0] = lastcomp, repcount--; + { + rawmap[0] = lastcomp; + repcount--; + } else { uint8_t val = huffman_decode_one(decoder, bitbuf); if (val == COMPRESSION_RLE_SMALL) - rawmap[0] = lastcomp, repcount = 2 + huffman_decode_one(decoder, bitbuf); + { + rawmap[0] = lastcomp; + repcount = 2 + huffman_decode_one(decoder, bitbuf); + } else if (val == COMPRESSION_RLE_LARGE) - rawmap[0] = lastcomp, repcount = 2 + 16 + (huffman_decode_one(decoder, bitbuf) << 4), repcount += huffman_decode_one(decoder, bitbuf); + { + rawmap[0] = lastcomp; + repcount = 2 + 16 + (huffman_decode_one(decoder, bitbuf) << 4); + repcount += huffman_decode_one(decoder, bitbuf); + } else rawmap[0] = lastcomp = val; } @@ -1460,7 +1470,7 @@ static chd_error header_read(chd_file *chd, chd_header *header) header->mapoffset = get_bigendian_uint64(&rawheader[40]); header->metaoffset = get_bigendian_uint64(&rawheader[48]); header->hunkbytes = get_bigendian_uint32(&rawheader[56]); - header->hunkcount = (header->logicalbytes + header->hunkbytes - 1) / header->hunkbytes; + header->hunkcount = (UINT32)((header->logicalbytes + header->hunkbytes - 1) / header->hunkbytes); header->unitbytes = get_bigendian_uint32(&rawheader[60]); header->unitcount = (header->logicalbytes + header->unitbytes - 1) / header->unitbytes; memcpy(header->sha1, &rawheader[84], CHD_SHA1_BYTES); @@ -1614,11 +1624,11 @@ static chd_error hunk_read_into_memory(chd_file *chd, UINT32 hunknum, UINT8 *des if (chd->cachehunk == entry->offset && dest == chd->cache) break; #endif - return hunk_read_into_memory(chd, entry->offset, dest); + return hunk_read_into_memory(chd, (UINT32)entry->offset, dest); /* parent-referenced data */ case MAP_ENTRY_TYPE_PARENT_HUNK: - err = hunk_read_into_memory(chd->parent, entry->offset, dest); + err = hunk_read_into_memory(chd->parent, (UINT32)entry->offset, dest); if (err != CHDERR_NONE) return err; break; @@ -1711,7 +1721,7 @@ static chd_error hunk_read_into_memory(chd_file *chd, UINT32 hunknum, UINT8 *des return CHDERR_NONE; case COMPRESSION_SELF: - return hunk_read_into_memory(chd, blockoffs, dest); + return hunk_read_into_memory(chd, (UINT32)blockoffs, dest); case COMPRESSION_PARENT: #if 0 diff --git a/libretro-common/formats/libchdr/libchdr_flac.c b/libretro-common/formats/libchdr/libchdr_flac.c index 4cc5dc20a4..dd09dc013f 100644 --- a/libretro-common/formats/libchdr/libchdr_flac.c +++ b/libretro-common/formats/libchdr/libchdr_flac.c @@ -190,7 +190,7 @@ uint32_t flac_decoder_finish(flac_decoder* decoder) return 0; if (decoder->compressed_start == (const FLAC__byte *)(decoder->custom_header)) position -= decoder->compressed_length; - return position; + return (uint32_t)position; } /*------------------------------------------------- @@ -208,13 +208,14 @@ FLAC__StreamDecoderReadStatus flac_decoder_read_callback(void* client_data, FLAC { flac_decoder* decoder = (flac_decoder*)client_data; - uint32_t expected = *bytes; + uint32_t expected = (uint32_t)*bytes; /* copy from primary buffer first */ - uint32_t outputpos = 0; + uint32_t outputpos = 0; + if (outputpos < *bytes && decoder->compressed_offset < decoder->compressed_length) { - uint32_t bytes_to_copy = MIN(*bytes - outputpos, decoder->compressed_length - decoder->compressed_offset); + uint32_t bytes_to_copy = (uint32_t)MIN(*bytes - outputpos, decoder->compressed_length - decoder->compressed_offset); memcpy(&buffer[outputpos], decoder->compressed_start + decoder->compressed_offset, bytes_to_copy); outputpos += bytes_to_copy; decoder->compressed_offset += bytes_to_copy; @@ -223,7 +224,7 @@ FLAC__StreamDecoderReadStatus flac_decoder_read_callback(void* client_data, FLAC /* once we're out of that, copy from the secondary buffer */ if (outputpos < *bytes && decoder->compressed_offset < decoder->compressed_length + decoder->compressed2_length) { - uint32_t bytes_to_copy = MIN(*bytes - outputpos, decoder->compressed2_length - (decoder->compressed_offset - decoder->compressed_length)); + uint32_t bytes_to_copy = (uint32_t)MIN(*bytes - outputpos, decoder->compressed2_length - (decoder->compressed_offset - decoder->compressed_length)); memcpy(&buffer[outputpos], decoder->compressed2_start + decoder->compressed_offset - decoder->compressed_length, bytes_to_copy); outputpos += bytes_to_copy; decoder->compressed_offset += bytes_to_copy; diff --git a/libretro-common/formats/libchdr/libchdr_huffman.c b/libretro-common/formats/libchdr/libchdr_huffman.c index 9d69a7b7ac..bf54b59aeb 100644 --- a/libretro-common/formats/libchdr/libchdr_huffman.c +++ b/libretro-common/formats/libchdr/libchdr_huffman.c @@ -273,7 +273,10 @@ enum huffman_error huffman_import_tree_huffman(struct huffman_decoder* decoder, /* determine the maximum length of an RLE count */ temp = decoder->numcodes - 9; while (temp != 0) - temp >>= 1, rlefullbits++; + { + temp >>= 1; + rlefullbits++; + } /* now process the rest of the data */ for (curcode = 0; curcode < decoder->numcodes; ) diff --git a/libretro-common/formats/libchdr/libchdr_lzma.c b/libretro-common/formats/libchdr/libchdr_lzma.c index cf39b97838..846ef8cd20 100644 --- a/libretro-common/formats/libchdr/libchdr_lzma.c +++ b/libretro-common/formats/libchdr/libchdr_lzma.c @@ -102,7 +102,7 @@ static void *lzma_fast_alloc(void *p, size_t size) } /* set the low bit of the size so we don't match next time */ - *addr = size | 1; + *addr = (uint32_t)(size | 1); return addr + 1; } diff --git a/libretro-common/streams/chd_stream.c b/libretro-common/streams/chd_stream.c index f622a782ff..97d3eb4699 100644 --- a/libretro-common/streams/chd_stream.c +++ b/libretro-common/streams/chd_stream.c @@ -332,15 +332,15 @@ ssize_t chdstream_read(chdstream_t *stream, void *data, size_t bytes) frame_offset = stream->offset % stream->frame_size; amount = stream->frame_size - frame_offset; if (amount > end - stream->offset) - amount = end - stream->offset; + amount = (uint32_t)(end - stream->offset); /* In pregap */ if (stream->offset < stream->track_start) memset(out + data_offset, 0, amount); else { - chd_frame = stream->track_frame + - (stream->offset - stream->track_start) / stream->frame_size; + chd_frame = (uint32_t)(stream->track_frame + + (stream->offset - stream->track_start) / stream->frame_size); hunk = chd_frame / stream->frames_per_hunk; hunk_offset = (chd_frame % stream->frames_per_hunk) * hd->unitbytes; diff --git a/managers/cheat_manager.c b/managers/cheat_manager.c index d06a3932b1..0242782736 100644 --- a/managers/cheat_manager.c +++ b/managers/cheat_manager.c @@ -774,7 +774,7 @@ int cheat_manager_initialize_memory(rarch_setting_t *setting, bool wraparound) } cheat_manager_state.memory_buf_list[cheat_manager_state.num_memory_buffers - 1] = (uint8_t*)system->mmaps.descriptors[i].core.ptr; - cheat_manager_state.memory_size_list[cheat_manager_state.num_memory_buffers - 1] = system->mmaps.descriptors[i].core.len; + cheat_manager_state.memory_size_list[cheat_manager_state.num_memory_buffers - 1] = (unsigned)system->mmaps.descriptors[i].core.len; cheat_manager_state.total_memory_size += system->mmaps.descriptors[i].core.len; if (!cheat_manager_state.curr_memory_buf) diff --git a/menu/cbs/menu_cbs_left.c b/menu/cbs/menu_cbs_left.c index 2a3de08eb1..0f5de91849 100644 --- a/menu/cbs/menu_cbs_left.c +++ b/menu/cbs/menu_cbs_left.c @@ -411,7 +411,7 @@ static int playlist_association_left(unsigned type, const char *label, info = core_info_get(list, next); found = string_list_find_elem(stnames, path); if (found && info) - string_list_set(stcores, found-1, info->path); + string_list_set(stcores, (unsigned)(found-1), info->path); string_list_join_concat(new_playlist_cores, sizeof(new_playlist_cores), stcores, ";"); diff --git a/menu/drivers/ozone/ozone.c b/menu/drivers/ozone/ozone.c index 8cbf6018f1..6346d1ac2b 100644 --- a/menu/drivers/ozone/ozone.c +++ b/menu/drivers/ozone/ozone.c @@ -452,7 +452,7 @@ static void ozone_update_thumbnail_image(void *data) if (menu_thumbnail_get_system(ozone->thumbnail_path_data, &system)) task_push_pl_entry_thumbnail_download(system, - playlist_get_cached(), menu_navigation_get_selection(), + playlist_get_cached(), (unsigned)menu_navigation_get_selection(), false, true); } } @@ -1554,8 +1554,8 @@ static void ozone_frame(void *data, video_frame_info_t *video_info) /* Current list */ ozone_draw_entries(ozone, video_info, - ozone->selection, - ozone->selection_old, + (unsigned)ozone->selection, + (unsigned)ozone->selection_old, menu_entries_get_selection_buf_ptr(0), ozone->animations.list_alpha, ozone->animations.scroll_y, @@ -1566,8 +1566,8 @@ static void ozone_frame(void *data, video_frame_info_t *video_info) if (ozone->draw_old_list) ozone_draw_entries(ozone, video_info, - ozone->selection_old_list, - ozone->selection_old_list, + (unsigned)ozone->selection_old_list, + (unsigned)ozone->selection_old_list, ozone->selection_buf_old, ozone->animations.list_alpha, ozone->scroll_old, @@ -1814,7 +1814,7 @@ static int ozone_menu_iterate(menu_handle_t *menu, void *userdata, enum menu_act return generic_menu_iterate(menu, userdata, action); if (ozone->horizontal_list) - horizontal_list_size = ozone->horizontal_list->size; + horizontal_list_size = (unsigned)ozone->horizontal_list->size; ozone->messagebox_state = false || menu_input_dialog_get_display_kb(); @@ -1831,7 +1831,7 @@ static int ozone_menu_iterate(menu_handle_t *menu, void *userdata, enum menu_act break; tag = (uintptr_t)ozone; - new_selection = (ozone->categories_selection_ptr + 1); + new_selection = (int)(ozone->categories_selection_ptr + 1); if (new_selection >= (int)(ozone->system_tab_end + horizontal_list_size + 1)) new_selection = 0; @@ -1846,7 +1846,7 @@ static int ozone_menu_iterate(menu_handle_t *menu, void *userdata, enum menu_act break; tag = (uintptr_t)ozone; - new_selection = ozone->categories_selection_ptr - 1; + new_selection = (int)ozone->categories_selection_ptr - 1; if (new_selection < 0) new_selection = horizontal_list_size + ozone->system_tab_end; diff --git a/menu/drivers/ozone/ozone_display.c b/menu/drivers/ozone/ozone_display.c index 3f0f7b2047..2fa8948132 100644 --- a/menu/drivers/ozone/ozone_display.c +++ b/menu/drivers/ozone/ozone_display.c @@ -128,7 +128,7 @@ static void ozone_draw_cursor_slice(ozone_handle_t *ozone, menu_display_draw_texture_slice( video_info, x_offset - 14, - y + 8, + (int)(y + 8), 80, 80, width + 3 + 28 - 4, height + 20, @@ -142,7 +142,7 @@ static void ozone_draw_cursor_slice(ozone_handle_t *ozone, menu_display_draw_texture_slice( video_info, x_offset - 14, - y + 8, + (int)(y + 8), 80, 80, width + 3 + 28 - 4, height + 20, diff --git a/menu/drivers/ozone/ozone_sidebar.c b/menu/drivers/ozone/ozone_sidebar.c index 760efb511e..d73844e72e 100644 --- a/menu/drivers/ozone/ozone_sidebar.c +++ b/menu/drivers/ozone/ozone_sidebar.c @@ -126,7 +126,7 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info) return; if (ozone->horizontal_list) - horizontal_list_size = ozone->horizontal_list->size; + horizontal_list_size = (unsigned)ozone->horizontal_list->size; menu_display_scissor_begin(video_info, 0, ozone->dimensions.header_height, (unsigned) ozone->dimensions.sidebar_width, video_info->height - ozone->dimensions.header_height - ozone->dimensions.footer_height); diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index f555edc5bf..fff2c55129 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -3346,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 = (unsigned)(term_end_x - (powerstate_len * FONT_WIDTH_STRIDE)); /* Draw symbol */ blit_symbol(fb_width, powerstate_x, title_y, powerstate_symbol, @@ -4295,7 +4295,7 @@ static void rgui_load_current_thumbnails(rgui_t *rgui, bool download_missing) if (menu_thumbnail_get_system(rgui->thumbnail_path_data, &system)) task_push_pl_entry_thumbnail_download(system, - playlist_get_cached(), menu_navigation_get_selection(), + playlist_get_cached(), (unsigned)menu_navigation_get_selection(), false, true); } #endif diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index aac37d713d..b6ad6c7ee6 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -1068,7 +1068,7 @@ static void xmb_update_thumbnail_image(void *data) if (menu_thumbnail_get_system(xmb->thumbnail_path_data, &system)) task_push_pl_entry_thumbnail_download(system, - playlist_get_cached(), menu_navigation_get_selection(), + playlist_get_cached(), (unsigned)menu_navigation_get_selection(), false, true); } } diff --git a/menu/widgets/menu_widgets.c b/menu/widgets/menu_widgets.c index 35348401fd..f924df3e57 100644 --- a/menu/widgets/menu_widgets.c +++ b/menu/widgets/menu_widgets.c @@ -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 = (unsigned)(current_msgs->size - msg_queue_tasks_count); file_list_insert(current_msgs, NULL, NULL, @@ -879,7 +879,7 @@ void menu_widgets_iterate(void) if (msg->expired && !widgets_moving) { - menu_widgets_msg_queue_kill(i); + menu_widgets_msg_queue_kill((unsigned)i); break; } } @@ -1650,7 +1650,7 @@ void menu_widgets_frame(video_frame_info_t *video_info) { const char *text = *menu_widgets_fps_text == '\0' ? "n/a" : menu_widgets_fps_text; - int text_width = font_driver_get_message_width(font_regular, text, strlen(text), 1.0f); + int text_width = font_driver_get_message_width(font_regular, text, (unsigned)strlen(text), 1.0f); int total_width = text_width + simple_widget_padding * 2; menu_display_set_alpha(menu_widgets_backdrop_orig, DEFAULT_BACKDROP); @@ -2441,7 +2441,7 @@ bool menu_widgets_set_libretro_message(const char *msg, unsigned duration) menu_timer_start(&libretro_message_timer, &timer); /* Compute text width */ - libretro_message_width = font_driver_get_message_width(font_regular, msg, strlen(msg), 1) + simple_widget_padding * 2; + libretro_message_width = font_driver_get_message_width(font_regular, msg, (unsigned)strlen(msg), 1) + simple_widget_padding * 2; return true; }