Fix MSVC amd64 compilation warnings
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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
diff --git a/src/checkout.c b/src/checkout.c
index 730e8a4..89f7354 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -25,7 +25,7 @@
struct checkout_diff_data
{
git_buf *path;
- int workdir_len;
+ size_t workdir_len;
git_checkout_opts *checkout_opts;
git_indexer_stats *stats;
git_repository *owner;
diff --git a/src/diff_output.c b/src/diff_output.c
index 37cceff..58a1a35 100644
--- a/src/diff_output.c
+++ b/src/diff_output.c
@@ -1354,9 +1354,9 @@ int git_diff_iterator_num_lines_in_hunk(git_diff_iterator *iter)
return error;
if (iter->hunk_curr)
- return iter->hunk_curr->line_count;
+ return (int)iter->hunk_curr->line_count;
if (iter->hunk_head)
- return iter->hunk_head->line_count;
+ return (int)iter->hunk_head->line_count;
return 0;
}
diff --git a/src/transports/http.c b/src/transports/http.c
index 456b85e..d5015f5 100644
--- a/src/transports/http.c
+++ b/src/transports/http.c
@@ -166,7 +166,7 @@ static int send_request(transport_http *t, const char *service, void *data, ssiz
}
if (WinHttpSendRequest(t->request, WINHTTP_NO_ADDITIONAL_HEADERS, 0,
- data, content_length, content_length, 0) == FALSE) {
+ data, (DWORD)content_length, (DWORD)content_length, 0) == FALSE) {
giterr_set(GITERR_OS, "Failed to send request");
goto on_error;
}
diff --git a/src/win32/utf-conv.c b/src/win32/utf-conv.c
index 88a8414..396af7c 100644
--- a/src/win32/utf-conv.c
+++ b/src/win32/utf-conv.c
@@ -72,7 +72,7 @@ void git__utf8_to_16(wchar_t *dest, size_t length, const char *src)
void git__utf8_to_16(wchar_t *dest, size_t length, const char *src)
{
- MultiByteToWideChar(CP_UTF8, 0, src, -1, dest, length);
+ MultiByteToWideChar(CP_UTF8, 0, src, -1, dest, (int)length);
}
void git__utf16_to_8(char *out, const wchar_t *input)