summaryrefslogtreecommitdiff
path: root/src/path.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-04-13 13:00:10 -0700
committerRussell Belfer <rb@github.com>2012-04-17 10:47:39 -0700
commit44ef8b1b300f0cd3d8572fa1b40d257462f28240 (patch)
tree34f38bee213d1041fec7ac9dc4e63191182f3bf8 /src/path.c
parentf201d613a80f7ad6f54d90eb7a7a0d8b8c72676b (diff)
downloadlibgit2-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/path.c')
-rw-r--r--src/path.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/path.c b/src/path.c
index 3c1a723ea..a7cf4402f 100644
--- a/src/path.c
+++ b/src/path.c
@@ -464,21 +464,22 @@ int git_path_find_dir(git_buf *dir, const char *path, const char *base)
return error;
}
-int git_path_cmp(const char *name1, int len1, int isdir1,
- const char *name2, int len2, int isdir2)
+int git_path_cmp(
+ const char *name1, size_t len1, int isdir1,
+ const char *name2, size_t len2, int isdir2)
{
- int len = len1 < len2 ? len1 : len2;
+ size_t len = len1 < len2 ? len1 : len2;
int cmp;
cmp = memcmp(name1, name2, len);
if (cmp)
return cmp;
if (len1 < len2)
- return ((!isdir1 && !isdir2) ? -1 :
- (isdir1 ? '/' - name2[len1] : name2[len1] - '/'));
+ return (!isdir1 && !isdir2) ? -1 :
+ (isdir1 ? '/' - name2[len1] : name2[len1] - '/');
if (len1 > len2)
- return ((!isdir1 && !isdir2) ? 1 :
- (isdir2 ? name1[len2] - '/' : '/' - name1[len2]));
+ return (!isdir1 && !isdir2) ? 1 :
+ (isdir2 ? name1[len2] - '/' : '/' - name1[len2]);
return 0;
}