]> git.ipfire.org Git - thirdparty/git.git/commitdiff
object-file.c: LLP64 compatibility, upcast unity for left shift
authorPhilip Oakley <philipoakley@iee.email>
Wed, 1 Dec 2021 00:29:02 +0000 (00:29 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Dec 2021 22:48:10 +0000 (14:48 -0800)
Visual Studio reports C4334 "was 64-bit shift intended" warning because
of size miss-match.

Promote unity to the matching type to fit with the assignment.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
object-file.c

index c3d866a287e03ad0ae5de97ab6a352887c92e233..da8821cb919f62fb8c32d997ca877a751259a703 100644 (file)
@@ -2425,7 +2425,7 @@ struct oidtree *odb_loose_cache(struct object_directory *odb,
        struct strbuf buf = STRBUF_INIT;
        size_t word_bits = bitsizeof(odb->loose_objects_subdir_seen[0]);
        size_t word_index = subdir_nr / word_bits;
-       size_t mask = 1u << (subdir_nr % word_bits);
+       size_t mask = (size_t)1u << (subdir_nr % word_bits);
        uint32_t *bitmap;
 
        if (subdir_nr < 0 ||