Prevent some more implicit memsets
This commit is contained in:
parent
d1b90a8b6d
commit
584d9a5997
|
@ -128,8 +128,13 @@ static void nk_menu_context_reset_textures(nk_menu_handle_t *nk,
|
||||||
|
|
||||||
for (i = 0; i < NK_TEXTURE_LAST; i++)
|
for (i = 0; i < NK_TEXTURE_LAST; i++)
|
||||||
{
|
{
|
||||||
struct texture_image ti = {0};
|
struct texture_image ti;
|
||||||
char path[PATH_MAX_LENGTH] = {0};
|
char path[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
|
ti.width = 0;
|
||||||
|
ti.height = 0;
|
||||||
|
ti.pixels = NULL;
|
||||||
|
path[0] = '\0';
|
||||||
|
|
||||||
switch(i)
|
switch(i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1450,7 +1450,7 @@ static void xmb_context_reset_horizontal_list(
|
||||||
char sysname[PATH_MAX_LENGTH];
|
char sysname[PATH_MAX_LENGTH];
|
||||||
char texturepath[PATH_MAX_LENGTH];
|
char texturepath[PATH_MAX_LENGTH];
|
||||||
char content_texturepath[PATH_MAX_LENGTH];
|
char content_texturepath[PATH_MAX_LENGTH];
|
||||||
struct texture_image ti = {0};
|
struct texture_image ti;
|
||||||
const char *path = NULL;
|
const char *path = NULL;
|
||||||
xmb_node_t *node =
|
xmb_node_t *node =
|
||||||
xmb_get_userdata_from_horizontal_list(xmb, i);
|
xmb_get_userdata_from_horizontal_list(xmb, i);
|
||||||
|
@ -1483,6 +1483,10 @@ static void xmb_context_reset_horizontal_list(
|
||||||
file_path_str(FILE_PATH_PNG_EXTENSION),
|
file_path_str(FILE_PATH_PNG_EXTENSION),
|
||||||
sizeof(texturepath));
|
sizeof(texturepath));
|
||||||
|
|
||||||
|
ti.width = 0;
|
||||||
|
ti.height = 0;
|
||||||
|
ti.pixels = NULL;
|
||||||
|
|
||||||
if (image_texture_load(&ti, texturepath))
|
if (image_texture_load(&ti, texturepath))
|
||||||
{
|
{
|
||||||
if(ti.pixels)
|
if(ti.pixels)
|
||||||
|
|
|
@ -844,10 +844,16 @@ void menu_display_set_alpha(float *color, float alpha_value)
|
||||||
void menu_display_reset_textures_list(const char *texture_path, const char *iconpath,
|
void menu_display_reset_textures_list(const char *texture_path, const char *iconpath,
|
||||||
uintptr_t *item)
|
uintptr_t *item)
|
||||||
{
|
{
|
||||||
struct texture_image ti = {0};
|
struct texture_image ti;
|
||||||
char path[PATH_MAX_LENGTH] = {0};
|
char path[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
if (texture_path != NULL)
|
path[0] = '\0';
|
||||||
|
|
||||||
|
ti.width = 0;
|
||||||
|
ti.height = 0;
|
||||||
|
ti.pixels = NULL;
|
||||||
|
|
||||||
|
if (!string_is_empty(texture_path))
|
||||||
fill_pathname_join(path, iconpath, texture_path, sizeof(path));
|
fill_pathname_join(path, iconpath, texture_path, sizeof(path));
|
||||||
|
|
||||||
if (string_is_empty(path) || !path_file_exists(path))
|
if (string_is_empty(path) || !path_file_exists(path))
|
||||||
|
|
Loading…
Reference in New Issue