Commit 26a23d11 by David Malcolm Committed by David Malcolm

Const-correctness fixes for fibonacci_heap.h

gcc/ChangeLog:
	* fibonacci_heap.h (fibonacci_heap::empty): Make const.
	(fibonacci_heap::nodes): Likewise.
	(fibonacci_heap::min_key): Likewise.
	(fibonacci_heap::min): Likewise.

From-SVN: r276193
parent 1a120ec1
2019-09-27 David Malcolm <dmalcolm@redhat.com> 2019-09-27 David Malcolm <dmalcolm@redhat.com>
* fibonacci_heap.h (fibonacci_heap::empty): Make const.
(fibonacci_heap::nodes): Likewise.
(fibonacci_heap::min_key): Likewise.
(fibonacci_heap::min): Likewise.
2019-09-27 David Malcolm <dmalcolm@redhat.com>
* cgraph.c (cgraph_node::get_fun): Make const. * cgraph.c (cgraph_node::get_fun): Make const.
* cgraph.h (cgraph_node::get_fun): Likewise. * cgraph.h (cgraph_node::get_fun): Likewise.
......
...@@ -162,19 +162,19 @@ public: ...@@ -162,19 +162,19 @@ public:
fibonacci_node_t *insert (K key, V *data); fibonacci_node_t *insert (K key, V *data);
/* Return true if no entry is present. */ /* Return true if no entry is present. */
bool empty () bool empty () const
{ {
return m_nodes == 0; return m_nodes == 0;
} }
/* Return the number of nodes. */ /* Return the number of nodes. */
size_t nodes () size_t nodes () const
{ {
return m_nodes; return m_nodes;
} }
/* Return minimal key presented in the heap. */ /* Return minimal key presented in the heap. */
K min_key () K min_key () const
{ {
if (m_min == NULL) if (m_min == NULL)
gcc_unreachable (); gcc_unreachable ();
...@@ -206,7 +206,7 @@ public: ...@@ -206,7 +206,7 @@ public:
V *extract_min (bool release = true); V *extract_min (bool release = true);
/* Return value associated with minimum node in the heap. */ /* Return value associated with minimum node in the heap. */
V *min () V *min () const
{ {
if (m_min == NULL) if (m_min == NULL)
return NULL; return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment