[pushed] analyzer/text-art: fix clang warnings [PR110433,PR110612]
Checks
Commit Message
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as r14-2689-g7006f02bbc3f1d.
gcc/analyzer/ChangeLog:
PR analyzer/110433
PR middle-end/110612
* access-diagram.cc (class spatial_item): Add virtual dtor.
gcc/ChangeLog:
PR middle-end/110612
* text-art/table.cc (table_geometry::table_geometry): Drop m_table
field.
(table_geometry::table_x_to_canvas_x): Add cast to comparison.
(table_geometry::table_y_to_canvas_y): Likewise.
* text-art/table.h (table_geometry::m_table): Drop unused field.
* text-art/widget.h (wrapper_widget::update_child_alloc_rects):
Add "override".
---
gcc/analyzer/access-diagram.cc | 1 +
gcc/text-art/table.cc | 7 +++----
gcc/text-art/table.h | 1 -
gcc/text-art/widget.h | 2 +-
4 files changed, 5 insertions(+), 6 deletions(-)
@@ -1125,6 +1125,7 @@ private:
class spatial_item
{
public:
+ virtual ~spatial_item () {}
virtual void add_boundaries (boundaries &out, logger *) const = 0;
virtual table make_table (const bit_to_table_map &btm,
@@ -507,8 +507,7 @@ table_cell_sizes::get_canvas_size (const table::rect_t &rect) const
/* class text_art::table_geometry. */
table_geometry::table_geometry (const table &table, table_cell_sizes &cell_sizes)
-: m_table (table),
- m_cell_sizes (cell_sizes),
+: m_cell_sizes (cell_sizes),
m_canvas_size (canvas::size_t (0, 0)),
m_col_start_x (table.get_size ().w),
m_row_start_y (table.get_size ().h)
@@ -558,7 +557,7 @@ int
table_geometry::table_x_to_canvas_x (int table_x) const
{
/* Allow one beyond the end, for the right-hand border of the table. */
- if (table_x == m_col_start_x.size ())
+ if (table_x == (int)m_col_start_x.size ())
return m_canvas_size.w - 1;
return m_col_start_x[table_x];
}
@@ -570,7 +569,7 @@ int
table_geometry::table_y_to_canvas_y (int table_y) const
{
/* Allow one beyond the end, for the right-hand border of the table. */
- if (table_y == m_row_start_y.size ())
+ if (table_y == (int)m_row_start_y.size ())
return m_canvas_size.h - 1;
return m_row_start_y[table_y];
}
@@ -232,7 +232,6 @@ class table_geometry
}
private:
- const table &m_table;
table_cell_sizes &m_cell_sizes;
canvas::size_t m_canvas_size;
@@ -148,7 +148,7 @@ class wrapper_widget : public widget
{
return m_child->get_req_size ();
}
- void update_child_alloc_rects ()
+ void update_child_alloc_rects () override
{
m_child->set_alloc_rect (get_alloc_rect ());
}