summaryrefslogtreecommitdiff
path: root/src/pqueue.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/pqueue.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/pqueue.c')
-rw-r--r--src/pqueue.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pqueue.c b/src/pqueue.c
index 3fbf93315..cb59c13ec 100644
--- a/src/pqueue.c
+++ b/src/pqueue.c
@@ -17,14 +17,14 @@ int git_pqueue_init(git_pqueue *q, size_t n, git_pqueue_cmp cmppri)
assert(q);
/* Need to allocate n+1 elements since element 0 isn't used. */
- if ((q->d = git__malloc((n + 1) * sizeof(void *))) == NULL)
- return GIT_ENOMEM;
+ q->d = git__malloc((n + 1) * sizeof(void *));
+ GITERR_CHECK_ALLOC(q->d);
q->size = 1;
q->avail = q->step = (n + 1); /* see comment above about n+1 */
q->cmppri = cmppri;
- return GIT_SUCCESS;
+ return 0;
}
@@ -102,8 +102,8 @@ int git_pqueue_insert(git_pqueue *q, void *d)
/* allocate more memory if necessary */
if (q->size >= q->avail) {
newsize = q->size + q->step;
- if ((tmp = git__realloc(q->d, sizeof(void *) * newsize)) == NULL)
- return GIT_ENOMEM;
+ tmp = git__realloc(q->d, sizeof(void *) * newsize);
+ GITERR_CHECK_ALLOC(tmp);
q->d = tmp;
q->avail = newsize;
@@ -114,7 +114,7 @@ int git_pqueue_insert(git_pqueue *q, void *d)
q->d[i] = d;
bubble_up(q, i);
- return GIT_SUCCESS;
+ return 0;
}