• 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...
Makefile.am Loading commit data...
Version.in Loading commit data...
dbus-address.c Loading commit data...
dbus-address.h Loading commit data...
dbus-arch-deps.h.in Loading commit data...
dbus-asv-util.c Loading commit data...
dbus-asv-util.h Loading commit data...
dbus-auth-script.c Loading commit data...
dbus-auth-script.h Loading commit data...
dbus-auth-util.c Loading commit data...
dbus-auth.c Loading commit data...
dbus-auth.h Loading commit data...
dbus-bus.c Loading commit data...
dbus-bus.h Loading commit data...
dbus-connection-internal.h Loading commit data...
dbus-connection.c Loading commit data...
dbus-connection.h Loading commit data...
dbus-credentials-util.c Loading commit data...
dbus-credentials.c Loading commit data...
dbus-credentials.h Loading commit data...
dbus-dataslot.c Loading commit data...
dbus-dataslot.h Loading commit data...
dbus-errors.c Loading commit data...
dbus-errors.h Loading commit data...
dbus-file-unix.c Loading commit data...
dbus-file-win.c Loading commit data...
dbus-file.c Loading commit data...
dbus-file.h Loading commit data...
dbus-hash.c Loading commit data...
dbus-hash.h Loading commit data...
dbus-init-win.cpp Loading commit data...
dbus-internals.c Loading commit data...
dbus-internals.h Loading commit data...
dbus-keyring.c Loading commit data...
dbus-keyring.h Loading commit data...
dbus-list.c Loading commit data...
dbus-list.h Loading commit data...
dbus-macros.h Loading commit data...
dbus-mainloop.c Loading commit data...
dbus-mainloop.h Loading commit data...
dbus-marshal-basic.c Loading commit data...
dbus-marshal-basic.h Loading commit data...
dbus-marshal-byteswap-util.c Loading commit data...
dbus-marshal-byteswap.c Loading commit data...
dbus-marshal-byteswap.h Loading commit data...
dbus-marshal-header.c Loading commit data...
dbus-marshal-header.h Loading commit data...
dbus-marshal-recursive-util.c Loading commit data...
dbus-marshal-recursive.c Loading commit data...
dbus-marshal-recursive.h Loading commit data...
dbus-marshal-validate-util.c Loading commit data...
dbus-marshal-validate.c Loading commit data...
dbus-marshal-validate.h Loading commit data...
dbus-memory.c Loading commit data...
dbus-memory.h Loading commit data...
dbus-mempool.c Loading commit data...
dbus-mempool.h Loading commit data...
dbus-message-factory.c Loading commit data...
dbus-message-factory.h Loading commit data...
dbus-message-internal.h Loading commit data...
dbus-message-private.h Loading commit data...
dbus-message-util.c Loading commit data...
dbus-message.c Loading commit data...
dbus-message.h Loading commit data...
dbus-misc.c Loading commit data...
dbus-misc.h Loading commit data...
dbus-nonce.c Loading commit data...
dbus-nonce.h Loading commit data...
dbus-object-tree.c Loading commit data...
dbus-object-tree.h Loading commit data...
dbus-pending-call-internal.h Loading commit data...
dbus-pending-call.c Loading commit data...
dbus-pending-call.h Loading commit data...
dbus-pipe-unix.c Loading commit data...
dbus-pipe-win.c Loading commit data...
dbus-pipe.c Loading commit data...
dbus-pipe.h Loading commit data...
dbus-protocol.h Loading commit data...
dbus-resources.c Loading commit data...
dbus-resources.h Loading commit data...
dbus-server-debug-pipe.c Loading commit data...
dbus-server-debug-pipe.h Loading commit data...
dbus-server-launchd.c Loading commit data...
dbus-server-launchd.h Loading commit data...
dbus-server-protected.h Loading commit data...
dbus-server-socket.c Loading commit data...
dbus-server-socket.h Loading commit data...
dbus-server-unix.c Loading commit data...
dbus-server-unix.h Loading commit data...
dbus-server-win.c Loading commit data...
dbus-server-win.h Loading commit data...
dbus-server.c Loading commit data...
dbus-server.h Loading commit data...
dbus-sha.c Loading commit data...
dbus-sha.h Loading commit data...
dbus-shared.h Loading commit data...
dbus-shell.c Loading commit data...
dbus-shell.h Loading commit data...
dbus-signature.c Loading commit data...
dbus-signature.h Loading commit data...
dbus-socket-set-epoll.c Loading commit data...
dbus-socket-set-poll.c Loading commit data...
dbus-socket-set.c Loading commit data...
dbus-socket-set.h Loading commit data...
dbus-sockets-win.h Loading commit data...
dbus-spawn-test.c Loading commit data...
dbus-spawn-win.c Loading commit data...
dbus-spawn.c Loading commit data...
dbus-spawn.h Loading commit data...
dbus-string-private.h Loading commit data...
dbus-string-util.c Loading commit data...
dbus-string.c Loading commit data...
dbus-string.h Loading commit data...
dbus-syntax.c Loading commit data...
dbus-syntax.h Loading commit data...
dbus-sysdeps-pthread.c Loading commit data...
dbus-sysdeps-thread-win.c Loading commit data...
dbus-sysdeps-unix.c Loading commit data...
dbus-sysdeps-unix.h Loading commit data...
dbus-sysdeps-util-unix.c Loading commit data...
dbus-sysdeps-util-win.c Loading commit data...
dbus-sysdeps-util.c Loading commit data...
dbus-sysdeps-win.c Loading commit data...
dbus-sysdeps-win.h Loading commit data...
dbus-sysdeps-wince-glue.c Loading commit data...
dbus-sysdeps-wince-glue.h Loading commit data...
dbus-sysdeps.c Loading commit data...
dbus-sysdeps.h Loading commit data...
dbus-test-main.c Loading commit data...
dbus-test.c Loading commit data...
dbus-test.h Loading commit data...
dbus-threads-internal.h Loading commit data...
dbus-threads.c Loading commit data...
dbus-threads.h Loading commit data...
dbus-timeout.c Loading commit data...
dbus-timeout.h Loading commit data...
dbus-transport-protected.h Loading commit data...
dbus-transport-socket.c Loading commit data...
dbus-transport-socket.h Loading commit data...
dbus-transport-unix.c Loading commit data...
dbus-transport-unix.h Loading commit data...
dbus-transport-win.c Loading commit data...
dbus-transport-win.h Loading commit data...
dbus-transport.c Loading commit data...
dbus-transport.h Loading commit data...
dbus-types.h Loading commit data...
dbus-userdb-util.c Loading commit data...
dbus-userdb.c Loading commit data...
dbus-userdb.h Loading commit data...
dbus-uuidgen.c Loading commit data...
dbus-uuidgen.h Loading commit data...
dbus-valgrind-internal.h Loading commit data...
dbus-watch.c Loading commit data...
dbus-watch.h Loading commit data...
dbus.h Loading commit data...
versioninfo.rc.in Loading commit data...