mark option structs as const
These are never modified and even getopt_long's prototype shows this modifier on the parameter. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
5136df0f39
commit
1d37c19e04
2 changed files with 2 additions and 2 deletions
|
@ -573,7 +573,7 @@ static int parseargs(int argc, char *argv[])
|
|||
int option_index = 0;
|
||||
int result;
|
||||
const char *optstring = "DQRSTUVb:cdefghiklmnopqr:stuvwy";
|
||||
static struct option opts[] =
|
||||
static const struct option opts[] =
|
||||
{
|
||||
{"database", no_argument, 0, 'D'},
|
||||
{"query", no_argument, 0, 'Q'},
|
||||
|
|
|
@ -164,7 +164,7 @@ static int parse_options(int argc, char *argv[])
|
|||
int opt, option_index = 0;
|
||||
char *endptr = NULL;
|
||||
|
||||
static struct option opts[] = {
|
||||
static const struct option opts[] = {
|
||||
{"dbpath", required_argument, 0, 'b'},
|
||||
{"color", no_argument, 0, 'c'},
|
||||
{"depth", required_argument, 0, 'd'},
|
||||
|
|
Loading…
Add table
Reference in a new issue