Skip to content

Commit 321d19c

Browse files
committed
Windows is hard.
1 parent b5e8272 commit 321d19c

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

src/cc-compat.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,19 @@
5151
# if (SIZE_MAX == ULLONG_MAX)
5252
# define PRIuZ "I64u"
5353
# define PRIxZ "I64x"
54+
# define PRIXZ "I64X"
5455
# define PRIdZ "I64d"
5556
# else
5657
# define PRIuZ "Iu"
5758
# define PRIxZ "Ix"
59+
# define PRIXZ "IX"
5860
# define PRIdZ "Id"
5961
# endif
6062

6163
#else
6264
# define PRIuZ "zu"
6365
# define PRIxZ "zx"
66+
# define PRIXZ "zX"
6467
# define PRIdZ "zd"
6568
#endif
6669

src/transports/winhttp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ static int write_chunk(HINTERNET request, const char *buffer, size_t len)
631631
git_buf buf = GIT_BUF_INIT;
632632

633633
/* Chunk header */
634-
git_buf_printf(&buf, "%zX\r\n", len);
634+
git_buf_printf(&buf, "%"PRIXZ"\r\n", len);
635635

636636
if (git_buf_oom(&buf))
637637
return -1;

tests/clar_libgit2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#define cl_win32_pass(expr) do { \
4141
int _win32_res; \
4242
if ((_win32_res = (expr)) == 0) { \
43-
giterr_set(GITERR_OS, "Returned: %d, system error code: %d", _win32_res, GetLastError()); \
43+
giterr_set(GITERR_OS, "Returned: %d, system error code: %lu", _win32_res, GetLastError()); \
4444
cl_git_report_failure(_win32_res, 0, __FILE__, __LINE__, "System call failed: " #expr); \
4545
} \
4646
} while(0)

tests/index/addall.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ static void check_stat_data(git_index *index, const char *path, bool match)
123123
cl_assert(st.st_ctime == entry->ctime.seconds);
124124
cl_assert(st.st_mtime == entry->mtime.seconds);
125125
cl_assert(st.st_size == entry->file_size);
126-
cl_assert(st.st_uid == (uid_t)entry->uid);
127-
cl_assert(st.st_gid == (gid_t)entry->gid);
126+
cl_assert((uint32_t)st.st_uid == entry->uid);
127+
cl_assert((uint32_t)st.st_gid == entry->gid);
128128
cl_assert_equal_i_fmt(
129129
GIT_MODE_TYPE(st.st_mode), GIT_MODE_TYPE(entry->mode), "%07o");
130130
if (cl_is_chmod_supported())

0 commit comments

Comments
 (0)