vendor/libgit2/src/mwindow.c in rugged-0.27.10.1 vs vendor/libgit2/src/mwindow.c in rugged-0.28.0
- old
+ new
@@ -49,18 +49,18 @@
int git_mwindow_get_pack(struct git_pack_file **out, const char *path)
{
int error;
char *packname;
- git_strmap_iter pos;
+ size_t pos;
struct git_pack_file *pack;
if ((error = git_packfile__name(&packname, path)) < 0)
return error;
if (git_mutex_lock(&git__mwindow_mutex) < 0) {
- giterr_set(GITERR_OS, "failed to lock mwindow mutex");
+ git_error_set(GIT_ERROR_OS, "failed to lock mwindow mutex");
return -1;
}
pos = git_strmap_lookup_index(git__pack_cache, packname);
git__free(packname);
@@ -95,11 +95,11 @@
}
void git_mwindow_put_pack(struct git_pack_file *pack)
{
int count;
- git_strmap_iter pos;
+ size_t pos;
if (git_mutex_lock(&git__mwindow_mutex) < 0)
return;
/* put before get would be a corrupted state */
@@ -120,11 +120,11 @@
}
void git_mwindow_free_all(git_mwindow_file *mwf)
{
if (git_mutex_lock(&git__mwindow_mutex)) {
- giterr_set(GITERR_THREAD, "unable to lock mwindow mutex");
+ git_error_set(GIT_ERROR_THREAD, "unable to lock mwindow mutex");
return;
}
git_mwindow_free_all_locked(mwf);
@@ -227,11 +227,11 @@
if (lru_w != last)
list = &cur->windows;
}
if (!lru_w) {
- giterr_set(GITERR_OS, "failed to close memory window; couldn't find LRU");
+ git_error_set(GIT_ERROR_OS, "failed to close memory window; couldn't find LRU");
return -1;
}
ctl->mapped -= lru_w->window_map.len;
git_futils_mmap_free(&lru_w->window_map);
@@ -322,11 +322,11 @@
{
git_mwindow_ctl *ctl = &mem_ctl;
git_mwindow *w = *cursor;
if (git_mutex_lock(&git__mwindow_mutex)) {
- giterr_set(GITERR_THREAD, "unable to lock mwindow mutex");
+ git_error_set(GIT_ERROR_THREAD, "unable to lock mwindow mutex");
return NULL;
}
if (!w || !(git_mwindow_contains(w, offset) && git_mwindow_contains(w, offset + extra))) {
if (w) {
@@ -374,11 +374,11 @@
{
git_mwindow_ctl *ctl = &mem_ctl;
int ret;
if (git_mutex_lock(&git__mwindow_mutex)) {
- giterr_set(GITERR_THREAD, "unable to lock mwindow mutex");
+ git_error_set(GIT_ERROR_THREAD, "unable to lock mwindow mutex");
return -1;
}
if (ctl->windowfiles.length == 0 &&
git_vector_init(&ctl->windowfiles, 8, NULL) < 0) {
@@ -414,10 +414,10 @@
void git_mwindow_close(git_mwindow **window)
{
git_mwindow *w = *window;
if (w) {
if (git_mutex_lock(&git__mwindow_mutex)) {
- giterr_set(GITERR_THREAD, "unable to lock mwindow mutex");
+ git_error_set(GIT_ERROR_THREAD, "unable to lock mwindow mutex");
return;
}
w->inuse_cnt--;
git_mutex_unlock(&git__mwindow_mutex);