mirror of
https://github.com/libretro/RetroArch.git
synced 2025-04-02 10:51:52 -04:00
Remove string_concat
This commit is contained in:
parent
3853d89f13
commit
74388d8490
12 changed files with 25 additions and 32 deletions
|
@ -71,13 +71,13 @@ static void core_info_list_resolve_all_extensions(
|
|||
|
||||
strlcat(core_info_list->all_ext,
|
||||
core_info_list->list[i].supported_extensions, all_ext_len);
|
||||
string_concat(core_info_list->all_ext, "|");
|
||||
strlcat(core_info_list->all_ext, "|", all_ext_len);
|
||||
}
|
||||
#ifdef HAVE_7ZIP
|
||||
string_concat(core_info_list->all_ext, "7z|");
|
||||
strlcat(core_info_list->all_ext, "7z|", all_ext_len);
|
||||
#endif
|
||||
#ifdef HAVE_ZLIB
|
||||
string_concat(core_info_list->all_ext, "zip|");
|
||||
strlcat(core_info_list->all_ext, "zip|", ext_len);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -311,16 +311,16 @@ void dxgi_update_title(video_frame_info_t* video_info)
|
|||
if (settings->bools.video_memory_show)
|
||||
{
|
||||
#ifndef __WINRT__
|
||||
uint64_t mem_bytes_used = frontend_driver_get_used_memory();
|
||||
uint64_t mem_bytes_total = frontend_driver_get_total_memory();
|
||||
char mem[128];
|
||||
uint64_t mem_bytes_used = frontend_driver_get_used_memory();
|
||||
uint64_t mem_bytes_total = frontend_driver_get_total_memory();
|
||||
|
||||
mem[0] = '\0';
|
||||
|
||||
snprintf(
|
||||
mem, sizeof(mem), " || MEM: %.2f/%.2fMB", mem_bytes_used / (1024.0f * 1024.0f),
|
||||
mem_bytes_total / (1024.0f * 1024.0f));
|
||||
string_concat(video_info->fps_text, mem);
|
||||
strlcat(video_info->fps_text, mem, sizeof(video_info->fps-text));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -497,7 +497,7 @@ static void gfx_ctx_wgl_update_title(void *data, void *data2)
|
|||
snprintf(
|
||||
mem, sizeof(mem), " || MEM: %.2f/%.2fMB", mem_bytes_used / (1024.0f * 1024.0f),
|
||||
mem_bytes_total / (1024.0f * 1024.0f));
|
||||
string_concat(video_info->fps_text, mem);
|
||||
strlcat(video_info->fps_text, mem, sizeof(video_info->fps_text));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -977,7 +977,7 @@ static void *gl_glsl_init(void *data, const char *path)
|
|||
|
||||
snprintf(define, sizeof(define), "#define %s_ALIAS\n",
|
||||
glsl->shader->pass[i].alias);
|
||||
string_concat(glsl->alias_define, define);
|
||||
strlcat(glsl->alias_define, define, sizeof(glsl->alias_define));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2152,7 +2152,8 @@ void video_driver_set_title_buf(void)
|
|||
" ",
|
||||
info.library_name,
|
||||
sizeof(video_driver_title_buf));
|
||||
string_concat(video_driver_title_buf, " ");
|
||||
strlcat(video_driver_title_buf, " ",
|
||||
sizeof(video_driver_title_buf));
|
||||
strlcat(video_driver_title_buf, info.library_version,
|
||||
sizeof(video_driver_title_buf));
|
||||
}
|
||||
|
@ -2323,7 +2324,7 @@ void video_driver_frame(const void *data, unsigned width,
|
|||
snprintf(video_info.fps_text, sizeof(video_info.fps_text),
|
||||
"FPS: %6.1f", last_fps);
|
||||
if (video_info.framecount_show)
|
||||
string_concat(video_info.fps_text, " || ");
|
||||
strlcat(video_info.fps_text, " || ", sizeof(video_info.fps_text));
|
||||
}
|
||||
|
||||
if (video_info.framecount_show)
|
||||
|
@ -2333,7 +2334,7 @@ void video_driver_frame(const void *data, unsigned width,
|
|||
sizeof(frames_text),
|
||||
"%s: %" PRIu64, msg_hash_to_str(MSG_FRAMES),
|
||||
(uint64_t)video_driver_frame_count);
|
||||
string_concat(video_info.fps_text, frames_text);
|
||||
strlcat(video_info.fps_text, frames_text, sizeof(video_info.fps_text));
|
||||
}
|
||||
|
||||
if ((video_driver_frame_count % FPS_UPDATE_INTERVAL) == 0)
|
||||
|
@ -2344,9 +2345,9 @@ void video_driver_frame(const void *data, unsigned width,
|
|||
|
||||
if (!string_is_empty(video_info.fps_text))
|
||||
{
|
||||
string_concat(video_driver_window_title, "|| ");
|
||||
string_concat(video_driver_window_title,
|
||||
video_info.fps_text);
|
||||
strlcat(video_driver_window_title, "|| ", sizeof(video_driver_window_title));
|
||||
strlcat(video_driver_window_title,
|
||||
video_info.fps_text, sizeof(video_driver_window_title));
|
||||
}
|
||||
|
||||
curr_time = new_time;
|
||||
|
|
|
@ -1025,7 +1025,7 @@ void video_shader_write_conf_cgp(config_file_t *conf,
|
|||
for (i = 1; i < shader->num_parameters; i++)
|
||||
{
|
||||
/* O(n^2), but number of parameters is very limited. */
|
||||
string_concat(parameters, ";");
|
||||
strlcat(parameters, ";", param_size);
|
||||
strlcat(parameters, shader->parameters[i].id, param_size);
|
||||
}
|
||||
|
||||
|
@ -1052,7 +1052,7 @@ void video_shader_write_conf_cgp(config_file_t *conf,
|
|||
for (i = 1; i < shader->luts; i++)
|
||||
{
|
||||
/* O(n^2), but number of textures is very limited. */
|
||||
string_concat(textures, ";");
|
||||
strlcat(textures, ";", tex_size);
|
||||
strlcat(textures, shader->lut[i].id, tex_size);
|
||||
}
|
||||
|
||||
|
@ -1106,7 +1106,7 @@ void video_shader_write_conf_cgp(config_file_t *conf,
|
|||
|
||||
for (i = 1; i < shader->variables; i++)
|
||||
{
|
||||
string_concat(variables, ";");
|
||||
strlcat(variables, ";", var_tmp);
|
||||
strlcat(variables, shader->variable[i].id, var_tmp);
|
||||
}
|
||||
|
||||
|
|
|
@ -439,7 +439,7 @@ void fill_pathname_slash(char *path, size_t size)
|
|||
join_str[0] = '\0';
|
||||
|
||||
strlcpy(join_str, last_slash, sizeof(join_str));
|
||||
string_concat(path, join_str);
|
||||
strlcat(path, join_str, size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,14 +45,6 @@ static INLINE bool string_is_equal(const char *a, const char *b)
|
|||
return (a && b) ? !strcmp(a, b) : false;
|
||||
}
|
||||
|
||||
static INLINE char *string_concat(char *dst, char *src)
|
||||
{
|
||||
while (*dst)
|
||||
dst++;
|
||||
while ((*(dst)++ = *(src)++));
|
||||
return --dst;
|
||||
}
|
||||
|
||||
#define STRLEN_CONST(x) ((sizeof((x))-1))
|
||||
|
||||
#define string_is_not_equal(a, b) !string_is_equal((a), (b))
|
||||
|
|
|
@ -570,7 +570,7 @@ static int general_push(menu_displaylist_info_t *info,
|
|||
#elif defined(HAVE_MPV)
|
||||
libretro_mpv_retro_get_system_info(&sysinfo);
|
||||
#endif
|
||||
string_concat(newstring2, "|");
|
||||
strlcat(newstring2, "|", PATH_MAX_LENGTH * sizeof(char));
|
||||
strlcat(newstring2, sysinfo.valid_extensions,
|
||||
PATH_MAX_LENGTH * sizeof(char));
|
||||
}
|
||||
|
@ -579,7 +579,7 @@ static int general_push(menu_displaylist_info_t *info,
|
|||
if (settings->bools.multimedia_builtin_imageviewer_enable)
|
||||
{
|
||||
libretro_imageviewer_retro_get_system_info(&sysinfo);
|
||||
string_concat(newstring2, "|");
|
||||
strlcat(newstring2, "|", PATH_MAX_LENGTH * sizeof(char));
|
||||
strlcat(newstring2, sysinfo.valid_extensions,
|
||||
PATH_MAX_LENGTH * sizeof(char));
|
||||
}
|
||||
|
|
|
@ -335,8 +335,8 @@ static int action_get_title_group_settings(const char *path, const char *label,
|
|||
|
||||
if (!string_is_empty(elem1))
|
||||
{
|
||||
string_concat(s, " - ");
|
||||
string_concat(s, elem1);
|
||||
strlcat(s, " - ", len);
|
||||
strlcat(s, elem1, len);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1969,7 +1969,7 @@ static void xmb_context_reset_horizontal_list(
|
|||
|
||||
if (!filestream_exists(content_texturepath))
|
||||
{
|
||||
string_concat(iconpath, "default");
|
||||
strlcat(iconpath, "default", PATH_MAX_LENGTH * sizeof(char));
|
||||
fill_pathname_join_delim(content_texturepath, iconpath,
|
||||
file_path_str(FILE_PATH_CONTENT_BASENAME), '-',
|
||||
PATH_MAX_LENGTH * sizeof(char));
|
||||
|
|
|
@ -680,7 +680,7 @@ bool menu_animation_ticker(menu_animation_ctx_ticker_t *ticker)
|
|||
if (!ticker->selected)
|
||||
{
|
||||
utf8cpy(ticker->s, PATH_MAX_LENGTH, ticker->str, ticker->len - 3);
|
||||
string_concat(ticker->s, "...");
|
||||
strlcat(ticker->s, "...", PATH_MAX_LENGTH);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue