]> git.ipfire.org Git - thirdparty/git.git/commitdiff
reftable tests: avoid "int" overflow, use "uint64_t"
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 11 Jan 2022 16:40:23 +0000 (17:40 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 13 Jan 2022 21:39:09 +0000 (13:39 -0800)
Change code added in 1ae2b8cda84 (reftable: add merged table view,
2021-10-07) to consistently use the "uint64_t" type. These "min" and
"max" variables get passed in the body of this function to a function
whose prototype is:

    [...] reftable_writer_set_limits([...], uint64_t min, uint64_t max

This avoids the following warning on SunCC 12.5 on
gcc211.fsffrance.org:

    "reftable/merged_test.c", line 27: warning: initializer does not fit or is out of range: 0xffffffff

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
reftable/merged_test.c

index abd34849fcadb12fda2899a1d04a0ff137935b34..d08c16abefbc3d8562c29cf1703d1a6908f71dcd 100644 (file)
@@ -24,8 +24,8 @@ https://developers.google.com/open-source/licenses/bsd
 static void write_test_table(struct strbuf *buf,
                             struct reftable_ref_record refs[], int n)
 {
-       int min = 0xffffffff;
-       int max = 0;
+       uint64_t min = 0xffffffff;
+       uint64_t max = 0;
        int i = 0;
        int err;