Skip to content

Commit 4b27009

Browse files
authored
Merge pull request libgit2#6094 from visualgitio/commit-graph-long-long
Fix a long long that crept past
2 parents 734468d + 5761980 commit 4b27009

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

deps/ntlmclient/ntlm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -930,10 +930,10 @@ const char *ntlm_client_target_domain_dns(ntlm_client *ntlm)
930930
}
931931

932932
#define EVEN_PARITY(a) \
933-
(!!((a) & 0x01ll) ^ !!((a) & 0x02ll) ^ \
934-
!!((a) & 0x04ll) ^ !!((a) & 0x08ll) ^ \
935-
!!((a) & 0x10ll) ^ !!((a) & 0x20ll) ^ \
936-
!!((a) & 0x40ll) ^ !!((a) & 0x80ll))
933+
(!!((a) & INT64_C(0x01)) ^ !!((a) & INT64_C(0x02)) ^ \
934+
!!((a) & INT64_C(0x04)) ^ !!((a) & INT64_C(0x08)) ^ \
935+
!!((a) & INT64_C(0x10)) ^ !!((a) & INT64_C(0x20)) ^ \
936+
!!((a) & INT64_C(0x40)) ^ !!((a) & INT64_C(0x80)))
937937

938938
static void generate_odd_parity(ntlm_des_block *block)
939939
{

src/commit_graph.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,11 +1075,11 @@ static int commit_graph_write(
10751075
commit_time = (uint64_t)packed_commit->commit_time;
10761076
if (generation > GIT_COMMIT_GRAPH_GENERATION_NUMBER_MAX)
10771077
generation = GIT_COMMIT_GRAPH_GENERATION_NUMBER_MAX;
1078-
word = ntohl((uint32_t)((generation << 2) | ((commit_time >> 32ull) & 0x3ull)));
1078+
word = ntohl((uint32_t)((generation << 2) | (((uint32_t)(commit_time >> 32)) & 0x3) ));
10791079
error = git_str_put(&commit_data, (const char *)&word, sizeof(word));
10801080
if (error < 0)
10811081
goto cleanup;
1082-
word = ntohl((uint32_t)(commit_time & 0xffffffffull));
1082+
word = ntohl((uint32_t)(commit_time & 0xfffffffful));
10831083
error = git_str_put(&commit_data, (const char *)&word, sizeof(word));
10841084
if (error < 0)
10851085
goto cleanup;

0 commit comments

Comments
 (0)