• 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
bus Loading commit data...
cmake Loading commit data...
dbus Loading commit data...
doc Loading commit data...
m4 Loading commit data...
test Loading commit data...
tools Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
ChangeLog Loading commit data...
ChangeLog.pre-1-0 Loading commit data...
ChangeLog.pre-1-2 Loading commit data...
Doxyfile.in Loading commit data...
HACKING Loading commit data...
INSTALL Loading commit data...
Makefile.am Loading commit data...
Makefile.cvs Loading commit data...
NEWS Loading commit data...
NEWS.pre-1-0 Loading commit data...
NEWS.pre-1-2 Loading commit data...
README Loading commit data...
README.cmake Loading commit data...
README.cygwin Loading commit data...
README.launchd Loading commit data...
README.valgrind Loading commit data...
README.win Loading commit data...
README.wince Loading commit data...
autogen.sh Loading commit data...
cleanup-man-pages.sh Loading commit data...
configure.ac Loading commit data...
dbus-1-uninstalled.pc.in Loading commit data...
dbus-1.pc.in Loading commit data...