Skip to content

Commit

Permalink
Reduce size of local char variables
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Apr 11, 2021
1 parent 2f0f724 commit d07043f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tasks/task_overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static void task_overlay_load_desc_image(
struct overlay *input_overlay,
unsigned ol_idx, unsigned desc_idx)
{
char overlay_desc_image_key[64];
char overlay_desc_image_key[32];
char image_path[PATH_MAX_LENGTH];
config_file_t *conf = loader->conf;

Expand Down Expand Up @@ -114,9 +114,9 @@ static bool task_overlay_load_desc(
bool normalized, float alpha_mod, float range_mod)
{
float width_mod, height_mod;
char overlay_desc_key[64];
char conf_key[64];
char overlay_desc_normalized_key[64];
char conf_key[32];
char overlay_desc_key[32];
char overlay_desc_normalized_key[32];
char overlay[256];
float tmp_float = 0.0f;
bool tmp_bool = false;
Expand All @@ -129,8 +129,10 @@ static bool task_overlay_load_desc(
const char *box = NULL;
config_file_t *conf = loader->conf;

overlay_desc_key[0] = conf_key[0] =
overlay_desc_normalized_key[0] = overlay[0] = '\0';
overlay_desc_key[0] =
conf_key[0] =
overlay_desc_normalized_key[0] =
overlay[0] = '\0';

snprintf(overlay_desc_key, sizeof(overlay_desc_key),
"overlay%u_desc%u", ol_idx, desc_idx);
Expand Down Expand Up @@ -482,9 +484,9 @@ static void task_overlay_deferred_load(retro_task_t *task)

for (i = 0; i < loader->pos_increment; i++, loader->pos++)
{
char conf_key[32];
char overlay_full_screen_key[32];
char tmp_str[PATH_MAX_LENGTH];
char conf_key[64];
char overlay_full_screen_key[64];
float tmp_float = 0.0;
bool tmp_bool = false;
struct texture_image *texture_img = NULL;
Expand Down

0 comments on commit d07043f

Please sign in to comment.