change getopt definition to elide pointer storage
Make this a const pointer to the storage directly instead of a pointer variable that points to the storage. Makes the code slightly smaller.
This commit is contained in:
parent
32aeb7407b
commit
d017d5af9c
@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
extern const char *applet;
|
extern const char *applet;
|
||||||
extern const char *extraopts;
|
extern const char *extraopts;
|
||||||
extern const char *getoptstring;
|
extern const char getoptstring[];
|
||||||
extern const struct option longopts[];
|
extern const struct option longopts[];
|
||||||
extern const char * const longopts_help[];
|
extern const char * const longopts_help[];
|
||||||
extern const char *usagestring;
|
extern const char *usagestring;
|
||||||
|
@ -46,7 +46,7 @@ typedef enum {
|
|||||||
|
|
||||||
const char *applet = NULL;
|
const char *applet = NULL;
|
||||||
const char *extraopts ="path1 [path2] [...]";
|
const char *extraopts ="path1 [path2] [...]";
|
||||||
const char *getoptstring = "dDfFpm:o:sW" getoptstring_COMMON;
|
const char getoptstring[] = "dDfFpm:o:sW" getoptstring_COMMON;
|
||||||
const struct option longopts[] = {
|
const struct option longopts[] = {
|
||||||
{ "directory", 0, NULL, 'd'},
|
{ "directory", 0, NULL, 'd'},
|
||||||
{ "directory-truncate", 0, NULL, 'D'},
|
{ "directory-truncate", 0, NULL, 'D'},
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
const char *applet = NULL;
|
const char *applet = NULL;
|
||||||
const char *extraopts = NULL;
|
const char *extraopts = NULL;
|
||||||
const char *getoptstring = "MRbmop:t:" getoptstring_COMMON;
|
const char getoptstring[] = "MRbmop:t:" getoptstring_COMMON;
|
||||||
const struct option longopts[] = {
|
const struct option longopts[] = {
|
||||||
{ "mount", 0, NULL, 'M' },
|
{ "mount", 0, NULL, 'M' },
|
||||||
{ "remount", 0, NULL, 'R' },
|
{ "remount", 0, NULL, 'R' },
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
const char *applet = NULL;
|
const char *applet = NULL;
|
||||||
const char *extraopts = "[signal number]";
|
const char *extraopts = "[signal number]";
|
||||||
const char *getoptstring = "do:" getoptstring_COMMON;
|
const char getoptstring[] = "do:" getoptstring_COMMON;
|
||||||
const struct option longopts[] = {
|
const struct option longopts[] = {
|
||||||
{ "dry-run", 0, NULL, 'd' },
|
{ "dry-run", 0, NULL, 'd' },
|
||||||
{ "omit", 1, NULL, 'o' },
|
{ "omit", 1, NULL, 'o' },
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
const char *applet = NULL;
|
const char *applet = NULL;
|
||||||
const char *procmounts = "/proc/mounts";
|
const char *procmounts = "/proc/mounts";
|
||||||
const char *extraopts = "[mount1] [mount2] ...";
|
const char *extraopts = "[mount1] [mount2] ...";
|
||||||
const char *getoptstring = "f:F:n:N:o:O:p:P:iste:E:" getoptstring_COMMON;
|
const char getoptstring[] = "f:F:n:N:o:O:p:P:iste:E:" getoptstring_COMMON;
|
||||||
const struct option longopts[] = {
|
const struct option longopts[] = {
|
||||||
{ "fstype-regex", 1, NULL, 'f'},
|
{ "fstype-regex", 1, NULL, 'f'},
|
||||||
{ "skip-fstype-regex", 1, NULL, 'F'},
|
{ "skip-fstype-regex", 1, NULL, 'F'},
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
const char *applet = NULL;
|
const char *applet = NULL;
|
||||||
const char *extraopts = "stop | start | restart | describe | zap";
|
const char *extraopts = "stop | start | restart | describe | zap";
|
||||||
const char *getoptstring = "dDsSvl:Z" getoptstring_COMMON;
|
const char getoptstring[] = "dDsSvl:Z" getoptstring_COMMON;
|
||||||
const struct option longopts[] = {
|
const struct option longopts[] = {
|
||||||
{ "debug", 0, NULL, 'd'},
|
{ "debug", 0, NULL, 'd'},
|
||||||
{ "dry-run", 0, NULL, 'Z'},
|
{ "dry-run", 0, NULL, 'Z'},
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
const char *applet = NULL;
|
const char *applet = NULL;
|
||||||
const char *extraopts = NULL;
|
const char *extraopts = NULL;
|
||||||
const char *getoptstring = "cdDfFHKpRrsw" getoptstring_COMMON;
|
const char getoptstring[] = "cdDfFHKpRrsw" getoptstring_COMMON;
|
||||||
const struct option longopts[] = {
|
const struct option longopts[] = {
|
||||||
{ "cancel", no_argument, NULL, 'c'},
|
{ "cancel", no_argument, NULL, 'c'},
|
||||||
{ "no-write", no_argument, NULL, 'd'},
|
{ "no-write", no_argument, NULL, 'd'},
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
const char *applet = NULL;
|
const char *applet = NULL;
|
||||||
const char *extraopts = NULL;
|
const char *extraopts = NULL;
|
||||||
const char *getoptstring = "aot:suTF:" getoptstring_COMMON;
|
const char getoptstring[] = "aot:suTF:" getoptstring_COMMON;
|
||||||
const struct option longopts[] = {
|
const struct option longopts[] = {
|
||||||
{ "starting", 0, NULL, 'a'},
|
{ "starting", 0, NULL, 'a'},
|
||||||
{ "stopping", 0, NULL, 'o'},
|
{ "stopping", 0, NULL, 'o'},
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
const char *applet = NULL;
|
const char *applet = NULL;
|
||||||
const char *extraopts = NULL;
|
const char *extraopts = NULL;
|
||||||
const char *getoptstring = "cdDe:ilr:INsSZ" getoptstring_COMMON;
|
const char getoptstring[] = "cdDe:ilr:INsSZ" getoptstring_COMMON;
|
||||||
const struct option longopts[] = {
|
const struct option longopts[] = {
|
||||||
{ "debug", 0, NULL, 'd' },
|
{ "debug", 0, NULL, 'd' },
|
||||||
{ "nodeps", 0, NULL, 'D' },
|
{ "nodeps", 0, NULL, 'D' },
|
||||||
|
@ -35,7 +35,7 @@ enum format_t {
|
|||||||
|
|
||||||
const char *applet = NULL;
|
const char *applet = NULL;
|
||||||
const char *extraopts = NULL;
|
const char *extraopts = NULL;
|
||||||
const char *getoptstring = "acf:lmrsSu" getoptstring_COMMON;
|
const char getoptstring[] = "acf:lmrsSu" getoptstring_COMMON;
|
||||||
const struct option longopts[] = {
|
const struct option longopts[] = {
|
||||||
{"all", 0, NULL, 'a'},
|
{"all", 0, NULL, 'a'},
|
||||||
{"crashed", 0, NULL, 'c'},
|
{"crashed", 0, NULL, 'c'},
|
||||||
|
@ -36,7 +36,7 @@ const char *usagestring = "" \
|
|||||||
"Usage: rc-update [options] add <service> [<runlevel>...]\n" \
|
"Usage: rc-update [options] add <service> [<runlevel>...]\n" \
|
||||||
" or: rc-update [options] del <service> [<runlevel>...]\n" \
|
" or: rc-update [options] del <service> [<runlevel>...]\n" \
|
||||||
" or: rc-update [options] [show [<runlevel>...]]";
|
" or: rc-update [options] [show [<runlevel>...]]";
|
||||||
const char *getoptstring = "asu" getoptstring_COMMON;
|
const char getoptstring[] = "asu" getoptstring_COMMON;
|
||||||
const struct option longopts[] = {
|
const struct option longopts[] = {
|
||||||
{ "all", 0, NULL, 'a' },
|
{ "all", 0, NULL, 'a' },
|
||||||
{ "stack", 0, NULL, 's' },
|
{ "stack", 0, NULL, 's' },
|
||||||
|
@ -56,7 +56,7 @@ static const char rc_copyright[] = "Copyright (c) 2007-2008 Roy Marples";
|
|||||||
#include "_usage.h"
|
#include "_usage.h"
|
||||||
|
|
||||||
const char *extraopts = NULL;
|
const char *extraopts = NULL;
|
||||||
const char *getoptstring = "a:no:s:S" getoptstring_COMMON;
|
const char getoptstring[] = "a:no:s:S" getoptstring_COMMON;
|
||||||
const struct option longopts[] = {
|
const struct option longopts[] = {
|
||||||
{ "no-stop", 0, NULL, 'n' },
|
{ "no-stop", 0, NULL, 'n' },
|
||||||
{ "override", 1, NULL, 'o' },
|
{ "override", 1, NULL, 'o' },
|
||||||
|
@ -66,7 +66,7 @@ static struct pam_conv conv = { NULL, NULL};
|
|||||||
|
|
||||||
const char *applet = NULL;
|
const char *applet = NULL;
|
||||||
const char *extraopts = NULL;
|
const char *extraopts = NULL;
|
||||||
const char *getoptstring = "I:KN:PR:Sa:bc:d:e:g:ik:mn:op:s:tu:r:w:x:1:2:3:4:" \
|
const char getoptstring[] = "I:KN:PR:Sa:bc:d:e:g:ik:mn:op:s:tu:r:w:x:1:2:3:4:" \
|
||||||
getoptstring_COMMON;
|
getoptstring_COMMON;
|
||||||
const struct option longopts[] = {
|
const struct option longopts[] = {
|
||||||
{ "ionice", 1, NULL, 'I'},
|
{ "ionice", 1, NULL, 'I'},
|
||||||
|
@ -68,7 +68,7 @@ static struct pam_conv conv = { NULL, NULL};
|
|||||||
|
|
||||||
const char *applet = NULL;
|
const char *applet = NULL;
|
||||||
const char *extraopts = NULL;
|
const char *extraopts = NULL;
|
||||||
const char *getoptstring = "A:a:D:d:e:g:H:I:Kk:m:N:p:R:r:s:Su:1:2:3" \
|
const char getoptstring[] = "A:a:D:d:e:g:H:I:Kk:m:N:p:R:r:s:Su:1:2:3" \
|
||||||
getoptstring_COMMON;
|
getoptstring_COMMON;
|
||||||
const struct option longopts[] = {
|
const struct option longopts[] = {
|
||||||
{ "healthcheck-timer", 1, NULL, 'a'},
|
{ "healthcheck-timer", 1, NULL, 'a'},
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
const char *applet = NULL;
|
const char *applet = NULL;
|
||||||
const char *extraopts = "file";
|
const char *extraopts = "file";
|
||||||
const char *getoptstring = "sw" getoptstring_COMMON;
|
const char getoptstring[] = "sw" getoptstring_COMMON;
|
||||||
const struct option longopts[] = {
|
const struct option longopts[] = {
|
||||||
{ "save", 0, NULL, 's' },
|
{ "save", 0, NULL, 's' },
|
||||||
{ "warn", 0, NULL, 'w' },
|
{ "warn", 0, NULL, 'w' },
|
||||||
|
Loading…
Reference in New Issue
Block a user