summaryrefslogtreecommitdiff
path: root/src/oid.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/oid.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/oid.c')
-rw-r--r--src/oid.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/oid.c b/src/oid.c
index 7f0a520aa..d072f0ff6 100644
--- a/src/oid.c
+++ b/src/oid.c
@@ -260,6 +260,8 @@ git_oid_shorten *git_oid_shorten_new(size_t min_length)
{
git_oid_shorten *os;
+ assert((size_t)((int)min_length) == min_length);
+
os = git__calloc(1, sizeof(git_oid_shorten));
if (os == NULL)
return NULL;
@@ -270,7 +272,7 @@ git_oid_shorten *git_oid_shorten_new(size_t min_length)
}
os->node_count = 1;
- os->min_length = min_length;
+ os->min_length = (int)min_length;
return os;
}
@@ -328,7 +330,8 @@ void git_oid_shorten_free(git_oid_shorten *os)
*/
int git_oid_shorten_add(git_oid_shorten *os, const char *text_oid)
{
- int i, is_leaf;
+ int i;
+ bool is_leaf;
node_index idx;
if (os->full)
@@ -338,7 +341,7 @@ int git_oid_shorten_add(git_oid_shorten *os, const char *text_oid)
return os->min_length;
idx = 0;
- is_leaf = 0;
+ is_leaf = false;
for (i = 0; i < GIT_OID_HEXSZ; ++i) {
int c = git__fromhex(text_oid[i]);
@@ -368,11 +371,11 @@ int git_oid_shorten_add(git_oid_shorten *os, const char *text_oid)
}
idx = node->children[c];
- is_leaf = 0;
+ is_leaf = false;
if (idx < 0) {
node->children[c] = idx = -idx;
- is_leaf = 1;
+ is_leaf = true;
}
}