Merge pull request #6094 from visualgitio/commit-graph-long-long Fix a long long that crept past
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
diff --git a/deps/ntlmclient/ntlm.c b/deps/ntlmclient/ntlm.c
index 3393be9..ad4de5d 100644
--- a/deps/ntlmclient/ntlm.c
+++ b/deps/ntlmclient/ntlm.c
@@ -930,10 +930,10 @@ const char *ntlm_client_target_domain_dns(ntlm_client *ntlm)
}
#define EVEN_PARITY(a) \
- (!!((a) & 0x01ll) ^ !!((a) & 0x02ll) ^ \
- !!((a) & 0x04ll) ^ !!((a) & 0x08ll) ^ \
- !!((a) & 0x10ll) ^ !!((a) & 0x20ll) ^ \
- !!((a) & 0x40ll) ^ !!((a) & 0x80ll))
+ (!!((a) & INT64_C(0x01)) ^ !!((a) & INT64_C(0x02)) ^ \
+ !!((a) & INT64_C(0x04)) ^ !!((a) & INT64_C(0x08)) ^ \
+ !!((a) & INT64_C(0x10)) ^ !!((a) & INT64_C(0x20)) ^ \
+ !!((a) & INT64_C(0x40)) ^ !!((a) & INT64_C(0x80)))
static void generate_odd_parity(ntlm_des_block *block)
{
diff --git a/src/commit_graph.c b/src/commit_graph.c
index 924a399..292250f 100644
--- a/src/commit_graph.c
+++ b/src/commit_graph.c
@@ -1075,11 +1075,11 @@ static int commit_graph_write(
commit_time = (uint64_t)packed_commit->commit_time;
if (generation > GIT_COMMIT_GRAPH_GENERATION_NUMBER_MAX)
generation = GIT_COMMIT_GRAPH_GENERATION_NUMBER_MAX;
- word = ntohl((uint32_t)((generation << 2) | ((commit_time >> 32ull) & 0x3ull)));
+ word = ntohl((uint32_t)((generation << 2) | (((uint32_t)(commit_time >> 32)) & 0x3) ));
error = git_str_put(&commit_data, (const char *)&word, sizeof(word));
if (error < 0)
goto cleanup;
- word = ntohl((uint32_t)(commit_time & 0xffffffffull));
+ word = ntohl((uint32_t)(commit_time & 0xfffffffful));
error = git_str_put(&commit_data, (const char *)&word, sizeof(word));
if (error < 0)
goto cleanup;