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

Promote unity to the matching type to fit with the `&` operator.

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

index 0b2d1e5d82bedb38570ab056f029bdd3c24e1c5f..6da66474fd4429aee2bfabe621ffc045e9b8566a 100644 (file)
@@ -842,7 +842,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
                        fname_old = mkpathdup("%s-%s%s",
                                        packtmp, item->string, exts[ext].name);
 
-                       if (((uintptr_t)item->util) & (1 << ext)) {
+                       if (((uintptr_t)item->util) & ((uintptr_t)1 << ext)) {
                                struct stat statbuffer;
                                if (!stat(fname_old, &statbuffer)) {
                                        statbuffer.st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);