public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [pushed] analyzer/text-art: fix clang warnings [PR110433,PR110612]
@ 2023-07-21  0:32 David Malcolm
  0 siblings, 0 replies; only message in thread
From: David Malcolm @ 2023-07-21  0:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: David Malcolm

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(-)

diff --git a/gcc/analyzer/access-diagram.cc b/gcc/analyzer/access-diagram.cc
index 467c9bdd734..d7b669a4e38 100644
--- a/gcc/analyzer/access-diagram.cc
+++ b/gcc/analyzer/access-diagram.cc
@@ -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,
diff --git a/gcc/text-art/table.cc b/gcc/text-art/table.cc
index 71a10246257..2f857a0e2a7 100644
--- a/gcc/text-art/table.cc
+++ b/gcc/text-art/table.cc
@@ -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];
 }
diff --git a/gcc/text-art/table.h b/gcc/text-art/table.h
index 2dc5c3c41cb..17eda912f1a 100644
--- a/gcc/text-art/table.h
+++ b/gcc/text-art/table.h
@@ -232,7 +232,6 @@ class table_geometry
   }
 
  private:
-  const table &m_table;
   table_cell_sizes &m_cell_sizes;
   canvas::size_t m_canvas_size;
 
diff --git a/gcc/text-art/widget.h b/gcc/text-art/widget.h
index 8798e436d94..5156a7ea572 100644
--- a/gcc/text-art/widget.h
+++ b/gcc/text-art/widget.h
@@ -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 ());
   }
-- 
2.26.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-21  0:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-21  0:32 [pushed] analyzer/text-art: fix clang warnings [PR110433,PR110612] David Malcolm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).