diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2018-12-27 22:47:34 +0300 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2019-01-23 01:30:35 +0300 |
commit | f673e232afe22eb865cdc915e55a2df6493f0fbb (patch) | |
tree | e79e3e6fb1e1d78367679aea75e66c8141b4daa8 /src/iterator.c | |
parent | 647dfdb42d06514a85c1499f1be88a32b8a4c24b (diff) |
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/iterator.c')
-rw-r--r-- | src/iterator.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/iterator.c b/src/iterator.c index b12c8ff0a..90bbb813b 100644 --- a/src/iterator.c +++ b/src/iterator.c @@ -46,14 +46,14 @@ static int iterator_range_init( { if (start && *start) { iter->start = git__strdup(start); - GITERR_CHECK_ALLOC(iter->start); + GIT_ERROR_CHECK_ALLOC(iter->start); iter->start_len = strlen(iter->start); } if (end && *end) { iter->end = git__strdup(end); - GITERR_CHECK_ALLOC(iter->end); + GIT_ERROR_CHECK_ALLOC(iter->end); iter->end_len = strlen(iter->end); } @@ -146,7 +146,7 @@ static int iterator_init_common( (iter->flags & GIT_ITERATOR_DONT_PRECOMPOSE_UNICODE) == 0) { if (git_repository__cvar(&precompose, repo, GIT_CVAR_PRECOMPOSE) < 0) - giterr_clear(); + git_error_clear(); else if (precompose) iter->flags |= GIT_ITERATOR_PRECOMPOSE_UNICODE; } @@ -403,7 +403,7 @@ int git_iterator_for_nothing( *out = NULL; iter = git__calloc(1, sizeof(empty_iterator)); - GITERR_CHECK_ALLOC(iter); + GIT_ERROR_CHECK_ALLOC(iter); iter->base.type = GIT_ITERATOR_TYPE_EMPTY; iter->base.cb = &callbacks; @@ -541,7 +541,7 @@ static int tree_iterator_frame_init( int error = 0; new_frame = git_array_alloc(iter->frames); - GITERR_CHECK_ALLOC(new_frame); + GIT_ERROR_CHECK_ALLOC(new_frame); memset(new_frame, 0, sizeof(tree_iterator_frame)); @@ -564,7 +564,7 @@ static int tree_iterator_frame_init( git_array_foreach(dup->entries, i, tree_entry) { new_entry = git_pool_malloc(&iter->entry_pool, 1); - GITERR_CHECK_ALLOC(new_entry); + GIT_ERROR_CHECK_ALLOC(new_entry); new_entry->tree_entry = tree_entry; new_entry->parent_path = new_frame->path.ptr; @@ -618,20 +618,20 @@ GIT_INLINE(int) tree_iterator_frame_push_neighbors( break; path = git_array_alloc(parent_frame->similar_paths); - GITERR_CHECK_ALLOC(path); + GIT_ERROR_CHECK_ALLOC(path); memset(path, 0, sizeof(git_buf)); if ((error = tree_iterator_compute_path(path, entry)) < 0) break; - GITERR_CHECK_ALLOC_ADD(&new_size, + GIT_ERROR_CHECK_ALLOC_ADD(&new_size, frame->entries.length, tree->entries.size); git_vector_size_hint(&frame->entries, new_size); git_array_foreach(tree->entries, i, tree_entry) { new_entry = git_pool_malloc(&iter->entry_pool, 1); - GITERR_CHECK_ALLOC(new_entry); + GIT_ERROR_CHECK_ALLOC(new_entry); new_entry->tree_entry = tree_entry; new_entry->parent_path = path->ptr; @@ -947,7 +947,7 @@ int git_iterator_for_tree( return git_iterator_for_nothing(out, options); iter = git__calloc(1, sizeof(tree_iterator)); - GITERR_CHECK_ALLOC(iter); + GIT_ERROR_CHECK_ALLOC(iter); iter->base.type = GIT_ITERATOR_TYPE_TREE; iter->base.cb = &callbacks; @@ -1143,7 +1143,7 @@ static void filesystem_iterator_frame_push_ignores( if (git_ignore__lookup(&new_frame->is_ignored, &iter->ignores, path, GIT_DIR_FLAG_TRUE) < 0) { - giterr_clear(); + git_error_clear(); new_frame->is_ignored = GIT_IGNORE_NOTFOUND; } @@ -1299,12 +1299,12 @@ static int filesystem_iterator_entry_init( /* Make sure to append two bytes, one for the path's null * termination, one for a possible trailing '/' for folders. */ - GITERR_CHECK_ALLOC_ADD(&entry_size, + GIT_ERROR_CHECK_ALLOC_ADD(&entry_size, sizeof(filesystem_iterator_entry), path_len); - GITERR_CHECK_ALLOC_ADD(&entry_size, entry_size, 2); + GIT_ERROR_CHECK_ALLOC_ADD(&entry_size, entry_size, 2); entry = git_pool_malloc(&frame->entry_pool, entry_size); - GITERR_CHECK_ALLOC(entry); + GIT_ERROR_CHECK_ALLOC(entry); entry->path_len = path_len; entry->match = pathlist_match; @@ -1340,13 +1340,13 @@ static int filesystem_iterator_frame_push( int error; if (iter->frames.size == FILESYSTEM_MAX_DEPTH) { - giterr_set(GITERR_REPOSITORY, + git_error_set(GIT_ERROR_REPOSITORY, "directory nesting too deep (%"PRIuZ")", iter->frames.size); return -1; } new_frame = git_array_alloc(iter->frames); - GITERR_CHECK_ALLOC(new_frame); + GIT_ERROR_CHECK_ALLOC(new_frame); memset(new_frame, 0, sizeof(filesystem_iterator_frame)); @@ -1695,7 +1695,7 @@ static void filesystem_iterator_update_ignored(filesystem_iterator *iter) if (git_ignore__lookup(&iter->current_is_ignored, &iter->ignores, iter->entry.path, dir_flag) < 0) { - giterr_clear(); + git_error_clear(); iter->current_is_ignored = GIT_IGNORE_NOTFOUND; } @@ -1904,7 +1904,7 @@ static int iterator_for_filesystem( return git_iterator_for_nothing(out, options); iter = git__calloc(1, sizeof(filesystem_iterator)); - GITERR_CHECK_ALLOC(iter); + GIT_ERROR_CHECK_ALLOC(iter); iter->base.type = type; iter->base.cb = &callbacks; @@ -1912,7 +1912,7 @@ static int iterator_for_filesystem( root_len = strlen(root); iter->root = git__malloc(root_len+2); - GITERR_CHECK_ALLOC(iter->root); + GIT_ERROR_CHECK_ALLOC(iter->root); memcpy(iter->root, root, root_len); @@ -2234,7 +2234,7 @@ int git_iterator_for_index( return git_iterator_for_nothing(out, options); iter = git__calloc(1, sizeof(index_iterator)); - GITERR_CHECK_ALLOC(iter); + GIT_ERROR_CHECK_ALLOC(iter); iter->base.type = GIT_ITERATOR_TYPE_INDEX; iter->base.cb = &callbacks; @@ -2334,8 +2334,8 @@ int git_iterator_walk( iterator_item = git__calloc(cnt, sizeof(git_index_entry *)); cur_items = git__calloc(cnt, sizeof(git_index_entry *)); - GITERR_CHECK_ALLOC(iterator_item); - GITERR_CHECK_ALLOC(cur_items); + GIT_ERROR_CHECK_ALLOC(iterator_item); + GIT_ERROR_CHECK_ALLOC(cur_items); /* Set up the iterators */ for (i = 0; i < cnt; i++) { |