}
static void context_free_locale(Context *c) {
- int p;
-
- for (p = 0; p < _VARIABLE_LC_MAX; p++)
+ for (LocaleVariable p = 0; p < _VARIABLE_LC_MAX; p++)
c->locale[p] = mfree(c->locale[p]);
}
};
void locale_simplify(char *locale[_VARIABLE_LC_MAX]) {
- int p;
-
- for (p = VARIABLE_LANG+1; p < _VARIABLE_LC_MAX; p++)
+ for (LocaleVariable p = VARIABLE_LANG+1; p < _VARIABLE_LC_MAX; p++)
if (isempty(locale[p]) || streq_ptr(locale[VARIABLE_LANG], locale[p]))
locale[p] = mfree(locale[p]);
}
if (r < 0)
return r;
} else {
- int p;
-
c->locale_mtime = USEC_INFINITY;
context_free_locale(c);
/* Fill in what we got passed from systemd. */
- for (p = 0; p < _VARIABLE_LC_MAX; p++) {
+ for (LocaleVariable p = 0; p < _VARIABLE_LC_MAX; p++) {
const char *name;
name = locale_variable_to_string(p);
int locale_write_data(Context *c, char ***settings) {
_cleanup_strv_free_ char **l = NULL;
struct stat st;
- int r, p;
+ int r;
/* Set values will be returned as strv in *settings on success. */
- for (p = 0; p < _VARIABLE_LC_MAX; p++) {
+ for (LocaleVariable p = 0; p < _VARIABLE_LC_MAX; p++) {
_cleanup_free_ char *t = NULL;
char **u;
const char *name;
static void print_overridden_variables(void) {
_cleanup_(locale_variables_freep) char *variables[_VARIABLE_LC_MAX] = {};
bool print_warning = true;
- LocaleVariable j;
int r;
if (arg_transport != BUS_TRANSPORT_LOCAL)
return;
}
- for (j = 0; j < _VARIABLE_LC_MAX; j++)
+ for (LocaleVariable j = 0; j < _VARIABLE_LC_MAX; j++)
if (variables[j]) {
if (print_warning) {
log_warning("Warning: Settings on kernel command line override system locale settings in /etc/locale.conf.\n"
_cleanup_strv_free_ char **l_set = NULL;
_cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
- size_t c_set, c_unset;
- LocaleVariable p;
+ size_t c_set = 0, c_unset = 0;
int r;
assert(bus);
if (!l_set)
return log_oom();
- for (p = 0, c_set = 0, c_unset = 0; p < _VARIABLE_LC_MAX; p++) {
+ for (LocaleVariable p = 0; p < _VARIABLE_LC_MAX; p++) {
const char *name;
name = locale_variable_to_string(p);
Context *c = userdata;
_cleanup_strv_free_ char **l = NULL;
- int p, q, r;
+ int r;
r = locale_read_data(c, reply);
if (r < 0)
if (!l)
return -ENOMEM;
- for (p = 0, q = 0; p < _VARIABLE_LC_MAX; p++) {
+ for (LocaleVariable p = 0, q = 0; p < _VARIABLE_LC_MAX; p++) {
char *t;
const char *name;