Windows is hard.
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 56 57 58 59 60 61 62 63 64 65
diff --git a/src/cc-compat.h b/src/cc-compat.h
index 5d3e652..893c2a4 100644
--- a/src/cc-compat.h
+++ b/src/cc-compat.h
@@ -51,16 +51,19 @@
# if (SIZE_MAX == ULLONG_MAX)
# define PRIuZ "I64u"
# define PRIxZ "I64x"
+# define PRIXZ "I64X"
# define PRIdZ "I64d"
# else
# define PRIuZ "Iu"
# define PRIxZ "Ix"
+# define PRIXZ "IX"
# define PRIdZ "Id"
# endif
#else
# define PRIuZ "zu"
# define PRIxZ "zx"
+# define PRIXZ "zX"
# define PRIdZ "zd"
#endif
diff --git a/src/transports/winhttp.c b/src/transports/winhttp.c
index f605695..11b4298 100644
--- a/src/transports/winhttp.c
+++ b/src/transports/winhttp.c
@@ -631,7 +631,7 @@ static int write_chunk(HINTERNET request, const char *buffer, size_t len)
git_buf buf = GIT_BUF_INIT;
/* Chunk header */
- git_buf_printf(&buf, "%zX\r\n", len);
+ git_buf_printf(&buf, "%"PRIXZ"\r\n", len);
if (git_buf_oom(&buf))
return -1;
diff --git a/tests/clar_libgit2.h b/tests/clar_libgit2.h
index 618aed0..8a0ff4f 100644
--- a/tests/clar_libgit2.h
+++ b/tests/clar_libgit2.h
@@ -40,7 +40,7 @@
#define cl_win32_pass(expr) do { \
int _win32_res; \
if ((_win32_res = (expr)) == 0) { \
- giterr_set(GITERR_OS, "Returned: %d, system error code: %d", _win32_res, GetLastError()); \
+ giterr_set(GITERR_OS, "Returned: %d, system error code: %lu", _win32_res, GetLastError()); \
cl_git_report_failure(_win32_res, 0, __FILE__, __LINE__, "System call failed: " #expr); \
} \
} while(0)
diff --git a/tests/index/addall.c b/tests/index/addall.c
index 12b05a7..992cd87 100644
--- a/tests/index/addall.c
+++ b/tests/index/addall.c
@@ -123,8 +123,8 @@ static void check_stat_data(git_index *index, const char *path, bool match)
cl_assert(st.st_ctime == entry->ctime.seconds);
cl_assert(st.st_mtime == entry->mtime.seconds);
cl_assert(st.st_size == entry->file_size);
- cl_assert(st.st_uid == (uid_t)entry->uid);
- cl_assert(st.st_gid == (gid_t)entry->gid);
+ cl_assert((uint32_t)st.st_uid == entry->uid);
+ cl_assert((uint32_t)st.st_gid == entry->gid);
cl_assert_equal_i_fmt(
GIT_MODE_TYPE(st.st_mode), GIT_MODE_TYPE(entry->mode), "%07o");
if (cl_is_chmod_supported())