]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
make serial_ops const
authorTom Tromey <tromey@redhat.com>
Fri, 6 Dec 2013 17:58:50 +0000 (10:58 -0700)
committerTom Tromey <tromey@redhat.com>
Thu, 19 Dec 2013 15:50:46 +0000 (08:50 -0700)
commitfcd488ca4e57141ac8ad28b6a5f560f3b9753a67
tree9ddf9dc34ee2b40684c7a87372439e17745c5935
parentd493b2839b90ba7f4b5200505f94e45268777d7b
make serial_ops const

I noticed that the serial_ops vtable is not const, but really it ought
to be.

This patch constifies it, removing the only mutable field in the
process.

Tested by rebuilding on x86-64 Fedora 18, both natively and using the
mingw cross tools.

2013-12-19  Tom Tromey  <tromey@redhat.com>

* serial.c (serial_ops_p): New typedef.
(serial_ops_list): Now a VEC.
(serial_interface_lookup): Return const.  Use VEC_iterate.
(serial_add_interface): Make parameter const.
(serial_open): Update.
(serial_fdopen_ops): Make 'ops' const.
(serial_pipe): Update.
* ser-tcp.c (_initialize_ser_tcp): Update.
* ser-pipe.c (_initialize_ser_pipe): Update.
* ser-unix.c (_initialize_ser_hardwire): Update.
* ser-mingw.c (_initialize_ser_windows): Update.
* ser-go32.c (dos_ops): Now const.  Update.
* serial.h (struct serial) <ops>: Now const.
(struct serial_ops) <next>: Remove.
(serial_add_interface): Make parameter const.
gdb/ChangeLog
gdb/ser-go32.c
gdb/ser-mingw.c
gdb/ser-pipe.c
gdb/ser-tcp.c
gdb/ser-unix.c
gdb/serial.c
gdb/serial.h