binutils-gdb/gdb/common
Tom Tromey f1735a53a6 Rename _const functions to use overloading instead
This renames a few functions -- skip_spaces_const,
skip_to_space_const, get_number_const, extract_arg_const -- to drop
the "_const" suffix and instead rely on overloading.

This makes future const fixes simpler by reducing the number of lines
that must be changed.  I think it is also not any less clear, as all
these functions have the same interface as their non-const versions by
design.  Furthermore there's an example of using an overload in-tree
already, namely check_for_argument.

This patch was largely created using some perl one-liners; then a few
fixes were applied by hand.

ChangeLog
2017-09-11  Tom Tromey  <tom@tromey.com>

	* common/common-utils.h (skip_to_space): Remove macro, redeclare
	as function.
	(skip_to_space): Rename from skip_to_space_const.
	* common/common-utils.c (skip_to_space): New function.
	(skip_to_space): Rename from skip_to_space_const.
	* cli/cli-utils.h (get_number): Rename from get_number_const.
	(extract_arg): Rename from extract_arg_const.
	* cli/cli-utils.c (get_number): Rename from get_number_const.
	(extract_arg): Rename from extract_arg_const.
	(number_or_range_parser::get_number): Use ::get_number.
	* aarch64-linux-tdep.c, ada-lang.c, arm-linux-tdep.c, ax-gdb.c,
	break-catch-throw.c, breakpoint.c, cli/cli-cmds.c, cli/cli-dump.c,
	cli/cli-script.c, cli/cli-setshow.c, compile/compile.c,
	completer.c, demangle.c, disasm.c, findcmd.c, linespec.c,
	linux-tdep.c, linux-thread-db.c, location.c, mi/mi-parse.c,
	minsyms.c, nat/linux-procfs.c, printcmd.c, probe.c,
	python/py-breakpoint.c, record.c, rust-exp.y, serial.c, stack.c,
	stap-probe.c, tid-parse.c, tracepoint.c: Update all callers.
2017-09-11 15:46:12 -06:00
..
agent.c
agent.h Add STRINGIFY to gdb/common/preprocessor.h 2017-06-22 10:59:42 +01:00
array-view.h Introduce gdb::array_view 2017-09-04 17:10:12 +01:00
ax.def
break-common.h
btrace-common.c
btrace-common.h
buffer.c
buffer.h buffer.h: Fix spelling mistakes 2017-07-03 13:59:00 +02:00
byte-vector.h Introduce gdb::byte_vector, add allocator that default-initializes 2017-06-14 11:08:52 +01:00
cleanups.c
cleanups.h
common-debug.c
common-debug.h
common-defs.h
common-exceptions.c
common-exceptions.h
common-gdbthread.h Share parts of gdb/gdbthread.h with gdbserver 2017-06-07 19:56:01 -04:00
common-inferior.h Share fork_inferior et al with gdbserver 2017-06-07 19:56:09 -04:00
common-regcache.c
common-regcache.h
common-types.h
common-utils.c Rename _const functions to use overloading instead 2017-09-11 15:46:12 -06:00
common-utils.h Rename _const functions to use overloading instead 2017-09-11 15:46:12 -06:00
common.host
common.m4
create-version.sh
def-vector.h Introduce gdb::byte_vector, add allocator that default-initializes 2017-06-14 11:08:52 +01:00
default-init-alloc.h Introduce gdb::byte_vector, add allocator that default-initializes 2017-06-14 11:08:52 +01:00
diagnostics.h vec: Silence -Wunused-function warnings on clang 2017-06-26 16:51:17 +02:00
enum-flags.h
environ.c Implement the ability to set/unset environment variables to GDBserver when starting the inferior 2017-08-31 17:22:10 -04:00
environ.h Implement the ability to set/unset environment variables to GDBserver when starting the inferior 2017-08-31 17:22:10 -04:00
errors.c
errors.h
fileio.c
fileio.h
filestuff.c Introduce and use gdb_file_up 2017-08-03 07:58:52 -06:00
filestuff.h Introduce and use gdb_file_up 2017-08-03 07:58:52 -06:00
format.c
format.h
function-view.h
gdb_assert.h
gdb_locale.h
gdb_optional.h
gdb_ref_ptr.h
gdb_setjmp.h
gdb_signals.h
gdb_sys_time.h
gdb_termios.h
gdb_unique_ptr.h Allow gdb::unique_xmalloc_ptr<T[]> 2017-08-10 14:18:02 +01:00
gdb_unlinker.h
gdb_vecs.c
gdb_vecs.h
gdb_wait.h
host-defs.h
job-control.c
job-control.h
mingw-strerror.c
new-op.c
offset-type.h
poison.h
posix-strerror.c
preprocessor.h Add STRINGIFY to gdb/common/preprocessor.h 2017-06-22 10:59:42 +01:00
print-utils.c
print-utils.h
ptid.c
ptid.h
queue.h
refcounted-object.h
rsp-low.c Implement the ability to set/unset environment variables to GDBserver when starting the inferior 2017-08-31 17:22:10 -04:00
rsp-low.h Implement the ability to set/unset environment variables to GDBserver when starting the inferior 2017-08-31 17:22:10 -04:00
run-time-clock.c
run-time-clock.h
scoped_restore.h
selftest.c GDBserver self tests 2017-08-18 09:20:43 +01:00
selftest.h GDBserver self tests 2017-08-18 09:20:43 +01:00
signals-state-save-restore.c
signals-state-save-restore.h
signals.c
symbol.h
traits.h
underlying.h
valid-expr.h
vec.c
vec.h vec: Silence -Wunused-function warnings on clang 2017-06-26 16:51:17 +02:00
version.h
x86-xstate.h
xml-utils.c
xml-utils.h