cpp: Fix comparisons of integer expressions of different signedness

* lang/cpp/src/gpgrevokekeyeditinteractor.cpp
(GpgRevokeKeyEditInteractor::Private::nextState): Cast signed nextLine
value to std::size_t.
--
This commit is contained in:
Ingo Klöcker 2023-01-05 20:29:27 +01:00
parent dc9cc9aa07
commit 2e9d72a0be
No known key found for this signature in database
GPG Key ID: F5A5D1692277A1E9

View File

@ -138,7 +138,7 @@ unsigned int GpgRevokeKeyEditInteractor::Private::nextState(unsigned int status,
if (status == GPGME_STATUS_GET_LINE &&
strcmp(args, "ask_revocation_reason.text") == 0) {
nextLine++;
return nextLine < reasonLines.size() ? REASON_TEXT : REASON_TEXT_DONE;
return static_cast<std::size_t>(nextLine) < reasonLines.size() ? REASON_TEXT : REASON_TEXT_DONE;
}
err = GENERAL_ERROR;
return ERROR;
@ -147,7 +147,7 @@ unsigned int GpgRevokeKeyEditInteractor::Private::nextState(unsigned int status,
if (status == GPGME_STATUS_GET_LINE &&
strcmp(args, "ask_revocation_reason.text") == 0) {
nextLine++;
return nextLine < reasonLines.size() ? state + 1 : REASON_TEXT_DONE;
return static_cast<std::size_t>(nextLine) < reasonLines.size() ? state + 1 : REASON_TEXT_DONE;
}
}
err = GENERAL_ERROR;