diff options
author | Russell Belfer <rb@github.com> | 2012-04-13 13:00:10 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2012-04-17 10:47:39 -0700 |
commit | 44ef8b1b300f0cd3d8572fa1b40d257462f28240 (patch) | |
tree | 34f38bee213d1041fec7ac9dc4e63191182f3bf8 /src/posix.c | |
parent | f201d613a80f7ad6f54d90eb7a7a0d8b8c72676b (diff) | |
download | libgit2-44ef8b1b300f0cd3d8572fa1b40d257462f28240.tar.gz |
Fix warnings on 64-bit windows builds
This fixes all the warnings on win64 except those in deps, which
come from the regex code.
Diffstat (limited to 'src/posix.c')
-rw-r--r-- | src/posix.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/posix.c b/src/posix.c index 977880999..a3f81d767 100644 --- a/src/posix.c +++ b/src/posix.c @@ -58,7 +58,13 @@ int p_read(git_file fd, void *buf, size_t cnt) { char *b = buf; while (cnt) { - ssize_t r = read(fd, b, cnt); + ssize_t r; +#ifdef GIT_WIN32 + assert((size_t)((unsigned int)cnt) == cnt); + r = read(fd, b, (unsigned int)cnt); +#else + r = read(fd, b, cnt); +#endif if (r < 0) { if (errno == EINTR || errno == EAGAIN) continue; @@ -76,7 +82,13 @@ int p_write(git_file fd, const void *buf, size_t cnt) { const char *b = buf; while (cnt) { - ssize_t r = write(fd, b, cnt); + ssize_t r; +#ifdef GIT_WIN32 + assert((size_t)((unsigned int)cnt) == cnt); + r = write(fd, b, (unsigned int)cnt); +#else + r = write(fd, b, cnt); +#endif if (r < 0) { if (errno == EINTR || errno == EAGAIN) continue; |