Rename camel case named variables

This commit is contained in:
twinaphex 2019-07-09 16:52:34 +02:00
parent 6ff25fea2b
commit cfd2f8e2af

View File

@ -425,26 +425,26 @@ static char *get_temp_directory_alloc(void)
char *path = NULL; char *path = NULL;
#ifdef _WIN32 #ifdef _WIN32
#ifdef LEGACY_WIN32 #ifdef LEGACY_WIN32
DWORD pathLength = GetTempPath(0, NULL) + 1; DWORD path_length = GetTempPath(0, NULL) + 1;
path = (char*)malloc(pathLength * sizeof(char)); path = (char*)malloc(path_length * sizeof(char));
if (!path) if (!path)
return NULL; return NULL;
path[pathLength - 1] = 0; path[path_length - 1] = 0;
GetTempPath(pathLength, path); GetTempPath(path_length, path);
#else #else
DWORD pathLength = GetTempPathW(0, NULL) + 1; DWORD path_length = GetTempPathW(0, NULL) + 1;
wchar_t *wideStr = (wchar_t*)malloc(pathLength * sizeof(wchar_t)); wchar_t *wide_str = (wchar_t*)malloc(path_length * sizeof(wchar_t));
if (!wideStr) if (!wide_str)
return NULL; return NULL;
wideStr[pathLength - 1] = 0; wide_str[path_length - 1] = 0;
GetTempPathW(pathLength, wideStr); GetTempPathW(path_length, wide_str);
path = utf16_to_utf8_string_alloc(wideStr); path = utf16_to_utf8_string_alloc(wide_str);
free(wideStr); free(wide_str);
#endif #endif
#elif defined ANDROID #elif defined ANDROID
{ {
@ -461,8 +461,8 @@ static char *get_temp_directory_alloc(void)
return path; return path;
} }
static bool write_file_with_random_name(char **tempDllPath, static bool write_file_with_random_name(char **temp_dll_path,
const char *retroarchTempPath, const void* data, ssize_t dataSize) const char *retroarch_temp_path, const void* data, ssize_t dataSize)
{ {
unsigned i; unsigned i;
char number_buf[32]; char number_buf[32];
@ -471,7 +471,7 @@ static bool write_file_with_random_name(char **tempDllPath,
time_t time_value = time(NULL); time_t time_value = time(NULL);
unsigned number_value = (unsigned)time_value; unsigned number_value = (unsigned)time_value;
char *ext = strcpy_alloc_force( char *ext = strcpy_alloc_force(
path_get_extension(*tempDllPath)); path_get_extension(*temp_dll_path));
int ext_len = (int)strlen(ext); int ext_len = (int)strlen(ext);
if (ext_len > 0) if (ext_len > 0)
@ -491,14 +491,16 @@ static bool write_file_with_random_name(char **tempDllPath,
snprintf(number_buf, sizeof(number_buf), "%05d", number); snprintf(number_buf, sizeof(number_buf), "%05d", number);
if (*tempDllPath) if (*temp_dll_path)
free(*tempDllPath); free(*temp_dll_path);
*tempDllPath = NULL; *temp_dll_path = NULL;
strcat_alloc(tempDllPath, retroarchTempPath);
strcat_alloc(tempDllPath, prefix); strcat_alloc(temp_dll_path, retroarch_temp_path);
strcat_alloc(tempDllPath, number_buf); strcat_alloc(temp_dll_path, prefix);
strcat_alloc(tempDllPath, ext); strcat_alloc(temp_dll_path, number_buf);
if (filestream_write_file(*tempDllPath, data, dataSize)) strcat_alloc(temp_dll_path, ext);
if (filestream_write_file(*temp_dll_path, data, dataSize))
{ {
okay = true; okay = true;
break; break;
@ -513,75 +515,75 @@ static bool write_file_with_random_name(char **tempDllPath,
static char *copy_core_to_temp_file(void) static char *copy_core_to_temp_file(void)
{ {
bool failed = false; bool failed = false;
char *tempDirectory = NULL; char *temp_directory = NULL;
char *retroarchTempPath = NULL; char *retroarch_temp_path = NULL;
char *tempDllPath = NULL; char *temp_dll_path = NULL;
void *dllFileData = NULL; void *dll_file_data = NULL;
int64_t dllFileSize = 0; int64_t dll_file_size = 0;
const char *corePath = path_get(RARCH_PATH_CORE); const char *core_path = path_get(RARCH_PATH_CORE);
const char *coreBaseName = path_basename(corePath); const char *core_base_name = path_basename(core_path);
if (strlen(coreBaseName) == 0) if (strlen(core_base_name) == 0)
{ {
failed = true; failed = true;
goto end; goto end;
} }
tempDirectory = get_temp_directory_alloc(); temp_directory = get_temp_directory_alloc();
if (!tempDirectory) if (!temp_directory)
{ {
failed = true; failed = true;
goto end; goto end;
} }
strcat_alloc(&retroarchTempPath, tempDirectory); strcat_alloc(&retroarch_temp_path, temp_directory);
strcat_alloc(&retroarchTempPath, path_default_slash()); strcat_alloc(&retroarch_temp_path, path_default_slash());
strcat_alloc(&retroarchTempPath, "retroarch_temp"); strcat_alloc(&retroarch_temp_path, "retroarch_temp");
strcat_alloc(&retroarchTempPath, path_default_slash()); strcat_alloc(&retroarch_temp_path, path_default_slash());
if (!path_mkdir(retroarchTempPath)) if (!path_mkdir(retroarch_temp_path))
{ {
failed = true; failed = true;
goto end; goto end;
} }
if (!filestream_read_file(corePath, &dllFileData, &dllFileSize)) if (!filestream_read_file(core_path, &dll_file_data, &dll_file_size))
{ {
failed = true; failed = true;
goto end; goto end;
} }
strcat_alloc(&tempDllPath, retroarchTempPath); strcat_alloc(&temp_dll_path, retroarch_temp_path);
strcat_alloc(&tempDllPath, coreBaseName); strcat_alloc(&temp_dll_path, core_base_name);
if (!filestream_write_file(tempDllPath, dllFileData, dllFileSize)) if (!filestream_write_file(temp_dll_path, dll_file_data, dll_file_size))
{ {
/* try other file names */ /* try other file names */
if (!write_file_with_random_name(&tempDllPath, if (!write_file_with_random_name(&temp_dll_path,
retroarchTempPath, dllFileData, dllFileSize)) retroarch_temp_path, dll_file_data, dll_file_size))
failed = true; failed = true;
} }
end: end:
if (tempDirectory) if (temp_directory)
free(tempDirectory); free(temp_directory);
if (retroarchTempPath) if (retroarch_temp_path)
free(retroarchTempPath); free(retroarch_temp_path);
if (dllFileData) if (dll_file_data)
free(dllFileData); free(dll_file_data);
tempDirectory = NULL; temp_directory = NULL;
retroarchTempPath = NULL; retroarch_temp_path = NULL;
dllFileData = NULL; dll_file_data = NULL;
if (!failed) if (!failed)
return tempDllPath; return temp_dll_path;
if (tempDllPath) if (temp_dll_path)
free(tempDllPath); free(temp_dll_path);
tempDllPath = NULL; temp_dll_path = NULL;
return NULL; return NULL;
} }
@ -13835,8 +13837,8 @@ static bool runahead_core_run_use_last_input(void)
current_core.retro_run(); current_core.retro_run();
retro_ctx.poll_cb = old_poll_function; retro_ctx.poll_cb = old_poll_function;
retro_ctx.state_cb = old_input_function; retro_ctx.state_cb = old_input_function;
current_core.retro_set_input_poll(retro_ctx.poll_cb); current_core.retro_set_input_poll(retro_ctx.poll_cb);
current_core.retro_set_input_state(retro_ctx.state_cb); current_core.retro_set_input_state(retro_ctx.state_cb);
@ -14033,7 +14035,8 @@ void rarch_core_runtime_tick(void)
static void update_runtime_log(bool log_per_core) static void update_runtime_log(bool log_per_core)
{ {
/* Initialise runtime log file */ /* Initialise runtime log file */
runtime_log_t *runtime_log = runtime_log_init(runtime_content_path, runtime_core_path, log_per_core); runtime_log_t *runtime_log = runtime_log_init(
runtime_content_path, runtime_core_path, log_per_core);
if (!runtime_log) if (!runtime_log)
return; return;