diff options
author | Tom Tromey <tromey@redhat.com> | 2013-12-06 10:58:50 -0700 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-12-19 08:50:46 -0700 |
commit | fcd488ca4e57141ac8ad28b6a5f560f3b9753a67 (patch) | |
tree | 9ddf9dc34ee2b40684c7a87372439e17745c5935 /gdb/ser-mingw.c | |
parent | d493b2839b90ba7f4b5200505f94e45268777d7b (diff) | |
download | gdb-fcd488ca4e57141ac8ad28b6a5f560f3b9753a67.zip gdb-fcd488ca4e57141ac8ad28b6a5f560f3b9753a67.tar.gz gdb-fcd488ca4e57141ac8ad28b6a5f560f3b9753a67.tar.bz2 |
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.
Diffstat (limited to 'gdb/ser-mingw.c')
-rw-r--r-- | gdb/ser-mingw.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/gdb/ser-mingw.c b/gdb/ser-mingw.c index 0431ea9..eef40ce 100644 --- a/gdb/ser-mingw.c +++ b/gdb/ser-mingw.c @@ -1232,7 +1232,6 @@ _initialize_ser_windows (void) ops = XMALLOC (struct serial_ops); memset (ops, 0, sizeof (struct serial_ops)); ops->name = "hardwire"; - ops->next = 0; ops->open = ser_windows_open; ops->close = ser_windows_close; @@ -1268,7 +1267,6 @@ _initialize_ser_windows (void) memset (ops, 0, sizeof (struct serial_ops)); ops->name = "terminal"; - ops->next = 0; ops->close = ser_console_close; ops->get_tty_state = ser_console_get_tty_state; @@ -1287,7 +1285,6 @@ _initialize_ser_windows (void) ops = XMALLOC (struct serial_ops); memset (ops, 0, sizeof (struct serial_ops)); ops->name = "pipe"; - ops->next = 0; ops->open = pipe_windows_open; ops->close = pipe_windows_close; ops->fdopen = pipe_windows_fdopen; @@ -1323,7 +1320,6 @@ _initialize_ser_windows (void) ops = XMALLOC (struct serial_ops); memset (ops, 0, sizeof (struct serial_ops)); ops->name = "tcp"; - ops->next = 0; ops->open = net_windows_open; ops->close = net_windows_close; ops->readchar = ser_base_readchar; |