1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Use const char* const * for dm_regex_create()

Change API interface to accept even completely const array patterns.

This should present no change for libdm users and allows to pass
pattern arrays without cast to const char **.
This commit is contained in:
Zdenek Kabelac 2010-12-20 13:23:11 +00:00
parent ba96eb24fa
commit 303923fbf1
4 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.60 - Version 1.02.60 -
=================================== ===================================
Change dm_regex_create() API to accept const char * const *patterns.
Add new dm_prepare_selinux_context fn to libdevmapper and use it throughout. Add new dm_prepare_selinux_context fn to libdevmapper and use it throughout.
Detect existence of new SELinux selabel interface during configure. Detect existence of new SELinux selabel interface during configure.

View File

@ -543,7 +543,7 @@ static int _init_preferred_names(struct cmd_context *cmd)
const struct config_node *cn; const struct config_node *cn;
const struct config_value *v; const struct config_value *v;
struct dm_pool *scratch = NULL; struct dm_pool *scratch = NULL;
char **regex; const char **regex;
unsigned count = 0; unsigned count = 0;
int i, r = 0; int i, r = 0;
@ -583,7 +583,7 @@ static int _init_preferred_names(struct cmd_context *cmd)
} }
if (!(_cache.preferred_names_matcher = if (!(_cache.preferred_names_matcher =
dm_regex_create(_cache.mem,(const char **) regex, count))) { dm_regex_create(_cache.mem, regex, count))) {
log_error("Preferred device name pattern matcher creation failed."); log_error("Preferred device name pattern matcher creation failed.");
goto out; goto out;
} }

View File

@ -1020,7 +1020,7 @@ struct dm_regex;
* Initialise an array of num patterns for matching. * Initialise an array of num patterns for matching.
* Uses memory from mem. * Uses memory from mem.
*/ */
struct dm_regex *dm_regex_create(struct dm_pool *mem, const char **patterns, struct dm_regex *dm_regex_create(struct dm_pool *mem, const char * const *patterns,
unsigned num_patterns); unsigned num_patterns);
/* /*

View File

@ -310,7 +310,7 @@ static void _force_states(struct dm_regex *m)
} }
} }
struct dm_regex *dm_regex_create(struct dm_pool *mem, const char **patterns, struct dm_regex *dm_regex_create(struct dm_pool *mem, const char * const *patterns,
unsigned num_patterns) unsigned num_patterns)
{ {
char *all, *ptr; char *all, *ptr;