1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-28 02:50:41 +03:00

cleanup: use const

This commit is contained in:
Zdenek Kabelac 2017-02-18 18:50:22 +01:00
parent f16ad760cb
commit aff62c74b7
3 changed files with 5 additions and 5 deletions

View File

@ -1302,8 +1302,8 @@ static void factor_common_options(void)
static int long_name_compare(const void *on1, const void *on2)
{
struct opt_name **optname1 = (void *)on1;
struct opt_name **optname2 = (void *)on2;
const struct opt_name * const *optname1 = (const void *)on1;
const struct opt_name * const *optname2 = (const void *)on2;
return strcmp((*optname1)->long_opt + 2, (*optname2)->long_opt + 2);
}

View File

@ -177,7 +177,7 @@ struct command {
int command_enum; /* <command_id>_CMD */
int command_index; /* position in commands[] */
struct command_function *functions; /* new style */
const struct command_function *functions; /* new style */
command_fn fn; /* old style */
unsigned int cmd_flags; /* CMD_FLAG_ */

View File

@ -109,7 +109,7 @@ static struct cmdline_context _cmdline;
* to use these functions instead of the old per-command-name function.
* For now, any command id not included here uses the old command fn.
*/
struct command_function command_functions[CMD_COUNT] = {
static const struct command_function command_functions[CMD_COUNT] = {
{ lvmconfig_general_CMD, lvmconfig },
{ lvchange_properties_CMD, lvchange_properties_cmd },
{ lvchange_resync_CMD, lvchange_resync_cmd },
@ -1112,7 +1112,7 @@ static struct command_name *find_command_name(const char *name)
return NULL;
}
static struct command_function *_find_command_id_function(int command_enum)
static const struct command_function *_find_command_id_function(int command_enum)
{
int i;