Skip to content

Commit 73046c8

Browse files
committed
Fix warnings on 'signed vs. unsigned' when compiling with statistics
1 parent e24a48d commit 73046c8

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

src/adiar/internal/algorithms/nested_sweeping.h

+21-21
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ namespace adiar::internal
542542
{
543543
if (a.source().is_nil() || (a.source().label() < _next_inner && a.target().is_node())) {
544544
#ifdef ADIAR_STATS
545-
nested_sweeping::stats.inner_down.requests.preserving += 1;
545+
nested_sweeping::stats.inner_down.requests.preserving += 1u;
546546
#endif
547547
_outer_roots.push(a);
548548
} else {
@@ -571,7 +571,7 @@ namespace adiar::internal
571571
adiar_assert(e.data.source.is_nil() || e.data.source.label() < _next_inner);
572572
if (e.target.first().is_terminal()) {
573573
#ifdef ADIAR_STATS
574-
nested_sweeping::stats.inner_down.requests.terminals += 1;
574+
nested_sweeping::stats.inner_down.requests.terminals += 1u;
575575
#endif
576576
_outer_pq.push({ e.data.source, e.target.first() });
577577
} else {
@@ -1004,11 +1004,11 @@ namespace adiar::internal
10041004

10051005
if (use_random_access) {
10061006
#ifdef ADIAR_STATS
1007-
stats.inner_down.ra_runs += 1;
1007+
stats.inner_down.ra_runs += 1u;
10081008
#endif
10091009
} else {
10101010
#ifdef ADIAR_STATS
1011-
stats.inner_down.pq_runs += 1;
1011+
stats.inner_down.pq_runs += 1u;
10121012
#endif
10131013
}
10141014

@@ -1218,12 +1218,12 @@ namespace adiar::internal
12181218
{
12191219
if (v.source().is_flagged()) {
12201220
#ifdef ADIAR_STATS
1221-
stats.inner_up.outer_arcs += 1;
1221+
stats.inner_up.outer_arcs += 1u;
12221222
#endif
12231223
_outer_pq.push(arc(unflag(v.source()), v.target()));
12241224
} else {
12251225
#ifdef ADIAR_STATS
1226-
stats.inner_up.inner_arcs += 1;
1226+
stats.inner_up.inner_arcs += 1u;
12271227
#endif
12281228
_inner_pq.push(v);
12291229
}
@@ -1500,13 +1500,13 @@ namespace adiar::internal
15001500
"level and priority queue should be in sync");
15011501

15021502
#ifdef ADIAR_STATS
1503-
nested_sweeping::stats.inner_up.reduced_levels += 1;
1503+
nested_sweeping::stats.inner_up.reduced_levels += 1u;
15041504
#endif
15051505

15061506
if (/*constexpr*/ !nesting_policy::final_canonical
15071507
|| (!is_last_inner && auto_fast_reduce)) {
15081508
#ifdef ADIAR_STATS
1509-
nested_sweeping::stats.inner_up.reduced_levels__fast += 1;
1509+
nested_sweeping::stats.inner_up.reduced_levels__fast += 1u;
15101510
#endif
15111511

15121512
nested_sweeping::__reduce_level__fast<nesting_policy>(
@@ -1677,12 +1677,12 @@ namespace adiar::internal
16771677
// classic Reduce sweep.
16781678
if (next_inner == inner_iter_t::end) {
16791679
#ifdef ADIAR_STATS
1680-
nested_sweeping::stats.skips += 1;
1680+
nested_sweeping::stats.skips += 1u;
16811681
#endif
16821682
return reduce<nesting_policy>(typename nesting_policy::__dd_type(dag, ep));
16831683
}
16841684
#ifdef ADIAR_STATS
1685-
nested_sweeping::stats.runs += 1;
1685+
nested_sweeping::stats.runs += 1u;
16861686

16871687
nested_sweeping::stats.outer_up.sum_node_arcs += dag->size(0);
16881688
nested_sweeping::stats.outer_up.sum_terminal_arcs += dag->size(1) + dag->size(2);
@@ -1761,12 +1761,12 @@ namespace adiar::internal
17611761
// Reduce this level (without decorators).
17621762
if (next_inner == inner_iter_t::end) {
17631763
#ifdef ADIAR_STATS
1764-
nested_sweeping::stats.outer_up.reduced_levels += 1;
1764+
nested_sweeping::stats.outer_up.reduced_levels += 1u;
17651765
#endif
17661766

17671767
if constexpr (!nesting_policy::final_canonical) {
17681768
#ifdef ADIAR_STATS
1769-
nested_sweeping::stats.outer_up.reduced_levels__fast += 1;
1769+
nested_sweeping::stats.outer_up.reduced_levels__fast += 1u;
17701770
#endif
17711771

17721772
nested_sweeping::__reduce_level__fast<nesting_policy>(outer_arcs,
@@ -1805,12 +1805,12 @@ namespace adiar::internal
18051805
outer_pq_decorator_t outer_pq_decorator(outer_pq, outer_roots, next_inner);
18061806

18071807
#ifdef ADIAR_STATS
1808-
nested_sweeping::stats.outer_up.reduced_levels += 1;
1808+
nested_sweeping::stats.outer_up.reduced_levels += 1u;
18091809
#endif
18101810

18111811
if (/*constexpr*/ !nesting_policy::final_canonical || auto_fast_reduce) {
18121812
#ifdef ADIAR_STATS
1813-
nested_sweeping::stats.outer_up.reduced_levels__fast += 1;
1813+
nested_sweeping::stats.outer_up.reduced_levels__fast += 1u;
18141814
#endif
18151815

18161816
nested_sweeping::__reduce_level__fast<nesting_policy>(outer_arcs,
@@ -1893,13 +1893,13 @@ namespace adiar::internal
18931893
return reduced_t(reduction_rule_ret.value());
18941894
}
18951895
#ifdef ADIAR_STATS
1896-
nested_sweeping::stats.inner_down.removed_by_rule_1 += 1;
1896+
nested_sweeping::stats.inner_down.removed_by_rule_1 += 1u;
18971897
#endif
18981898
outer_pq_decorator.push(arc(node::pointer_type::nil(), flag(reduction_rule_ret)));
18991899
} else {
19001900
do {
19011901
#ifdef ADIAR_STATS
1902-
nested_sweeping::stats.inner_down.removed_by_rule_1 += 1;
1902+
nested_sweeping::stats.inner_down.removed_by_rule_1 += 1u;
19031903
#endif
19041904
outer_pq_decorator.push(
19051905
arc(outer_arcs.pull_internal().source(), flag(reduction_rule_ret)));
@@ -1953,7 +1953,7 @@ namespace adiar::internal
19531953
// ---------------------------------------------------------------------
19541954
// Inner Down Sweep
19551955
#ifdef ADIAR_STATS
1956-
nested_sweeping::stats.outer_up.nested_levels += 1;
1956+
nested_sweeping::stats.outer_up.nested_levels += 1u;
19571957
#endif
19581958
adiar_assert(outer_roots.size() > 0, "Nested Sweep needs some number of requests");
19591959

@@ -2018,7 +2018,7 @@ namespace adiar::internal
20182018
// Bail out requests for a GC-only Inner Sweep (postponing doing so for
20192019
// a later sweep)
20202020
#ifdef ADIAR_STATS
2021-
nested_sweeping::stats.outer_up.skipped_nested_levels += 1;
2021+
nested_sweeping::stats.outer_up.skipped_nested_levels += 1u;
20222022
#endif
20232023
adiar_assert(next_inner <= nesting_policy::pointer_type::max_label,
20242024
"Has another later sweep to do possible garbage collection");
@@ -2042,8 +2042,8 @@ namespace adiar::internal
20422042
// ---------------------------------------------------------------------
20432043
// Nothing within 'outer_file' should survive
20442044
#ifdef ADIAR_STATS
2045-
nested_sweeping::stats.outer_up.skipped_nested_levels += 1;
2046-
nested_sweeping::stats.outer_up.skipped_nested_levels__prune += 1;
2045+
nested_sweeping::stats.outer_up.skipped_nested_levels += 1u;
2046+
nested_sweeping::stats.outer_up.skipped_nested_levels__prune += 1u;
20472047
#endif
20482048
if (outer_writer.size() != 0) {
20492049
outer_writer.detach();
@@ -2089,7 +2089,7 @@ namespace adiar::internal
20892089
outer_pq.setup_next_level(stop_level);
20902090
} else if (outer_file->is_terminal()) {
20912091
#ifdef ADIAR_STATS
2092-
nested_sweeping::stats.outer_up.collapse_to_terminal += 1;
2092+
nested_sweeping::stats.outer_up.collapse_to_terminal += 1u;
20932093
#endif
20942094
return outer_file;
20952095
}

src/adiar/internal/algorithms/quantify.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ namespace adiar::internal
182182
operator()(const Request& req) const
183183
{
184184
#ifdef ADIAR_STATS
185-
stats_quantify.requests[__quantify_arity_idx(req)] += 1;
185+
stats_quantify.requests[__quantify_arity_idx(req)] += 1u;
186186
#endif
187187
if (!req.data.source.is_nil()) {
188188
this->_aw.push_internal({ req.data.source, this->_out_uid });
@@ -242,7 +242,7 @@ namespace adiar::internal
242242
adiar_assert(req.data.source.is_nil() || req.data.source.level() < this->_t.first().level(),
243243
"Request should be forwarded downwards");
244244
#ifdef ADIAR_STATS
245-
stats_quantify.requests[__quantify_arity_idx(req)] += 1;
245+
stats_quantify.requests[__quantify_arity_idx(req)] += 1u;
246246
#endif
247247
this->_pq.push({ this->_t, {}, req.data });
248248
}
@@ -337,7 +337,7 @@ namespace adiar::internal
337337
quantify_request<0> req = pq.top();
338338

339339
#ifdef ADIAR_STATS
340-
stats_quantify.requests_unique[__quantify_arity_idx(req)] += 1;
340+
stats_quantify.requests_unique[__quantify_arity_idx(req)] += 1u;
341341
#endif
342342

343343
// Obtain of first to-be seen node
@@ -515,7 +515,7 @@ namespace adiar::internal
515515
"Level of requests always ought to match the one currently processed");
516516

517517
#ifdef ADIAR_STATS
518-
stats_quantify.requests_unique[__quantify_arity_idx(req)] += 1;
518+
stats_quantify.requests_unique[__quantify_arity_idx(req)] += 1u;
519519
#endif
520520

521521
// Recreate children of the two targeted nodes (or possibly the

0 commit comments

Comments
 (0)