More C89 build fixes

This commit is contained in:
twinaphex 2015-06-26 19:37:03 +02:00
parent d333bd0f77
commit 8bfea0322f
3 changed files with 13 additions and 10 deletions

View File

@ -199,14 +199,17 @@ void fill_pathname_application_path(char *buf, size_t size)
}
#else
{
*buf = '\0';
pid_t pid = getpid();
char link_path[PATH_MAX_LENGTH] = {0};
/* Linux, BSD and Solaris paths. Not standardized. */
static const char *exts[] = { "exe", "file", "path/a.out" };
char link_path[PATH_MAX_LENGTH] = {0};
*buf = '\0';
pid_t pid = getpid();
/* Linux, BSD and Solaris paths. Not standardized. */
for (i = 0; i < ARRAY_SIZE(exts); i++)
{
ssize_t ret;
snprintf(link_path, sizeof(link_path), "/proc/%u/%s",
(unsigned)pid, exts[i]);
ret = readlink(link_path, buf, size - 1);

View File

@ -191,6 +191,7 @@ void menu_shader_manager_save_preset(
#ifdef HAVE_SHADER_MANAGER
char buffer[PATH_MAX_LENGTH], config_directory[PATH_MAX_LENGTH], preset_path[PATH_MAX_LENGTH];
unsigned d, type = RARCH_SHADER_NONE;
const char *dirs[3] = {0};
config_file_t *conf = NULL;
bool ret = false;
global_t *global = global_get_ptr();
@ -239,11 +240,9 @@ void menu_shader_manager_save_preset(
fill_pathname_basedir(config_directory,
global->config_path, sizeof(config_directory));
const char *dirs[] = {
settings->video.shader_dir,
settings->menu_config_directory,
config_directory,
};
dirs[0] = settings->video.shader_dir;
dirs[1] = settings->menu_config_directory;
dirs[2] = config_directory;
if (!(conf = (config_file_t*)config_file_new(NULL)))
return;

View File

@ -1121,12 +1121,13 @@ int rarch_main_iterate(void)
static retro_input_t last_input = 0;
retro_input_t old_input = last_input;
retro_input_t input = input_keys_pressed();
last_input = input;
driver_t *driver = driver_get_ptr();
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
rarch_system_info_t *system = rarch_system_info_get_ptr();
last_input = input;
if (driver->flushing_input)
driver->flushing_input = (input) ? input_flush(&input) : false;