Convert inflow to type-safe registry API
authorTom Tromey <tom@tromey.com>
Sun, 21 Apr 2019 15:20:20 +0000 (09:20 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 8 May 2019 22:01:46 +0000 (16:01 -0600)
commit6509b8ebfb19769d726c16eb3a8967ac6784f621
tree6cd0e48fcc4e659250289cb2cb5d71ac8879d3f6
parent35632941c90f406f69512c9559ae7ba561f7eee8
Convert inflow to type-safe registry API

This changes inflow.c to use the type-safe registry API.  This fixes a
latent bug in swap_terminal_info, which previously said:

  terminal_info *info_a
    = (terminal_info *) inferior_data (a, inflow_inferior_data);
  terminal_info *info_b
    = (terminal_info *) inferior_data (a, inflow_inferior_data);

... both of which examine 'a'.

gdb/ChangeLog
2019-05-08  Tom Tromey  <tom@tromey.com>

* inflow.c (struct terminal_info): Add destructor and
initializers.
(inflow_inferior_data): Change type.
(~terminal_info): Rename from inflow_inferior_data_cleanup.
(get_inflow_inferior_data, inflow_inferior_exit)
(swap_terminal_info, _initialize_inflow): Update.
gdb/ChangeLog
gdb/inflow.c