1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-08 12:15:49 +00:00

Revert "Reduce size of variables"

This reverts commit 79f1166c6e.
This commit is contained in:
twinaphex 2017-09-09 00:20:39 +02:00
parent 06ed024f3a
commit c0207e9b56
5 changed files with 35 additions and 51 deletions

View File

@ -187,8 +187,7 @@ static void *audio_driver_context_audio_data = NULL;
**/
static void compute_audio_buffer_statistics(void)
{
uint8_t i;
unsigned low_water_size, high_water_size, avg, stddev;
unsigned i, low_water_size, high_water_size, avg, stddev;
float avg_filled = 0.0f;
float deviation = 0.0f;
uint64_t accum = 0;
@ -811,7 +810,7 @@ void audio_driver_monitor_adjust_system_rates(void)
void audio_driver_setup_rewind(void)
{
uint8_t i;
unsigned i;
/* Push audio ready to be played. */
audio_driver_rewind_ptr = audio_driver_rewind_size;
@ -845,7 +844,7 @@ bool audio_driver_find_driver(void)
current_audio = (const audio_driver_t*)audio_driver_find_handle(i);
else
{
uint8_t d;
unsigned d;
RARCH_ERR("Couldn't find any audio driver named \"%s\"\n",
settings->arrays.audio_driver);
RARCH_LOG_OUTPUT("Available audio drivers are:\n");
@ -910,7 +909,7 @@ bool audio_driver_get_devices_list(void **data)
bool audio_driver_mixer_extension_supported(const char *ext)
{
union string_list_elem_attr attr;
uint8_t i;
unsigned i;
bool ret = false;
struct string_list *str_list = string_list_new();
@ -943,7 +942,7 @@ bool audio_driver_mixer_extension_supported(const char *ext)
static int audio_mixer_find_index(audio_mixer_sound_t *sound)
{
uint8_t i;
unsigned i;
for (i = 0; i < AUDIO_MIXER_MAX_STREAMS; i++)
{
@ -1092,7 +1091,7 @@ static void audio_driver_mixer_remove_stream(unsigned i)
static void audio_driver_mixer_deinit(void)
{
uint8_t i;
unsigned i;
audio_set_bool(AUDIO_ACTION_MIXER, false);

View File

@ -145,7 +145,7 @@ static const void *find_driver_nonempty(const char *label, int i,
**/
static int driver_find_index(const char * label, const char *drv)
{
uint8_t i;
unsigned i;
char str[256];
str[0] = '\0';
@ -178,7 +178,7 @@ static bool driver_find_first(const char *label, char *s, size_t len)
**/
static bool driver_find_last(const char *label, char *s, size_t len)
{
uint8_t i;
unsigned i;
for (i = 0;
find_driver_nonempty(label, i, s, len) != NULL; i++)
@ -290,11 +290,9 @@ void driver_set_nonblock_state(void)
*
* Returns: true (1) if successful, otherwise false (0).
**/
static bool driver_update_system_av_info(
const struct retro_system_av_info *info)
static bool driver_update_system_av_info(const struct retro_system_av_info *info)
{
struct retro_system_av_info *av_info =
video_viewport_get_system_av_info();
struct retro_system_av_info *av_info = video_viewport_get_system_av_info();
memcpy(av_info, info, sizeof(*av_info));
command_event(CMD_EVENT_REINIT, NULL);
@ -304,8 +302,7 @@ static bool driver_update_system_av_info(
if (recording_driver_get_data_ptr())
{
runloop_msg_queue_push(
msg_hash_to_str(
MSG_RESTARTING_RECORDING_DUE_TO_DRIVER_REINIT),
msg_hash_to_str(MSG_RESTARTING_RECORDING_DUE_TO_DRIVER_REINIT),
2, 180, false);
command_event(CMD_EVENT_RECORD_DEINIT, NULL);
command_event(CMD_EVENT_RECORD_INIT, NULL);
@ -368,13 +365,11 @@ void drivers_init(int flags)
}
/* Only initialize camera driver if we're ever going to use it. */
if ((flags & DRIVER_CAMERA_MASK) &&
camera_driver_ctl(RARCH_CAMERA_CTL_IS_ACTIVE, NULL))
if ((flags & DRIVER_CAMERA_MASK) && camera_driver_ctl(RARCH_CAMERA_CTL_IS_ACTIVE, NULL))
camera_driver_ctl(RARCH_CAMERA_CTL_INIT, NULL);
/* Only initialize location driver if we're ever going to use it. */
if ((flags & DRIVER_LOCATION_MASK) &&
location_driver_ctl(RARCH_LOCATION_CTL_IS_ACTIVE, NULL))
if ((flags & DRIVER_LOCATION_MASK) && location_driver_ctl(RARCH_LOCATION_CTL_IS_ACTIVE, NULL))
init_location();
core_info_init_current_core();
@ -407,8 +402,7 @@ void drivers_init(int flags)
**/
/**
* Driver ownership - set this to true if the platform in
* question needs to 'own'
* Driver ownership - set this to true if the platform in question needs to 'own'
* the respective handle and therefore skip regular RetroArch
* driver teardown/reiniting procedure.
*
@ -431,16 +425,13 @@ void driver_uninit(int flags)
menu_driver_ctl(RARCH_MENU_CTL_DEINIT, NULL);
#endif
if ((flags & DRIVER_LOCATION_MASK) &&
!location_driver_ctl(RARCH_LOCATION_CTL_OWNS_DRIVER, NULL))
if ((flags & DRIVER_LOCATION_MASK) && !location_driver_ctl(RARCH_LOCATION_CTL_OWNS_DRIVER, NULL))
location_driver_ctl(RARCH_LOCATION_CTL_DEINIT, NULL);
if ((flags & DRIVER_CAMERA_MASK) &&
!camera_driver_ctl(RARCH_CAMERA_CTL_OWNS_DRIVER, NULL))
if ((flags & DRIVER_CAMERA_MASK) && !camera_driver_ctl(RARCH_CAMERA_CTL_OWNS_DRIVER, NULL))
camera_driver_ctl(RARCH_CAMERA_CTL_DEINIT, NULL);
if ((flags & DRIVER_WIFI_MASK) &&
!wifi_driver_ctl(RARCH_WIFI_CTL_OWNS_DRIVER, NULL))
if ((flags & DRIVER_WIFI_MASK) && !wifi_driver_ctl(RARCH_WIFI_CTL_OWNS_DRIVER, NULL))
wifi_driver_ctl(RARCH_WIFI_CTL_DEINIT, NULL);
if (flags & DRIVERS_VIDEO_INPUT)
@ -496,8 +487,7 @@ bool driver_ctl(enum driver_ctl_state state, void *data)
break;
case RARCH_DRIVER_CTL_UPDATE_SYSTEM_AV_INFO:
{
const struct retro_system_av_info **info
= (const struct retro_system_av_info**)data;
const struct retro_system_av_info **info = (const struct retro_system_av_info**)data;
if (info)
return driver_update_system_av_info(*info);
}

View File

@ -219,7 +219,7 @@ static void gl_overlay_tex_geom(void *data,
static void gl_render_overlay(gl_t *gl, video_frame_info_t *video_info)
{
video_shader_ctx_coords_t coords;
uint8_t i;
unsigned i;
unsigned width = video_info->width;
unsigned height = video_info->height;
@ -563,7 +563,7 @@ static void gl_update_input_size(gl_t *gl, unsigned width,
static void gl_init_textures_data(gl_t *gl)
{
uint8_t i;
unsigned i;
for (i = 0; i < gl->textures; i++)
{
@ -610,7 +610,7 @@ static void gl_init_textures_reference(gl_t *gl, unsigned i,
static void gl_init_textures(gl_t *gl, const video_info_t *video)
{
uint8_t i;
unsigned i;
GLenum internal_fmt, texture_type = 0, texture_fmt = 0;
(void)texture_type;
@ -682,7 +682,8 @@ static INLINE void gl_copy_frame(gl_t *gl,
size_t buffer_stride = gl->tex_w * gl->base_size;
const uint8_t *frame_copy = frame;
size_t frame_copy_size = width * gl->base_size;
uint8_t *buffer = (uint8_t*)glMapBuffer(
uint8_t *buffer = (uint8_t*)glMapBuffer(
GL_TEXTURE_REFERENCE_BUFFER_SCE, GL_READ_WRITE) + buffer_addr;
for (h = 0; h < height; h++, buffer += buffer_stride, frame_copy += pitch)
memcpy(buffer, frame_copy, frame_copy_size);
@ -705,8 +706,7 @@ static INLINE void gl_copy_frame(gl_t *gl,
img_info.rgb32 = (gl->base_size == 4);
img_info.handle = &img;
new_egl =
video_context_driver_write_to_image_buffer(&img_info);
new_egl = video_context_driver_write_to_image_buffer(&img_info);
if (img == EGL_NO_IMAGE_KHR)
{
@ -1036,8 +1036,7 @@ static INLINE void gl_draw_texture(gl_t *gl, video_frame_info_t *video_info)
video_shader_driver_set_coords(coords);
video_info->cb_shader_set_mvp(gl,
video_info->shader_data, &gl->mvp_no_rot);
video_info->cb_shader_set_mvp(gl, video_info->shader_data, &gl->mvp_no_rot);
glEnable(GL_BLEND);
@ -1109,8 +1108,7 @@ static bool gl_frame(void *data, const void *frame,
mode.width = width;
mode.height = height;
video_info->cb_set_resize(video_info->context_data,
mode.width, mode.height);
video_info->cb_set_resize(video_info->context_data, mode.width, mode.height);
#ifdef HAVE_FBO
if (gl->fbo_inited)
@ -1138,10 +1136,8 @@ static bool gl_frame(void *data, const void *frame,
if (!gl->hw_render_fbo_init)
#endif
{
gl_update_input_size(gl, frame_width,
frame_height, pitch, true);
gl_copy_frame(gl, video_info, frame,
frame_width, frame_height, pitch);
gl_update_input_size(gl, frame_width, frame_height, pitch, true);
gl_copy_frame(gl, video_info, frame, frame_width, frame_height, pitch);
}
/* No point regenerating mipmaps
@ -1188,8 +1184,7 @@ static bool gl_frame(void *data, const void *frame,
#ifdef HAVE_FBO
if (gl->fbo_feedback_enable)
{
const struct video_fbo_rect
*rect = &gl->fbo_rect[gl->fbo_feedback_pass];
const struct video_fbo_rect *rect = &gl->fbo_rect[gl->fbo_feedback_pass];
GLfloat xamt = (GLfloat)rect->img_width / rect->width;
GLfloat yamt = (GLfloat)rect->img_height / rect->height;
@ -1366,7 +1361,7 @@ static void gl_free(void *data)
#ifdef HAVE_GL_SYNC
if (gl->have_sync)
{
uint8_t i;
unsigned i;
for (i = 0; i < gl->fence_count; i++)
{
@ -1581,7 +1576,7 @@ static INLINE void gl_set_texture_fmts(gl_t *gl, bool rgb32)
#ifdef HAVE_GL_ASYNC_READBACK
static void gl_init_pbo_readback(gl_t *gl)
{
uint8_t i;
unsigned i;
settings_t *settings = config_get_ptr();
bool *recording_enabled = recording_is_enabled();
#ifndef HAVE_OPENGLES3

View File

@ -1278,7 +1278,7 @@ void video_monitor_set_refresh_rate(float hz)
bool video_monitor_fps_statistics(double *refresh_rate,
double *deviation, unsigned *sample_points)
{
uint8_t i;
unsigned i;
retro_time_t accum = 0, avg, accum_var = 0;
unsigned samples = MIN(MEASURE_FRAME_TIME_SAMPLES_COUNT,
(unsigned)video_driver_frame_time_count);

View File

@ -281,12 +281,12 @@ static void retroarch_msg_queue_init(void)
static void retroarch_override_setting_free_state(void)
{
uint8_t i;
unsigned i;
for (i = 0; i < RARCH_OVERRIDE_SETTING_LAST; i++)
{
if (i == RARCH_OVERRIDE_SETTING_LIBRETRO_DEVICE)
{
uint8_t j;
unsigned j;
for (j = 0; j < MAX_USERS; j++)
retroarch_override_setting_unset((enum rarch_override_setting)(i), &j);
}
@ -1476,7 +1476,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
#endif
retroarch_init_state();
{
uint8_t i;
unsigned i;
for (i = 0; i < MAX_USERS; i++)
input_config_set_device(i, RETRO_DEVICE_JOYPAD);
}