-Wwrite-strings: Constify macroexp.c:init_shared_buffer
authorPedro Alves <palves@redhat.com>
Wed, 5 Apr 2017 18:21:33 +0000 (19:21 +0100)
committerPedro Alves <palves@redhat.com>
Wed, 5 Apr 2017 18:21:33 +0000 (19:21 +0100)
commitb38ef47f47bda5509babd768092ceb09ab98828d
tree942e46dacce698570ced2f31c67bafae911810e8
parentf995bbe8e62fdb5607acb1ee127240cfe50d2b8f
-Wwrite-strings: Constify macroexp.c:init_shared_buffer

There's one call in the file that passes a string literal, like:

init_shared_buffer (&va_arg_name, "__VA_ARGS__",
  strlen ("__VA_ARGS__"));

Instead of adding a cast here, make init_shared_buffer take a 'const
char *', and remove the several casts in the file that are made
obsolete.

gdb/ChangeLog:
2017-04-05  Pedro Alves  <palves@redhat.com>

* macroexp.c (macro_buffer::shared): Now a bool.
(init_buffer): Update.
(init_shared_buffer): Constify 'addr' parameter.
(substitute_args, expand, macro_expand, macro_expand_next): Remove
casts.
gdb/ChangeLog
gdb/macroexp.c