diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2018-12-27 13:47:34 -0600 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2019-01-22 22:30:35 +0000 |
| commit | f673e232afe22eb865cdc915e55a2df6493f0fbb (patch) | |
| tree | e79e3e6fb1e1d78367679aea75e66c8141b4daa8 /src/sortedcache.c | |
| parent | 647dfdb42d06514a85c1499f1be88a32b8a4c24b (diff) | |
| download | libgit2-f673e232afe22eb865cdc915e55a2df6493f0fbb.tar.gz | |
git_error: use new names in internal APIs and usage
Move to the `git_error` name in the internal API for error-related
functions.
Diffstat (limited to 'src/sortedcache.c')
| -rw-r--r-- | src/sortedcache.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/sortedcache.c b/src/sortedcache.c index bb42c67c2..02a685e10 100644 --- a/src/sortedcache.c +++ b/src/sortedcache.c @@ -20,10 +20,10 @@ int git_sortedcache_new( pathlen = path ? strlen(path) : 0; - GITERR_CHECK_ALLOC_ADD(&alloclen, sizeof(git_sortedcache), pathlen); - GITERR_CHECK_ALLOC_ADD(&alloclen, alloclen, 1); + GIT_ERROR_CHECK_ALLOC_ADD(&alloclen, sizeof(git_sortedcache), pathlen); + GIT_ERROR_CHECK_ALLOC_ADD(&alloclen, alloclen, 1); sc = git__calloc(1, alloclen); - GITERR_CHECK_ALLOC(sc); + GIT_ERROR_CHECK_ALLOC(sc); git_pool_init(&sc->pool, 1); @@ -32,7 +32,7 @@ int git_sortedcache_new( goto fail; if (git_rwlock_init(&sc->lock)) { - giterr_set(GITERR_OS, "failed to initialize lock"); + git_error_set(GIT_ERROR_OS, "failed to initialize lock"); goto fail; } @@ -167,7 +167,7 @@ int git_sortedcache_wlock(git_sortedcache *sc) GIT_UNUSED(sc); /* prevent warning when compiled w/o threads */ if (git_rwlock_wrlock(&sc->lock) < 0) { - giterr_set(GITERR_OS, "unable to acquire write lock on cache"); + git_error_set(GIT_ERROR_OS, "unable to acquire write lock on cache"); return -1; } return 0; @@ -186,7 +186,7 @@ int git_sortedcache_rlock(git_sortedcache *sc) GIT_UNUSED(sc); /* prevent warning when compiled w/o threads */ if (git_rwlock_rdlock(&sc->lock) < 0) { - giterr_set(GITERR_OS, "unable to acquire read lock on cache"); + git_error_set(GIT_ERROR_OS, "unable to acquire read lock on cache"); return -1; } return 0; @@ -219,14 +219,14 @@ int git_sortedcache_lockandload(git_sortedcache *sc, git_buf *buf) } if (p_fstat(fd, &st) < 0) { - giterr_set(GITERR_OS, "failed to stat file"); + git_error_set(GIT_ERROR_OS, "failed to stat file"); error = -1; (void)p_close(fd); goto unlock; } if (!git__is_sizet(st.st_size)) { - giterr_set(GITERR_INVALID, "unable to load file larger than size_t"); + git_error_set(GIT_ERROR_INVALID, "unable to load file larger than size_t"); error = -1; (void)p_close(fd); goto unlock; @@ -287,7 +287,7 @@ int git_sortedcache_upsert(void **out, git_sortedcache *sc, const char *key) itemlen = (itemlen + 7) & ~7; if ((item = git_pool_mallocz(&sc->pool, (uint32_t)itemlen)) == NULL) { - /* don't use GITERR_CHECK_ALLOC b/c of lock */ + /* don't use GIT_ERROR_CHECK_ALLOC b/c of lock */ error = -1; goto done; } @@ -378,7 +378,7 @@ int git_sortedcache_remove(git_sortedcache *sc, size_t pos) */ if ((item = git_vector_get(&sc->items, pos)) == NULL) { - giterr_set(GITERR_INVALID, "removing item out of range"); + git_error_set(GIT_ERROR_INVALID, "removing item out of range"); return GIT_ENOTFOUND; } |
