• Simon McVittie's avatar
    Be more const-correct · 8db5ca90
    Simon McVittie authored
    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: default avatarSimon McVittie <smcv@debian.org>
    Reviewed-by: default avatarThomas Zimmermann <tdz@users.sourceforge.net>
    Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97357
    8db5ca90
Name
Last commit
Last update
..
legacy-config Loading commit data...
systemd-user Loading commit data...
.gitignore Loading commit data...
Makefile.am Loading commit data...
activation-exit-codes.h Loading commit data...
activation-helper-bin.c Loading commit data...
activation-helper.c Loading commit data...
activation-helper.h Loading commit data...
activation.c Loading commit data...
activation.h Loading commit data...
apparmor.c Loading commit data...
apparmor.h Loading commit data...
audit.c Loading commit data...
audit.h Loading commit data...
bus.c Loading commit data...
bus.h Loading commit data...
config-loader-expat.c Loading commit data...
config-parser-common.c Loading commit data...
config-parser-common.h Loading commit data...
config-parser-trivial.c Loading commit data...
config-parser-trivial.h Loading commit data...
config-parser.c Loading commit data...
config-parser.h Loading commit data...
connection.c Loading commit data...
connection.h Loading commit data...
dbus.service.in Loading commit data...
dbus.socket.in Loading commit data...
desktop-file.c Loading commit data...
desktop-file.h Loading commit data...
dir-watch-default.c Loading commit data...
dir-watch-inotify.c Loading commit data...
dir-watch-kqueue.c Loading commit data...
dir-watch.h Loading commit data...
dispatch.c Loading commit data...
dispatch.h Loading commit data...
driver.c Loading commit data...
driver.h Loading commit data...
example-session-disable-stats.conf.in Loading commit data...
example-system-enable-stats.conf.in Loading commit data...
expirelist.c Loading commit data...
expirelist.h Loading commit data...
main.c Loading commit data...
messagebus-config.in Loading commit data...
messagebus.in Loading commit data...
org.freedesktop.dbus-session.plist.in Loading commit data...
policy.c Loading commit data...
policy.h Loading commit data...
rc.messagebus.in Loading commit data...
selinux.c Loading commit data...
selinux.h Loading commit data...
services.c Loading commit data...
services.h Loading commit data...
session.conf.in Loading commit data...
signals.c Loading commit data...
signals.h Loading commit data...
stats.c Loading commit data...
stats.h Loading commit data...
system.conf.in Loading commit data...
test-launch-helper.c Loading commit data...
test-main.c Loading commit data...
test-system.c Loading commit data...
test.c Loading commit data...
test.h Loading commit data...
utils.c Loading commit data...
utils.h Loading commit data...