diff options
author | seebs <seebs@seebs-eee.(none)> | 2010-08-12 18:01:55 -0500 |
---|---|---|
committer | seebs <seebs@seebs-eee.(none)> | 2010-08-12 18:01:55 -0500 |
commit | d30de158c1986d2161647629f279018702a42750 (patch) | |
tree | e3d4e70abddd61108533ea4dd87209f563f2c9c5 | |
parent | a05e23b738edfd2304863605cce84a7eb64b00df (diff) | |
download | pseudo-d30de158c1986d2161647629f279018702a42750.tar.gz pseudo-d30de158c1986d2161647629f279018702a42750.tar.bz2 pseudo-d30de158c1986d2161647629f279018702a42750.zip |
Whoops, const really does mean read-only on some targets.
-rw-r--r-- | ChangeLog.txt | 1 | ||||
-rw-r--r-- | pseudo_util.c | 10 |
2 files changed, 6 insertions, 5 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index d373ced..a448577 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -2,6 +2,7 @@ * (seebs) Fix install of libpseudo so the plain library is created when using $(SUFFIX), this is needed so pseudo daemons don't need to know $(SUFFIX) so you can use prebuilts. + * (seebs) Remove spurious "const" from modifiable table. 2010-08-11: * (seebs) document the new variables. diff --git a/pseudo_util.c b/pseudo_util.c index b44f000..bff33f1 100644 --- a/pseudo_util.c +++ b/pseudo_util.c @@ -33,10 +33,10 @@ #include "pseudo_ipc.h" #include "pseudo_db.h" -/* The order below is not arbitrary, but based on the assumption +/* The order below is not arbitrary, but based on an assumption * of how often things will be used. */ -const struct pseudo_variables pseudo_env[] = { +static struct pseudo_variables pseudo_env[] = { { "PSEUDO_PREFIX", 13, NULL }, { "PSEUDO_BINDIR", 13, NULL }, { "PSEUDO_LIBDIR", 13, NULL }, @@ -67,7 +67,7 @@ int _in_init = -1; /* Not yet run */ static void _libpseudo_init(void) __attribute__ ((constructor)); -void dump_env(char **envp) { +static void dump_env(char **envp) { size_t i = 0; for (i = 0; envp[i]; i++) { pseudo_debug(0,"dump_envp: [%d]%s\n", i,envp[i]); @@ -116,9 +116,9 @@ int pseudo_set_value(const char * key, const char * value) { if (pseudo_env[i].key) { if (pseudo_env[i].value) free(pseudo_env[i].value); if (value) - ((struct pseudo_variables *)pseudo_env)[i].value = strdup(value); + pseudo_env[i].value = strdup(value); else - ((struct pseudo_variables *)pseudo_env)[i].value = NULL; + pseudo_env[i].value = NULL; } else { if (!_in_init) pseudo_diag("Unknown variable %s.\n", key); rc = -EINVAL; |