1
0
mirror of https://github.com/moparisthebest/pacman synced 2025-03-01 01:41:52 -05:00

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:
Dave Reisner 2011-08-08 14:37:30 -04:00 committed by Dan McGee
parent 5136df0f39
commit 1d37c19e04
2 changed files with 2 additions and 2 deletions

View File

@ -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'},

View File

@ -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'},