From 677d6646a1b46103d19ebf97640dcfaab089788b Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Mon, 8 Jul 2024 15:33:39 +0330 Subject: [PATCH] [subset] Make sure the clamp is done in a int64_t space MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise nags about things like this, In member function ‘int64_t graph::graph_t::vertex_t::modified_distance(unsigned int) const’, inlined from ‘void graph::graph_t::sort_shortest_distance()’ at ../src/graph/graph.hh:626:24: ../src/graph/graph.hh:371:20: warning: dangling pointer to an unnamed temporary may be used [-Wdangling-pointer=] 371 | hb_clamp (distance + distance_modifier (), (uint64_t) 0, (uint64_t) 0x7FFFFFFFFFF); | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ And some of the CI bots fail also like this https://github.com/harfbuzz/harfbuzz/actions/runs/9838686960/job/27159310858?pr=4793 But it probably something else also can be improved which maybe is out of scope for this particular change. --- src/graph/graph.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graph/graph.hh b/src/graph/graph.hh index 29ff646cb..b24507ece 100644 --- a/src/graph/graph.hh +++ b/src/graph/graph.hh @@ -368,7 +368,7 @@ struct graph_t // it's parent where possible. int64_t modified_distance = - hb_clamp (distance + distance_modifier (), 0, 0x7FFFFFFFFFF); + hb_clamp (distance + distance_modifier (), (int64_t) 0, 0x7FFFFFFFFFF); if (has_max_priority ()) { modified_distance = 0; }