From 277be6dd08633dbebfda93afdfc6b5cb57e053e0 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Mon, 8 Apr 2024 13:18:22 +0200 Subject: Use properly included standard library types by default --- src/buildtool/file_system/git_repo.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/buildtool/file_system/git_repo.cpp') diff --git a/src/buildtool/file_system/git_repo.cpp b/src/buildtool/file_system/git_repo.cpp index ea5b50d4..253adad1 100644 --- a/src/buildtool/file_system/git_repo.cpp +++ b/src/buildtool/file_system/git_repo.cpp @@ -258,7 +258,7 @@ struct InMemoryODBBackend { [[nodiscard]] auto backend_write(git_odb_backend* _backend, const git_oid* oid, const void* data, - size_t len, + std::size_t len, git_object_t type) -> int { if (data != nullptr and _backend != nullptr and oid != nullptr) { auto* b = reinterpret_cast(_backend); // NOLINT @@ -508,13 +508,14 @@ auto GitRepo::InitAndOpen(std::filesystem::path const& repo_path, } git_repository* tmp_repo{nullptr}; - size_t max_attempts = kGitLockNumTries; // number of tries + std::size_t max_attempts = kGitLockNumTries; // number of tries int err = 0; std::string err_mess{}; while (max_attempts > 0) { --max_attempts; - err = git_repository_init( - &tmp_repo, repo_path.c_str(), static_cast(is_bare)); + err = git_repository_init(&tmp_repo, + repo_path.c_str(), + static_cast(is_bare)); if (err == 0) { git_repository_free(tmp_repo); return GitRepo(repo_path); // success @@ -758,7 +759,7 @@ auto GitRepo::KeepTag(std::string const& commit, } git_strarray_dispose(&tag_names); // free any allocated unused space - size_t max_attempts = kGitLockNumTries; // number of tries + std::size_t max_attempts = kGitLockNumTries; // number of tries int err = 0; std::string err_mess{}; while (max_attempts > 0) { @@ -1846,7 +1847,8 @@ void GitRepo::PopulateStrarray( array->count = string_list.size(); array->strings = gsl::owner(new char*[string_list.size()]); for (auto const& elem : string_list) { - auto i = static_cast(&elem - &string_list[0]); // get index + auto i = + static_cast(&elem - &string_list[0]); // get index // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) array->strings[i] = gsl::owner(new char[elem.size() + 1]); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) -- cgit v1.2.3