fix paramter warning and libgit2 error

Add directives to use git_comit * const for final parameter when calling git_commit_create_buffer function using v.1.8.0, v1.8.1, and v1.8.3

Change-Id: Iffc023b0ae87f14aea15b360d00da76933a81cc4
This commit is contained in:
Ilyas Erdogan
2025-06-09 10:22:46 -04:00
parent ace9a0da42
commit 3280fa373a
3 changed files with 5 additions and 6 deletions

View File

@ -309,7 +309,7 @@ TlsValidator::~TlsValidator() {}
* @todo The date should be validated, this is currently not an issue
*/
std::string
TlsValidator::getStringValue(const TlsValidator::CertificateCheck check,
TlsValidator::getStringValue([[maybe_unused]]const TlsValidator::CertificateCheck check,
const TlsValidator::CheckResult result)
{
assert(acceptedCheckValuesResult[enforcedCheckType[check]][result.first]);

View File

@ -237,11 +237,10 @@ commitInRepo(const std::string& path, std::shared_ptr<JamiAccount> account, cons
GitCommit head_commit {head_ptr, git_commit_free};
git_buf to_sign = {};
#if( LIBGIT2_VER_MAJOR > 1 ) || ( LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR >= 8 )
// For libgit2 version 1.8.0 and above
#if LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR == 8 && \
(LIBGIT2_VER_REVISION == 0 || LIBGIT2_VER_REVISION == 1 || LIBGIT2_VER_REVISION == 3)
git_commit* const head_ref[1] = {head_commit.get()};
#else
// For libgit2 versions older than 1.8.0
const git_commit* head_ref[1] = {head_commit.get()};
#endif
if (git_commit_create_buffer(

View File

@ -293,8 +293,8 @@ ConversationRepositoryTest::addCommit(git_repository* repo,
GitTree tree = {tree_ptr, git_tree_free};
git_buf to_sign = {};
#if( LIBGIT2_VER_MAJOR > 1 ) || ( LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR >= 8 )
// For libgit2 version 1.8.0 and above
#if LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR == 8 && \
(LIBGIT2_VER_REVISION == 0 || LIBGIT2_VER_REVISION == 1 || LIBGIT2_VER_REVISION == 3)
git_commit* const head_ref[1] = {head_commit.get()};
#else
const git_commit* head_ref[1] = {head_commit.get()};