Merge "Fix compiler warnings"

This commit is contained in:
Fred Gylys-Colwell
2018-02-16 02:15:09 +00:00
committed by Android (Google) Code Review
16 changed files with 26 additions and 40 deletions

View File

@@ -43,7 +43,7 @@ class SubLicenseKeySession : public KeySession {
CdmCipherMode* cipher_mode,
const std::string& srm_requirement);
OEMCryptoResult LoadEntitledContentKeys(const std::vector<CryptoKey>& keys) {
OEMCryptoResult LoadEntitledContentKeys(const std::vector<CryptoKey>& /*keys*/) {
return OEMCrypto_ERROR_INVALID_CONTEXT;
}
@@ -92,4 +92,4 @@ class SubLicenseKeySession : public KeySession {
} // namespace wvcdm
#endif // WVCDM_CORE_SUBLICENSE_KEY_SESSSION_H_
#endif // WVCDM_CORE_SUBLICENSE_KEY_SESSSION_H_

View File

@@ -586,7 +586,7 @@ CdmResponseType CdmEngine::QueryStatus(SecurityLevel security_level,
open_sessions_stream << number_of_open_sessions;
*query_response = open_sessions_stream.str();
} else if (query_token == QUERY_KEY_MAX_NUMBER_OF_SESSIONS) {
size_t maximum_number_of_sessions;
size_t maximum_number_of_sessions = 0;
if (!crypto_session.GetMaxNumberOfSessions(&maximum_number_of_sessions)) {
LOGW("CdmEngine::QueryStatus: GetMaxNumberOfOpenSessions failed");
return UNKNOWN_ERROR;

View File

@@ -1658,7 +1658,7 @@ bool CryptoSession::GetMaxNumberOfSessions(size_t* max) {
return false;
}
size_t max_sessions;
size_t max_sessions = 0;
OEMCryptoResult status = OEMCrypto_GetMaxNumberOfSessions(
requested_security_level_, &max_sessions);
if (OEMCrypto_SUCCESS != status) {

View File

@@ -759,10 +759,10 @@ class Adapter {
OEMCrypto_INITIALIZED_USING_L3_COULD_NOT_OPEN_FACTORY_KEYBOX);
return false;
}
uint8_t keybox[size];
ssize_t size_read = file->Read(reinterpret_cast<char*>(keybox), size);
std::vector<uint8_t> keybox(size);
ssize_t size_read = file->Read(reinterpret_cast<char*>(&keybox[0]), size);
file->Close();
if (level1_.InstallKeybox(keybox, size) != OEMCrypto_SUCCESS) {
if (level1_.InstallKeybox(&keybox[0], size_read) != OEMCrypto_SUCCESS) {
LOGE("Could NOT install keybox from %s. Falling Back to L3.",
filename.c_str());
level1_.Terminate();