• 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
..
.gitignore Loading commit data...
GetAllMatchRules.py Loading commit data...
Makefile.am Loading commit data...
ci-build.sh Loading commit data...
dbus-cleanup-sockets.c Loading commit data...
dbus-echo.c Loading commit data...
dbus-launch-win.c Loading commit data...
dbus-launch-x11.c Loading commit data...
dbus-launch.c Loading commit data...
dbus-launch.h Loading commit data...
dbus-monitor.c Loading commit data...
dbus-print-message.c Loading commit data...
dbus-print-message.h Loading commit data...
dbus-run-session.c Loading commit data...
dbus-send.c Loading commit data...
dbus-spam.c Loading commit data...
dbus-update-activation-environment.c Loading commit data...
dbus-uuidgen.c Loading commit data...
run-with-tmp-session-bus.sh Loading commit data...
strtoll.c Loading commit data...
strtoull.c Loading commit data...
test-tool.c Loading commit data...
test-tool.h Loading commit data...
tool-common.c Loading commit data...
tool-common.h Loading commit data...