* Fix signed/unsigned mismatches

* Fix missing IPAddr on MSVC2017 UWP - use ULONG instead since this is
just a typedef
This commit is contained in:
libretroadmin 2022-11-15 00:24:26 +01:00
parent 030c3cba44
commit d5a268a2ac
5 changed files with 22 additions and 26 deletions

View File

@ -306,7 +306,7 @@ static void d3d11_render_overlay(d3d11_video_t *d3d11)
d3d11->context, 0, 1,
&d3d11->samplers[RARCH_FILTER_UNSPEC][RARCH_WRAP_DEFAULT]);
for (i = 0; i < (unsigned)d3d11->overlays.count; i++)
for (i = 0; i < d3d11->overlays.count; i++)
{
d3d11->context->lpVtbl->PSSetShaderResources(
d3d11->context, 0, 1,
@ -495,7 +495,7 @@ static void d3d11_free_shader_preset(d3d11_video_t* d3d11)
if (!d3d11->shader_preset)
return;
for (i = 0; i < d3d11->shader_preset->passes; i++)
for (i = 0; i < (int)d3d11->shader_preset->passes; i++)
{
int j;
@ -520,14 +520,14 @@ static void d3d11_free_shader_preset(d3d11_video_t* d3d11)
memset(d3d11->pass, 0, sizeof(d3d11->pass));
/* only free the history textures here */
for (i = 1; i <= (unsigned)d3d11->shader_preset->history_size; i++)
for (i = 1; i <= d3d11->shader_preset->history_size; i++)
d3d11_release_texture(&d3d11->frame.texture[i]);
memset(
&d3d11->frame.texture[1], 0,
sizeof(d3d11->frame.texture[1]) * d3d11->shader_preset->history_size);
for (i = 0; i < d3d11->shader_preset->luts; i++)
for (i = 0; i < (int)d3d11->shader_preset->luts; i++)
d3d11_release_texture(&d3d11->luts[i]);
memset(d3d11->luts, 0, sizeof(d3d11->luts));
@ -1750,7 +1750,7 @@ static void d3d11_init_render_targets(d3d11_video_t* d3d11, unsigned width, unsi
assert(d3d11->shader_preset);
for (i = 0; i < d3d11->shader_preset->passes; i++)
for (i = 0; i < (int)d3d11->shader_preset->passes; i++)
{
struct video_shader_pass* pass = &d3d11->shader_preset->pass[i];

View File

@ -122,7 +122,7 @@ static void thread_update_driver_state(thread_video_t *thr)
if (thr->driver_data && thr->overlay && thr->overlay->set_alpha)
{
int i;
for (i = 0; i < thr->alpha_mods; i++)
for (i = 0; i < (int)thr->alpha_mods; i++)
thr->overlay->set_alpha(thr->driver_data, i, thr->alpha_mod[i]);
}
thr->flags &= ~THR_FLAG_ALPHA_UPDATE;
@ -263,7 +263,7 @@ static bool video_thread_handle_packet(
{
/* Avoid temporary garbage data. */
int i;
for (i = 0; i < tmp_alpha_mods; i++)
for (i = 0; i < (int)tmp_alpha_mods; i++)
tmp_alpha_mod[i] = 1.0f;
thr->alpha_mods = tmp_alpha_mods;
thr->alpha_mod = tmp_alpha_mod;
@ -649,7 +649,7 @@ static bool video_thread_frame(void *data, const void *frame_,
if (src)
{
int i; /* TODO/FIXME - increment counter never meaningfully used */
for (i = 0; i < height; i++, src += pitch, dst += copy_stride)
for (i = 0; i < (int)height; i++, src += pitch, dst += copy_stride)
memcpy(dst, src, copy_stride);
}

View File

@ -237,7 +237,7 @@ static void rpng_reverse_filter_copy_line_rgb(uint32_t *data,
bpp /= 8;
for (i = 0; i < width; i++)
for (i = 0; i < (int)width; i++)
{
uint32_t r, g, b;
@ -258,7 +258,7 @@ static void rpng_reverse_filter_copy_line_rgba(uint32_t *data,
bpp /= 8;
for (i = 0; i < width; i++)
for (i = 0; i < (int)width; i++)
{
uint32_t r, g, b, a;
r = *decoded;
@ -283,7 +283,7 @@ static void rpng_reverse_filter_copy_line_bw(uint32_t *data,
if (depth == 16)
{
for (i = 0; i < width; i++)
for (i = 0; i < (int)width; i++)
{
uint32_t val = decoded[i << 1];
data[i] = (val * 0x010101) | (0xffu << 24);
@ -295,7 +295,7 @@ static void rpng_reverse_filter_copy_line_bw(uint32_t *data,
mask = (1 << depth) - 1;
bit = 0;
for (i = 0; i < width; i++, bit += depth)
for (i = 0; i < (int)width; i++, bit += depth)
{
unsigned byte = bit >> 3;
unsigned val = decoded[byte] >> (8 - depth - (bit & 7));
@ -335,10 +335,9 @@ static void rpng_reverse_filter_copy_line_plt(uint32_t *data,
{
case 1:
{
unsigned w = width / 8;
int i;
for (i = 0; i < w; i++, decoded++)
unsigned w = width / 8;
for (i = 0; i < (int)w; i++, decoded++)
{
*data++ = palette[(*decoded >> 7) & 1];
*data++ = palette[(*decoded >> 6) & 1];
@ -373,10 +372,9 @@ static void rpng_reverse_filter_copy_line_plt(uint32_t *data,
case 2:
{
unsigned w = width / 4;
int i;
for (i = 0; i < w; i++, decoded++)
unsigned w = width / 4;
for (i = 0; i < (int)w; i++, decoded++)
{
*data++ = palette[(*decoded >> 6) & 3];
*data++ = palette[(*decoded >> 4) & 3];
@ -399,10 +397,9 @@ static void rpng_reverse_filter_copy_line_plt(uint32_t *data,
case 4:
{
unsigned w = width / 2;
int i;
for (i = 0; i < w; i++, decoded++)
unsigned w = width / 2;
for (i = 0; i < (int)w; i++, decoded++)
{
*data++ = palette[*decoded >> 4];
*data++ = palette[*decoded & 0x0f];
@ -416,8 +413,7 @@ static void rpng_reverse_filter_copy_line_plt(uint32_t *data,
case 8:
{
int i;
for (i = 0; i < width; i++, decoded++, data++)
for (i = 0; i < (int)width; i++, decoded++, data++)
*data = palette[*decoded];
}
break;
@ -1086,7 +1082,7 @@ bool rpng_iterate_image(rpng_t *rpng)
buf += 8;
palette = rpng->palette;
for (i = 0; i < chunk_size; i++, buf++, palette++)
for (i = 0; i < (int)chunk_size; i++, buf++, palette++)
*palette = (*palette & 0x00ffffff) | (unsigned)*buf << 24;
}
/* TODO: support colorkey in grayscale and truecolor images */

View File

@ -350,7 +350,7 @@ bool net_ifinfo_best(const char *dst, void *src, bool ipv6)
#ifdef __WINRT__
struct sockaddr_in dst_addr = {0};
#endif
IPAddr dst_ip = inet_addr(dst);
ULONG dst_ip = (ULONG)inet_addr(dst);
if (!src)
return false;

View File

@ -370,7 +370,7 @@ void runloop_log_counters(
struct retro_perf_counter **counters, unsigned num)
{
int i;
for (i = 0; i < num; i++)
for (i = 0; i < (int)num; i++)
{
if (counters[i]->call_cnt)
{