mkfs: constify various strings
Because the ini parser uses const strings and so the opt parsing
needs to be told about it to avoid compiler warnings.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
diff --git a/include/linux.h b/include/linux.h
index 57726bb..03b3278 100644
--- a/include/linux.h
+++ b/include/linux.h
@@ -92,7 +92,7 @@
uuid_unparse(*uu, buffer);
}
-static __inline__ int platform_uuid_parse(char *buffer, uuid_t *uu)
+static __inline__ int platform_uuid_parse(const char *buffer, uuid_t *uu)
{
return uuid_parse(buffer, *uu);
}
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 33be9ba..829f038 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -975,8 +975,8 @@
static void
unknown(
- char opt,
- char *s)
+ const char opt,
+ const char *s)
{
fprintf(stderr, _("unknown option -%c %s\n"), opt, s);
usage();
@@ -1387,7 +1387,7 @@
*/
static char *
getstr(
- char *str,
+ const char *str,
struct opt_params *opts,
int index)
{
@@ -1396,14 +1396,14 @@
/* empty strings for string options are not valid */
if (!str || *str == '\0')
reqval(opts->name, opts->subopts, index);
- return str;
+ return (char *)str;
}
static int
block_opts_parser(
struct opt_params *opts,
int subopt,
- char *value,
+ const char *value,
struct cli_params *cli)
{
switch (subopt) {
@@ -1420,7 +1420,7 @@
cfgfile_opts_parser(
struct opt_params *opts,
int subopt,
- char *value,
+ const char *value,
struct cli_params *cli)
{
switch (subopt) {
@@ -1437,7 +1437,7 @@
data_opts_parser(
struct opt_params *opts,
int subopt,
- char *value,
+ const char *value,
struct cli_params *cli)
{
switch (subopt) {
@@ -1506,7 +1506,7 @@
inode_opts_parser(
struct opt_params *opts,
int subopt,
- char *value,
+ const char *value,
struct cli_params *cli)
{
switch (subopt) {
@@ -1541,7 +1541,7 @@
log_opts_parser(
struct opt_params *opts,
int subopt,
- char *value,
+ const char *value,
struct cli_params *cli)
{
switch (subopt) {
@@ -1587,7 +1587,7 @@
meta_opts_parser(
struct opt_params *opts,
int subopt,
- char *value,
+ const char *value,
struct cli_params *cli)
{
switch (subopt) {
@@ -1621,7 +1621,7 @@
naming_opts_parser(
struct opt_params *opts,
int subopt,
- char *value,
+ const char *value,
struct cli_params *cli)
{
switch (subopt) {
@@ -1650,7 +1650,7 @@
rtdev_opts_parser(
struct opt_params *opts,
int subopt,
- char *value,
+ const char *value,
struct cli_params *cli)
{
switch (subopt) {
@@ -1680,7 +1680,7 @@
sector_opts_parser(
struct opt_params *opts,
int subopt,
- char *value,
+ const char *value,
struct cli_params *cli)
{
switch (subopt) {
@@ -1700,7 +1700,7 @@
struct opt_params *opts;
int (*parser)(struct opt_params *opts,
int subopt,
- char *value,
+ const char *value,
struct cli_params *cli);
} subopt_tab[] = {
{ 'b', &bopts, block_opts_parser },