diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-04-16 17:10:23 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-04-16 17:10:23 -0700 |
commit | d944df52b7b2c5c9e6789b0ff7bb390108613c6c (patch) | |
tree | c5c02d324b78407576976a08c00f3c8d800d9fef | |
parent | 71c97a091a511d403fdb8587d0e1240ec3913820 (diff) |
Add const qualifiers to structs for mapping strings to values
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xrefresh.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -87,14 +87,14 @@ Syntax(void) static int parse_boolean_option(char *option) { - static struct _booltable { + static const struct _booltable { const char *name; int value; } booltable[] = { { "off", 0 }, { "n", 0 }, { "no", 0 }, { "false", 0 }, { "on", 1 }, { "y", 1 }, { "yes", 1 }, { "true", 1 }, { NULL, -1 }}; - register struct _booltable *t; + register const struct _booltable *t; register char *cp; for (cp = option; *cp; cp++) { @@ -138,7 +138,7 @@ isabbreviation(const char *arg, char *s, int minslen) enum e_action {doDefault, doBlack, doWhite, doSolid, doNone, doRoot}; -static struct s_pair { +static const struct s_pair { const char *resource_name; enum e_action action; } pair_table[] = { @@ -225,7 +225,7 @@ main(int argc, char *argv[]) } action = doSolid; } else { - struct s_pair *pp; + const struct s_pair *pp; for (pp = pair_table; pp->resource_name != NULL; pp++) { def = XGetDefault (dpy, ProgramName, pp->resource_name); |