When writing a new commit graph we have a couple of counters that provide statistics around what kind of bloom filters we have or have not written. These counters naturally count from zero and are only ever incremented, but they use a signed integer as type regardless. Refactor those fields to be of type `size_t` instead. Signed-off-by: Patrick Steinhardt <ps@xxxxxx> --- commit-graph.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/commit-graph.c b/commit-graph.c index bd7b6f5338..a7a1a761bc 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -1170,11 +1170,11 @@ struct write_commit_graph_context { size_t total_bloom_filter_data_size; const struct bloom_filter_settings *bloom_settings; - int count_bloom_filter_computed; - int count_bloom_filter_not_computed; - int count_bloom_filter_trunc_empty; - int count_bloom_filter_trunc_large; - int count_bloom_filter_upgraded; + size_t count_bloom_filter_computed; + size_t count_bloom_filter_not_computed; + size_t count_bloom_filter_trunc_empty; + size_t count_bloom_filter_trunc_large; + size_t count_bloom_filter_upgraded; }; static int write_graph_chunk_fanout(struct hashfile *f, @@ -1779,16 +1779,16 @@ void ensure_generations_valid(struct repository *r, static void trace2_bloom_filter_write_statistics(struct write_commit_graph_context *ctx) { - trace2_data_intmax("commit-graph", ctx->r, "filter-computed", - ctx->count_bloom_filter_computed); - trace2_data_intmax("commit-graph", ctx->r, "filter-not-computed", - ctx->count_bloom_filter_not_computed); - trace2_data_intmax("commit-graph", ctx->r, "filter-trunc-empty", - ctx->count_bloom_filter_trunc_empty); - trace2_data_intmax("commit-graph", ctx->r, "filter-trunc-large", - ctx->count_bloom_filter_trunc_large); - trace2_data_intmax("commit-graph", ctx->r, "filter-upgraded", - ctx->count_bloom_filter_upgraded); + trace2_data_uintmax("commit-graph", ctx->r, "filter-computed", + ctx->count_bloom_filter_computed); + trace2_data_uintmax("commit-graph", ctx->r, "filter-not-computed", + ctx->count_bloom_filter_not_computed); + trace2_data_uintmax("commit-graph", ctx->r, "filter-trunc-empty", + ctx->count_bloom_filter_trunc_empty); + trace2_data_uintmax("commit-graph", ctx->r, "filter-trunc-large", + ctx->count_bloom_filter_trunc_large); + trace2_data_uintmax("commit-graph", ctx->r, "filter-upgraded", + ctx->count_bloom_filter_upgraded); } static void compute_bloom_filters(struct write_commit_graph_context *ctx) -- 2.50.1.723.g3e08bea96f.dirty