Skip to content

Commit

Permalink
locale.c: Change function to return void
Browse files Browse the repository at this point in the history
It just returns the input value unchanged; this is a no-op.
  • Loading branch information
khwilliamson committed May 12, 2023
1 parent bcb3779 commit 6a327db
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion embed.fnc
Expand Up @@ -4424,7 +4424,7 @@ S |locale_t|use_curlocale_scratch
S |const char *|calculate_LC_ALL_string \
|const locale_t cur_obj
# else
S |const char *|update_PL_curlocales_i \
S |void |update_PL_curlocales_i \
|const unsigned int index \
|NN const char *new_locale \
|recalc_lc_all_t recalc_LC_ALL
Expand Down
16 changes: 7 additions & 9 deletions locale.c
Expand Up @@ -1353,7 +1353,7 @@ S_querylocale_2008_i(pTHX_ const unsigned int index)

# ifdef USE_PL_CURLOCALES

STATIC const char *
STATIC void
S_update_PL_curlocales_i(pTHX_
const unsigned int index,
const char * new_locale,
Expand All @@ -1373,13 +1373,12 @@ S_update_PL_curlocales_i(pTHX_
Safefree(PL_curlocales[i]);
PL_curlocales[i] = savepv(new_locale);
}

return PL_curlocales[LC_ALL_INDEX_];
}
else { /* Not LC_ALL */

/* Update the single category's record */
Safefree(PL_curlocales[index]);
PL_curlocales[index] = savepv(new_locale);
/* Update the single category's record */
Safefree(PL_curlocales[index]);
PL_curlocales[index] = savepv(new_locale);

/* And also LC_ALL if the input says to, including if this is the final
* iteration of a loop updating all sub-categories */
Expand All @@ -1390,8 +1389,7 @@ S_update_PL_curlocales_i(pTHX_
Safefree(PL_curlocales[LC_ALL_INDEX_]);
PL_curlocales[LC_ALL_INDEX_]= savepv(calculate_LC_ALL_string(PL_curlocales));
}

return PL_curlocales[index];
}
}

# endif /* Need PL_curlocales[] */
Expand Down Expand Up @@ -1789,7 +1787,7 @@ S_bool_setlocale_2008_i(pTHX_

# else

new_locale = update_PL_curlocales_i(index, new_locale, recalc_LC_ALL);
update_PL_curlocales_i(index, new_locale, recalc_LC_ALL);

# endif
# ifdef HAS_GLIBC_LC_MESSAGES_BUG
Expand Down
2 changes: 1 addition & 1 deletion proto.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6a327db

Please sign in to comment.