Add comments describing tui_ui_out and its fields, cleanup a bit
authorPedro Alves <palves@redhat.com>
Tue, 19 Mar 2019 18:08:27 +0000 (18:08 +0000)
committerPedro Alves <palves@redhat.com>
Tue, 19 Mar 2019 18:08:27 +0000 (18:08 +0000)
commitcb24623460fe3e68794b79b79b0dbd5e62598d85
tree7ef3e9ff92a4c93a8523147710fec5d3d4838aea
parent634557801d909982b47b1723f4216ebe8bc784aa
Add comments describing tui_ui_out and its fields, cleanup a bit

This commit add comments describing tui_ui_out and its fields, and
cleans up the code a little bit.

Also switch to using in-class initialization so that the initial
values can be seen alongside the comments.

I see no reason for initializing m_line as -1 instead of 0, since all
the checks in the .c file are of the form "> 0".  AFAICS there's no
practical difference between -1 and 0.  So it seems simpler to
initialize it as 0.

There's a bit of redundancy in tui_ui_out::do_field_string, which is
fixed by this commit.

gdb/ChangeLog:
2019-03-19  Pedro Alves  <palves@redhat.com>

* tui/tui-out.c (tui_ui_out::do_field_string): Simplify.
(tui_ui_out::do_text): Add comments.  Reset M_LINE to 0 instead of
to -1.  Fix TABs vs spaces.
(tui_ui_out::tui_ui_out): Don't initialize fields here.
* tui/tui-out.h (tui_ui_out) Add intro comments.
<m_line, m_start_of_line>: In-class initialize, and add describing
comment.
gdb/ChangeLog
gdb/tui/tui-out.c
gdb/tui/tui-out.h
This page took 0.024329 seconds and 4 git commands to generate.