mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-27 21:47:56 +00:00
btrfs-progs: make getopt tables static const
Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
parent
ecbf1339a6
commit
2b7cdab425
@ -1019,7 +1019,7 @@ int main(int ac, char **av)
|
||||
while(1) {
|
||||
int c;
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
static const struct option long_options[] = {
|
||||
/* { "byte-count", 1, NULL, 'b' }, */
|
||||
{ "logical", 1, NULL, 'l' },
|
||||
{ "copy", 1, NULL, 'c' },
|
||||
|
@ -128,7 +128,7 @@ int main(int ac, char **av)
|
||||
while(1) {
|
||||
int c;
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
static const struct option long_options[] = {
|
||||
/* { "byte-count", 1, NULL, 'b' }, */
|
||||
{ "logical", 1, NULL, 'l' },
|
||||
{ "copy", 1, NULL, 'c' },
|
||||
|
@ -390,7 +390,7 @@ static int cmd_balance_start(int argc, char **argv)
|
||||
optind = 1;
|
||||
while (1) {
|
||||
int longindex;
|
||||
static struct option longopts[] = {
|
||||
static const struct option longopts[] = {
|
||||
{ "data", optional_argument, NULL, 'd'},
|
||||
{ "metadata", optional_argument, NULL, 'm' },
|
||||
{ "system", optional_argument, NULL, 's' },
|
||||
@ -662,7 +662,7 @@ static int cmd_balance_status(int argc, char **argv)
|
||||
optind = 1;
|
||||
while (1) {
|
||||
int longindex;
|
||||
static struct option longopts[] = {
|
||||
static const struct option longopts[] = {
|
||||
{ "verbose", no_argument, NULL, 'v' },
|
||||
{ NULL, no_argument, NULL, 0}
|
||||
};
|
||||
|
@ -8437,7 +8437,7 @@ int cmd_check(int argc, char **argv)
|
||||
while(1) {
|
||||
int c;
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
static const struct option long_options[] = {
|
||||
{ "super", 1, NULL, 's' },
|
||||
{ "repair", 0, NULL, 0 },
|
||||
{ "init-csum-tree", 0, NULL, 0 },
|
||||
|
@ -56,7 +56,7 @@ static int cmd_add_dev(int argc, char **argv)
|
||||
|
||||
while (1) {
|
||||
int long_index;
|
||||
static struct option long_options[] = {
|
||||
static const struct option long_options[] = {
|
||||
{ "nodiscard", optional_argument, NULL, 'K'},
|
||||
{ "force", no_argument, NULL, 'f'},
|
||||
{ 0, 0, 0, 0 }
|
||||
@ -214,7 +214,7 @@ static int cmd_scan_dev(int argc, char **argv)
|
||||
optind = 1;
|
||||
while (1) {
|
||||
int long_index;
|
||||
static struct option long_options[] = {
|
||||
static const struct option long_options[] = {
|
||||
{ "all-devices", no_argument, NULL, 'd'},
|
||||
{ 0, 0, 0, 0 },
|
||||
};
|
||||
|
@ -834,7 +834,7 @@ static int cmd_show(int argc, char **argv)
|
||||
|
||||
while (1) {
|
||||
int long_index;
|
||||
static struct option long_options[] = {
|
||||
static const struct option long_options[] = {
|
||||
{ "all-devices", no_argument, NULL, 'd'},
|
||||
{ "mounted", no_argument, NULL, 'm'},
|
||||
{ NULL, no_argument, NULL, 0 },
|
||||
|
@ -242,7 +242,7 @@ static int cmd_qgroup_show(int argc, char **argv)
|
||||
optind = 1;
|
||||
while (1) {
|
||||
int c;
|
||||
struct option long_options[] = {
|
||||
static const struct option long_options[] = {
|
||||
{"sort", 1, NULL, 'S'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
@ -1167,7 +1167,7 @@ int cmd_restore(int argc, char **argv)
|
||||
while (1) {
|
||||
int opt;
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
static const struct option long_options[] = {
|
||||
{ "path-regex", 1, NULL, 256},
|
||||
{ "dry-run", 0, NULL, 'D'},
|
||||
{ NULL, 0, NULL, 0}
|
||||
|
@ -223,7 +223,7 @@ static int cmd_subvol_delete(int argc, char **argv)
|
||||
optind = 1;
|
||||
while (1) {
|
||||
int c;
|
||||
struct option long_options[] = {
|
||||
static const struct option long_options[] = {
|
||||
{"commit-after", no_argument, NULL, 'c'}, /* commit mode 1 */
|
||||
{"commit-each", no_argument, NULL, 'C'}, /* commit mode 2 */
|
||||
{NULL, 0, NULL, 0}
|
||||
@ -403,7 +403,7 @@ static int cmd_subvol_list(int argc, char **argv)
|
||||
optind = 1;
|
||||
while(1) {
|
||||
int c;
|
||||
struct option long_options[] = {
|
||||
static const struct option long_options[] = {
|
||||
{"sort", 1, NULL, 'S'},
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user