]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
analyzer/text-art: fix clang warnings [PR110433,PR110612]
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 21 Jul 2023 00:24:06 +0000 (20:24 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Fri, 21 Jul 2023 00:24:06 +0000 (20:24 -0400)
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".

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/analyzer/access-diagram.cc
gcc/text-art/table.cc
gcc/text-art/table.h
gcc/text-art/widget.h

index 467c9bdd7340f46814a810c3c1a99f04d3ee2200..d7b669a4e38e7e1886f8661d84368b15de16fdcf 100644 (file)
@@ -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,
index 71a1024625761b842d8afb7bbc7dccefb1e65dc7..2f857a0e2a7df2924d21da71c575af666555e96e 100644 (file)
@@ -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];
 }
index 2dc5c3c41cb7ebccd3977e4f15e9f077c2d81589..17eda912f1a8597fad4d75414a5301292ef30069 100644 (file)
@@ -232,7 +232,6 @@ class table_geometry
   }
 
  private:
-  const table &m_table;
   table_cell_sizes &m_cell_sizes;
   canvas::size_t m_canvas_size;
 
index 8798e436d94de3910003c398272c31b68612fdd2..5156a7ea5720f6dce38d24e1a47a840b3086b895 100644 (file)
@@ -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 ());
   }