Skip to content

Commit

Permalink
Try to prevent truckload of warnings on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Feb 26, 2017
1 parent 8f01bcf commit b7b3b2c
Show file tree
Hide file tree
Showing 85 changed files with 277 additions and 267 deletions.
12 changes: 6 additions & 6 deletions audio/audio_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static void compute_audio_buffer_statistics(void)
unsigned low_water_count = 0;
unsigned high_water_count = 0;
unsigned samples = MIN(
audio_driver_free_samples_count,
(unsigned)audio_driver_free_samples_count,
AUDIO_BUFFER_FREE_SAMPLES_COUNT);

if (samples < 3)
Expand All @@ -175,7 +175,7 @@ static void compute_audio_buffer_statistics(void)
for (i = 1; i < samples; i++)
accum += audio_driver_free_samples_buf[i];

avg = accum / (samples - 1);
avg = (unsigned)accum / (samples - 1);

for (i = 1; i < samples; i++)
{
Expand Down Expand Up @@ -576,9 +576,9 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
/* Readjust the audio input rate. */
unsigned write_idx = audio_driver_free_samples_count++ &
(AUDIO_BUFFER_FREE_SAMPLES_COUNT - 1);
int half_size = audio_driver_buffer_size / 2;
int half_size = (int)(audio_driver_buffer_size / 2);
int avail =
current_audio->write_avail(audio_driver_context_audio_data);
(int)current_audio->write_avail(audio_driver_context_audio_data);
int delta_mid = avail - half_size;
double direction = (double)delta_mid / half_size;
double adjust = 1.0 + settings->audio.rate_control_delta * direction;
Expand Down Expand Up @@ -611,7 +611,7 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
performance_counter_stop_plus(is_perfcnt_enable, resampler_proc);

output_data = audio_driver_output_samples_buf;
output_frames = src_data.output_frames;
output_frames = (unsigned)src_data.output_frames;

if (!audio_driver_use_float)
{
Expand Down Expand Up @@ -817,7 +817,7 @@ bool audio_driver_find_driver(void)

driver_ctl(RARCH_DRIVER_CTL_FIND_INDEX, &drv);

i = drv.len;
i = (int)drv.len;

if (i >= 0)
current_audio = (const audio_driver_t*)audio_driver_find_handle(i);
Expand Down
4 changes: 2 additions & 2 deletions audio/audio_mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ audio_mixer_sound_t* audio_mixer_load_wav(const char* path)
}

sound->type = AUDIO_MIXER_TYPE_WAV;
sound->types.wav.frames = samples / 2;
sound->types.wav.frames = (unsigned)(samples / 2);
sound->types.wav.pcm = pcm;

rwav_free(&wav);
Expand Down Expand Up @@ -447,7 +447,7 @@ void audio_mixer_stop(audio_mixer_voice_t* voice)
static void mix_wav(float* buffer, size_t num_frames, audio_mixer_voice_t* voice)
{
int i;
unsigned buf_free = num_frames * 2;
unsigned buf_free = (unsigned)(num_frames * 2);
const audio_mixer_sound_t* sound = voice->sound;
unsigned pcm_available = sound->types.wav.frames
* 2 - voice->types.wav.position;
Expand Down
2 changes: 1 addition & 1 deletion camera/camera_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)

driver_ctl(RARCH_DRIVER_CTL_FIND_INDEX, &drv);

i = drv.len;
i = (int)drv.len;

if (i >= 0)
camera_driver = (const camera_driver_t*)camera_driver_find_handle(i);
Expand Down
16 changes: 8 additions & 8 deletions cheevos/cheevos.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,8 +979,8 @@ static unsigned cheevos_read_hits(const char **memaddr)

if (*str == '(' || *str == '.')
{
num_hits = strtol(str + 1, &end, 10);
str = end + 1;
num_hits = (unsigned)strtol(str + 1, &end, 10);
str = end + 1;
}

*memaddr = str;
Expand Down Expand Up @@ -1109,8 +1109,8 @@ void cheevos_parse_guest_addr(cheevos_var_t *var, unsigned value)
{
if (((desc->core.start ^ var->value) & desc->core.select) == 0)
{
var->bank_id = desc - system->mmaps.descriptors;
var->value = cheevos_reduce(
var->bank_id = (int)(desc - system->mmaps.descriptors);
var->value = (unsigned)cheevos_reduce(
(var->value - desc->core.start) & desc->disconnect_mask,
desc->core.disconnect);

Expand Down Expand Up @@ -1505,12 +1505,12 @@ static int cheevos_new_cheevo(cheevos_readud_t *ud)
else
cheevo = cheevos_locals.unofficial.cheevos + ud->unofficial_count++;

cheevo->id = strtol(ud->id.string, NULL, 10);
cheevo->id = (unsigned)strtol(ud->id.string, NULL, 10);
cheevo->title = cheevos_dupstr(&ud->title);
cheevo->description = cheevos_dupstr(&ud->desc);
cheevo->author = cheevos_dupstr(&ud->author);
cheevo->badge = cheevos_dupstr(&ud->badge);
cheevo->points = strtol(ud->points.string, NULL, 10);
cheevo->points = (unsigned)strtol(ud->points.string, NULL, 10);
cheevo->dirty = 0;
cheevo->active = CHEEVOS_ACTIVE_SOFTCORE | CHEEVOS_ACTIVE_HARDCORE;
cheevo->last = 1;
Expand Down Expand Up @@ -1669,7 +1669,7 @@ static int cheevos_read__json_number(void *userdata,
}
else if (ud->is_console_id)
{
cheevos_locals.console_id = strtol(number, NULL, 10);
cheevos_locals.console_id = (int)strtol(number, NULL, 10);
ud->is_console_id = 0;
}

Expand Down Expand Up @@ -2498,7 +2498,7 @@ static unsigned cheevos_get_game_id(unsigned char *hash, retro_time_t *timeout)
if (!res)
{
RARCH_LOG("CHEEVOS got game id %s.\n", game_id);
return strtoul(game_id, NULL, 10);
return (unsigned)strtoul(game_id, NULL, 10);
}
}

Expand Down
4 changes: 2 additions & 2 deletions command.c
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@ static void command_event_set_savestate_auto_index(void)
while ((end > dir_elem) && isdigit((int)end[-1]))
end--;

idx = strtoul(end, NULL, 0);
idx = (unsigned)strtoul(end, NULL, 0);
if (idx > max_idx)
max_idx = idx;
}
Expand Down Expand Up @@ -2046,7 +2046,7 @@ bool command_event(enum event_command cmd, void *data)
#endif
{
if (settings->rewind_enable)
state_manager_event_init(settings->rewind_buffer_size);
state_manager_event_init((unsigned)settings->rewind_buffer_size);
}
}
break;
Expand Down
2 changes: 1 addition & 1 deletion configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -2668,7 +2668,7 @@ static void save_keybind_hat(config_file_t *conf, const char *key,
const struct retro_keybind *bind)
{
char config[16];
unsigned hat = GET_HAT(bind->joykey);
unsigned hat = (unsigned)GET_HAT(bind->joykey);
const char *dir = NULL;

config[0] = '\0';
Expand Down
4 changes: 2 additions & 2 deletions cores/libretro-imageviewer/image_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,8 @@ void IMAGE_CORE_PREFIX(retro_run)(void)
}
else if (last_image)
{
image_index = file_list->size - 1;
load_image = true;
image_index = (int)(file_list->size - 1);
load_image = true;
}

if (load_image)
Expand Down
28 changes: 14 additions & 14 deletions database_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,52 +293,52 @@ static int database_cursor_iterate(libretrodb_cursor_t *cur,
break;
case DB_CURSOR_CERO_RATING:
if (!string_is_empty(val_string))
db_info->cero_rating = strdup(val_string);
db_info->cero_rating = strdup(val_string);
break;
case DB_CURSOR_PEGI_RATING:
if (!string_is_empty(val_string))
db_info->pegi_rating = strdup(val_string);
db_info->pegi_rating = strdup(val_string);
break;
case DB_CURSOR_ENHANCEMENT_HW:
if (!string_is_empty(val_string))
db_info->enhancement_hw = strdup(val_string);
db_info->enhancement_hw = strdup(val_string);
break;
case DB_CURSOR_EDGE_MAGAZINE_REVIEW:
if (!string_is_empty(val_string))
db_info->edge_magazine_review = strdup(val_string);
break;
case DB_CURSOR_EDGE_MAGAZINE_RATING:
db_info->edge_magazine_rating = val->val.uint_;
db_info->edge_magazine_rating = (unsigned)val->val.uint_;
break;
case DB_CURSOR_EDGE_MAGAZINE_ISSUE:
db_info->edge_magazine_issue = val->val.uint_;
db_info->edge_magazine_issue = (unsigned)val->val.uint_;
break;
case DB_CURSOR_FAMITSU_MAGAZINE_RATING:
db_info->famitsu_magazine_rating = val->val.uint_;
db_info->famitsu_magazine_rating = (unsigned)val->val.uint_;
break;
case DB_CURSOR_TGDB_RATING:
db_info->tgdb_rating = val->val.uint_;
db_info->tgdb_rating = (unsigned)val->val.uint_;
break;
case DB_CURSOR_MAX_USERS:
db_info->max_users = val->val.uint_;
db_info->max_users = (unsigned)val->val.uint_;
break;
case DB_CURSOR_RELEASEDATE_MONTH:
db_info->releasemonth = val->val.uint_;
db_info->releasemonth = val->val.uint_;
break;
case DB_CURSOR_RELEASEDATE_YEAR:
db_info->releaseyear = val->val.uint_;
db_info->releaseyear = (unsigned)val->val.uint_;
break;
case DB_CURSOR_RUMBLE_SUPPORTED:
db_info->rumble_supported = val->val.uint_;
db_info->rumble_supported = (int)val->val.uint_;
break;
case DB_CURSOR_COOP_SUPPORTED:
db_info->coop_supported = val->val.uint_;
db_info->coop_supported = (int)val->val.uint_;
break;
case DB_CURSOR_ANALOG_SUPPORTED:
db_info->analog_supported = val->val.uint_;
db_info->analog_supported = (int)val->val.uint_;
break;
case DB_CURSOR_SIZE:
db_info->size = val->val.uint_;
db_info->size = (unsigned)val->val.uint_;
break;
case DB_CURSOR_CHECKSUM_CRC32:
db_info->crc32 = swap_if_little32(*(uint32_t*)val->val.binary.buff);
Expand Down
5 changes: 2 additions & 3 deletions deps/miniupnpc/minissdpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,8 @@ requestDevicesFromMiniSSDPD(int s, const char * devtype)
{
unsigned char buffer[256];
unsigned char * p;
unsigned int stsize, l;

stsize = strlen(devtype);
unsigned int l;
unsigned stsize = (unsigned)strlen(devtype);
if(stsize == 8 && 0 == memcmp(devtype, "ssdp:all", 8))
{
buffer[0] = 3; /* request type 3 : everything */
Expand Down
4 changes: 2 additions & 2 deletions deps/miniupnpc/miniwget.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ miniwget3(const char * host,
/* sending the HTTP request */
while(sent < len)
{
n = send(s, buf+sent, len-sent, 0);
n = (int)send(s, buf+sent, len-sent, 0);
if(n < 0)
{
perror("send");
Expand Down Expand Up @@ -546,7 +546,7 @@ parseURL(const char * url,
/* "%25" is just '%' in URL encoding */
if(scope[0] == '2' && scope[1] == '5')
scope += 2; /* skip "25" */
l = p2 - scope;
l = (int)(p2 - scope);
if(l >= IF_NAMESIZE)
l = IF_NAMESIZE - 1;
memcpy(tmp, scope, l);
Expand Down
5 changes: 3 additions & 2 deletions deps/miniupnpc/receivedata.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ receivedata(int socket,
n = recvfrom(socket, data, length, 0,
(struct sockaddr *)&src_addr, &src_addr_len);
#else /* MINIUPNPC_GET_SRC_ADDR */
n = recv(socket, data, length, 0);
n = (int)recv(socket, data, length, 0);
#endif /* MINIUPNPC_GET_SRC_ADDR */
if(n<0) {
if(n<0)
{
PRINT_SOCKET_ERROR("recv");
}
#ifdef MINIUPNPC_GET_SRC_ADDR
Expand Down
20 changes: 10 additions & 10 deletions deps/miniupnpc/upnpcommands.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ UPNP_GetTotalBytesReceived(const char * controlURL,
/*DisplayNameValueList(buffer, bufsize);*/
free(buffer); buffer = NULL;
p = GetValueFromNameValueList(&pdata, "NewTotalBytesReceived");
r = my_atoui(p);
r = (unsigned)my_atoui(p);
ClearNameValueList(&pdata);
return r;
}
Expand All @@ -86,7 +86,7 @@ UPNP_GetTotalPacketsSent(const char * controlURL,
/*DisplayNameValueList(buffer, bufsize);*/
free(buffer); buffer = NULL;
p = GetValueFromNameValueList(&pdata, "NewTotalPacketsSent");
r = my_atoui(p);
r = (unsigned)my_atoui(p);
ClearNameValueList(&pdata);
return r;
}
Expand All @@ -110,7 +110,7 @@ UPNP_GetTotalPacketsReceived(const char * controlURL,
/*DisplayNameValueList(buffer, bufsize);*/
free(buffer); buffer = NULL;
p = GetValueFromNameValueList(&pdata, "NewTotalPacketsReceived");
r = my_atoui(p);
r = (unsigned)my_atoui(p);
ClearNameValueList(&pdata);
return r;
}
Expand Down Expand Up @@ -903,11 +903,11 @@ UPNP_GetFirewallStatus(const char * controlURL,
if(ipa && fe)
ret = UPNPCOMMAND_SUCCESS;
if(fe)
*firewallEnabled = my_atoui(fe);
*firewallEnabled = (int)my_atoui(fe);
/*else
*firewallEnabled = 0;*/
if(ipa)
*inboundPinholeAllowed = my_atoui(ipa);
*inboundPinholeAllowed = (int)my_atoui(ipa);
/*else
*inboundPinholeAllowed = 0;*/
p = GetValueFromNameValueList(&pdata, "errorCode");
Expand Down Expand Up @@ -971,7 +971,7 @@ UPNP_GetOutboundPinholeTimeout(const char * controlURL, const char * servicetype
ret = UPNPCOMMAND_SUCCESS;
p = GetValueFromNameValueList(&pdata, "OutboundPinholeTimeout");
if(p)
*opTimeout = my_atoui(p);
*opTimeout = (int)my_atoui(p);
}
ClearNameValueList(&pdata);
return ret;
Expand Down Expand Up @@ -1175,8 +1175,8 @@ UPNP_CheckPinholeWorking(const char * controlURL, const char * servicetype,
p = GetValueFromNameValueList(&pdata, "IsWorking");
if(p)
{
*isWorking=my_atoui(p);
ret = UPNPCOMMAND_SUCCESS;
*isWorking = (int)my_atoui(p);
ret = UPNPCOMMAND_SUCCESS;
}
else
*isWorking = 0;
Expand Down Expand Up @@ -1222,8 +1222,8 @@ UPNP_GetPinholePackets(const char * controlURL, const char * servicetype,
p = GetValueFromNameValueList(&pdata, "PinholePackets");
if(p)
{
*packets=my_atoui(p);
ret = UPNPCOMMAND_SUCCESS;
*packets = (int)my_atoui(p);
ret = UPNPCOMMAND_SUCCESS;
}

p = GetValueFromNameValueList(&pdata, "errorCode");
Expand Down
4 changes: 2 additions & 2 deletions gfx/drivers/gl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2748,7 +2748,7 @@ static int video_texture_load_wrap_gl_mipmap(void *data)
return 0;
video_texture_load_gl((struct texture_image*)data,
TEXTURE_FILTER_MIPMAP_LINEAR, &id);
return id;
return (int)id;
}

static int video_texture_load_wrap_gl(void *data)
Expand All @@ -2759,7 +2759,7 @@ static int video_texture_load_wrap_gl(void *data)
return 0;
video_texture_load_gl((struct texture_image*)data,
TEXTURE_FILTER_LINEAR, &id);
return id;
return (int)id;
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions gfx/drivers_font/gl_raster_font.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ static void gl_raster_font_render_message(
if (!font->font_driver->get_line_height)
{
gl_raster_font_render_line(font,
msg, strlen(msg), scale, color, pos_x,
msg, (unsigned)strlen(msg), scale, color, pos_x,
pos_y, text_align);
return;
}
Expand All @@ -375,7 +375,7 @@ static void gl_raster_font_render_message(
for (;;)
{
const char *delim = strchr(msg, '\n');
unsigned msg_len = delim ? (delim - msg) : strlen(msg);
unsigned msg_len = delim ? (unsigned)(delim - msg) : (unsigned)strlen(msg);

/* Draw the line */
gl_raster_font_render_line(font,
Expand Down
2 changes: 1 addition & 1 deletion gfx/drivers_font_renderer/coretext.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ static bool coretext_font_renderer_create_atlas(CTFontRef face, ct_font_renderer
{
for (c = 0; c < max_width; c++)
{
unsigned src_idx = r * bytesPerRow + c;
unsigned src_idx = (unsigned)(r * bytesPerRow + c);
unsigned dest_idx =
(r + offset_y) * (CT_ATLAS_COLS * max_width) + (c + offset_x);
uint8_t v = src[src_idx];
Expand Down
Loading

0 comments on commit b7b3b2c

Please sign in to comment.