mirror of
git://sourceware.org/git/lvm2.git
synced 2024-10-04 02:20:23 +03:00
const: use arrays of strings 2
Next set of changes.
This commit is contained in:
parent
0bcf2c6514
commit
e6f46fafe7
@ -2017,7 +2017,7 @@ static void _daemonize(void)
|
||||
static int _reinstate_registrations(struct dm_event_fifos *fifos)
|
||||
{
|
||||
static const char _failed_parsing_msg[] = "Failed to parse existing event registration.\n";
|
||||
static const char *_delim = " ";
|
||||
static const char _delim[] = " ";
|
||||
struct dm_event_daemon_message msg = { 0 };
|
||||
char *endp, *dso_name, *dev_name, *mask, *timeout;
|
||||
unsigned long mask_value, timeout_value;
|
||||
|
@ -140,7 +140,7 @@ static int str_to_mode(const char *str);
|
||||
* the act is passed back to the client_thread to be returned to the client.
|
||||
*/
|
||||
|
||||
static const char *lvmlockd_protocol = "lvmlockd";
|
||||
static const char lvmlockd_protocol[] = "lvmlockd";
|
||||
static const int lvmlockd_protocol_version = 1;
|
||||
static int daemon_quit;
|
||||
static int adopt_opt;
|
||||
|
@ -2842,7 +2842,7 @@ struct time_value {
|
||||
time_t t2;
|
||||
};
|
||||
|
||||
static const char *_out_of_range_msg = "Field selection value %s out of supported range for field %s.";
|
||||
static const char _out_of_range_msg[] = "Field selection value %s out of supported range for field %s.";
|
||||
|
||||
/*
|
||||
* Standard formatted date and time - ISO8601.
|
||||
|
@ -506,10 +506,10 @@ static int _check_config(struct cmd_context *cmd)
|
||||
static const char *_set_time_format(struct cmd_context *cmd)
|
||||
{
|
||||
/* Compared to strftime, we do not allow "newline" character - the %n in format. */
|
||||
static const char *allowed_format_chars = "aAbBcCdDeFGghHIjklmMpPrRsStTuUVwWxXyYzZ%";
|
||||
static const char *allowed_alternative_format_chars_e = "cCxXyY";
|
||||
static const char *allowed_alternative_format_chars_o = "deHImMSuUVwWy";
|
||||
static const char *chars_to_check;
|
||||
static const char _allowed_format_chars[] = "aAbBcCdDeFGghHIjklmMpPrRsStTuUVwWxXyYzZ%";
|
||||
static const char _allowed_alternative_format_chars_e[] = "cCxXyY";
|
||||
static const char _allowed_alternative_format_chars_o[] = "deHImMSuUVwWy";
|
||||
const char *chars_to_check;
|
||||
const char *tf = find_config_tree_str(cmd, report_time_format_CFG, NULL);
|
||||
const char *p_fmt;
|
||||
size_t i;
|
||||
@ -525,12 +525,12 @@ static const char *_set_time_format(struct cmd_context *cmd)
|
||||
c = *++p_fmt;
|
||||
if (c == 'E') {
|
||||
c = *++p_fmt;
|
||||
chars_to_check = allowed_alternative_format_chars_e;
|
||||
chars_to_check = _allowed_alternative_format_chars_e;
|
||||
} else if (c == 'O') {
|
||||
c = *++p_fmt;
|
||||
chars_to_check = allowed_alternative_format_chars_o;
|
||||
chars_to_check = _allowed_alternative_format_chars_o;
|
||||
} else
|
||||
chars_to_check = allowed_format_chars;
|
||||
chars_to_check = _allowed_format_chars;
|
||||
|
||||
for (i = 0; chars_to_check[i]; i++) {
|
||||
if (c == chars_to_check[i])
|
||||
|
@ -45,9 +45,9 @@ static int _using_devices_file;
|
||||
static int _devices_file_locked;
|
||||
static char _devices_lockfile[PATH_MAX];
|
||||
static char _devices_file_version[VERSION_LINE_MAX];
|
||||
static const char *_searched_file = DEFAULT_RUN_DIR "/searched_devnames";
|
||||
static const char *_searched_file_new = DEFAULT_RUN_DIR "/searched_devnames_new";
|
||||
static const char *_searched_file_dir = DEFAULT_RUN_DIR;
|
||||
static const char _searched_file[] = DEFAULT_RUN_DIR "/searched_devnames";
|
||||
static const char _searched_file_new[] = DEFAULT_RUN_DIR "/searched_devnames_new";
|
||||
static const char _searched_file_dir[] = DEFAULT_RUN_DIR;
|
||||
|
||||
/* Only for displaying in lvmdevices command output. */
|
||||
char devices_file_hostname_orig[PATH_MAX];
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "lib/filters/filter.h"
|
||||
#include "lib/activate/activate.h"
|
||||
|
||||
static const char *_too_small_to_hold_pv_msg = "Too small to hold a PV";
|
||||
static const char _too_small_to_hold_pv_msg[] = "Too small to hold a PV";
|
||||
|
||||
static int _check_pv_min_size(struct device *dev)
|
||||
{
|
||||
|
@ -156,9 +156,9 @@
|
||||
#include <sys/file.h>
|
||||
#include <sys/sysmacros.h>
|
||||
|
||||
static const char *_hints_file = DEFAULT_RUN_DIR "/hints";
|
||||
static const char *_nohints_file = DEFAULT_RUN_DIR "/nohints";
|
||||
static const char *_newhints_file = DEFAULT_RUN_DIR "/newhints";
|
||||
static const char _hints_file[] = DEFAULT_RUN_DIR "/hints";
|
||||
static const char _nohints_file[] = DEFAULT_RUN_DIR "/nohints";
|
||||
static const char _newhints_file[] = DEFAULT_RUN_DIR "/newhints";
|
||||
|
||||
/*
|
||||
* Format of hints file. Increase the major number when
|
||||
|
@ -2840,7 +2840,7 @@ struct time_value {
|
||||
time_t t2;
|
||||
};
|
||||
|
||||
static const char *_out_of_range_msg = "Field selection value %s out of supported range for field %s.";
|
||||
static const char _out_of_range_msg[] = "Field selection value %s out of supported range for field %s.";
|
||||
|
||||
/*
|
||||
* Standard formatted date and time - ISO8601.
|
||||
|
Loading…
Reference in New Issue
Block a user