From 5cf9a03b3f7b9feb08f4aa4fc36f036b2f00614d Mon Sep 17 00:00:00 2001 From: "\"Vladimir N. Oleynik\"" Date: Wed, 19 Oct 2005 09:21:51 +0000 Subject: more const, attribute_noreturn saved 200 bytes --- util-linux/getopt.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'util-linux') diff --git a/util-linux/getopt.c b/util-linux/getopt.c index 0ad69ad9a..fc3b9f97e 100644 --- a/util-linux/getopt.c +++ b/util-linux/getopt.c @@ -63,10 +63,10 @@ typedef enum {BASH,TCSH} shell_t; /* Some global variables that tells us how to parse. */ static shell_t shell=BASH; /* The shell we generate output for. */ -static int quiet_errors=0; /* 0 is not quiet. */ -static int quiet_output=0; /* 0 is not quiet. */ +static int quiet_errors; /* 0 is not quiet. */ +static int quiet_output; /* 0 is not quiet. */ static int quote=1; /* 1 is do quote. */ -static int alternative=0; /* 0 is getopt_long, 1 is getopt_long_only */ +static int alternative; /* 0 is getopt_long, 1 is getopt_long_only */ /* Function prototypes */ static const char *normalize(const char *arg); @@ -192,9 +192,9 @@ int generate_output(char * argv[],int argc,const char *optstr, return exit_code; } -static struct option *long_options=NULL; -static int long_options_length=0; /* Length of array */ -static int long_options_nr=0; /* Nr of used elements in array */ +static struct option *long_options; +static int long_options_length; /* Length of array */ +static int long_options_nr; /* Nr of used elements in array */ static const int LONG_OPTIONS_INCR = 10; #define init_longopt() add_longopt(NULL,0) @@ -285,7 +285,7 @@ void set_shell(const char *new_shell) * 4) Returned for -T */ -static struct option longopts[]= +static const struct option longopts[]= { {"options",required_argument,NULL,'o'}, {"longoptions",required_argument,NULL,'l'}, @@ -300,7 +300,7 @@ static struct option longopts[]= }; /* Stop scanning as soon as a non-option argument is found! */ -static const char *shortopts="+ao:l:n:qQs:Tu"; +static const char shortopts[]="+ao:l:n:qQs:Tu"; int getopt_main(int argc, char *argv[]) -- cgit v1.2.3