summaryrefslogtreecommitdiff
path: root/bus/config-parser.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2016-10-07 17:41:01 +0100
committerSimon McVittie <smcv@debian.org>2016-10-13 17:20:28 +0100
commit8db5ca900fd84ea1c055cd15600dfe352e542df5 (patch)
tree72c37822da382f513fff45acc5d90811c5f9701f /bus/config-parser.c
parentcc7df2fbf944d53ec6bbed499ef1e054bdfa0eb9 (diff)
downloaddbus-8db5ca900fd84ea1c055cd15600dfe352e542df5.tar.gz
Be more const-correct
As a general design principle, strings that we aren't going to modify should usually be const. When compiling with -Wwrite-strings, quoted string constants are of type "const char *", causing compiler warnings when they are assigned to char * variables. Unfortunately, we need to add casts in a few places: * _dbus_list_append(), _dbus_test_oom_handling() and similar generic "user-data" APIs take a void *, not a const void *, so we have to cast * For historical reasons the execve() family of functions take a (char * const *), i.e. a constant pointer to an array of mutable strings, so again we have to cast * _dbus_spawn_async_with_babysitter similarly takes a char **, although we can make it a little more const-correct by making it take (char * const *) like execve() does This also incorporates a subsequent patch by Thomas Zimmermann to put various string constants in static storage, which is a little more efficient. Signed-off-by: Simon McVittie <smcv@debian.org> Reviewed-by: Thomas Zimmermann <tdz@users.sourceforge.net> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97357
Diffstat (limited to 'bus/config-parser.c')
-rw-r--r--bus/config-parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bus/config-parser.c b/bus/config-parser.c
index 5af1024e..b776a2d0 100644
--- a/bus/config-parser.c
+++ b/bus/config-parser.c
@@ -2810,7 +2810,7 @@ static dbus_bool_t
do_check_own_rules (BusPolicy *policy)
{
const struct {
- char *name;
+ const char *name;
dbus_bool_t allowed;
} checks[] = {
{"org.freedesktop", FALSE},