Fix compiler warnings
Merge from Widevine repo of http://go/wvgerrit/43420 Remove or mark unused variables. Fix unsigned/signed comparisons. bug: 73390805 test: unit tests Change-Id: Ic523400a5decf82fae733042b260e0c39a087cd3
This commit is contained in:
@@ -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_
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -49,7 +49,7 @@ void Log(const char* file, const char* function, int line, LogPriority level,
|
||||
int len = snprintf(buf, LOG_BUF_SIZE, "[%s(%d):%s] ", filename, line,
|
||||
function);
|
||||
if (len < 0) len = 0;
|
||||
if (len < sizeof(buf)) {
|
||||
if (static_cast<unsigned int>(len) < sizeof(buf)) {
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
vsnprintf(buf+len, LOG_BUF_SIZE-len, format, ap);
|
||||
|
||||
@@ -30,12 +30,12 @@ namespace {
|
||||
|
||||
// HTTP response codes.
|
||||
const int kHttpOk = 200;
|
||||
const int kHttpBadRequest = 400;
|
||||
const int kHttpInternalServerError = 500;
|
||||
// The following two responses are unused, but left here for human debuggers.
|
||||
// const int kHttpBadRequest = 400;
|
||||
// const int kHttpInternalServerError = 500;
|
||||
|
||||
const uint32_t kMinute = 60;
|
||||
const uint32_t kClockTolerance = 10;
|
||||
const uint32_t kTwoMinutes = 120;
|
||||
|
||||
const uint32_t kMaxUsageTableSize = 50;
|
||||
|
||||
@@ -932,7 +932,6 @@ TEST_F(WvCdmExtendedDurationTest, DecryptionCloseSessionConcurrencyTest) {
|
||||
|
||||
TEST_F(WvCdmExtendedDurationTest, UsageOverflowTest) {
|
||||
Provision();
|
||||
SubSampleInfo* data = &kEncryptedStreamingClip5SubSample;
|
||||
TestWvCdmClientPropertySet client_property_set;
|
||||
TestWvCdmClientPropertySet* property_set = NULL;
|
||||
|
||||
@@ -959,7 +958,6 @@ TEST_F(WvCdmExtendedDurationTest, UsageOverflowTest) {
|
||||
decryptor_.CloseSession(session_id_);
|
||||
}
|
||||
|
||||
uint32_t num_usage_info = 0;
|
||||
CdmUsageInfo usage_info;
|
||||
CdmUsageInfoReleaseMessage release_msg;
|
||||
CdmResponseType status = decryptor_.GetUsageInfo(
|
||||
@@ -1003,9 +1001,6 @@ TEST_F(WvCdmExtendedDurationTest, AutomatedOfflineSessionReleaseOnTimerEvent) {
|
||||
uint32_t initial_open_sessions =
|
||||
QueryStatus(kLevelDefault, wvcdm::QUERY_KEY_NUMBER_OF_OPEN_SESSIONS);
|
||||
|
||||
uint32_t max_sessions =
|
||||
QueryStatus(kLevelDefault, wvcdm::QUERY_KEY_MAX_NUMBER_OF_SESSIONS);
|
||||
|
||||
decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, NULL,
|
||||
&session_id_);
|
||||
GenerateKeyRequest(kOfflineClip4, kLicenseTypeOffline);
|
||||
@@ -1059,9 +1054,6 @@ TEST_F(WvCdmExtendedDurationTest, AutomatedOfflineSessionReleaseOnOpenSession) {
|
||||
uint32_t initial_open_sessions =
|
||||
QueryStatus(kLevelDefault, wvcdm::QUERY_KEY_NUMBER_OF_OPEN_SESSIONS);
|
||||
|
||||
uint32_t max_sessions =
|
||||
QueryStatus(kLevelDefault, wvcdm::QUERY_KEY_MAX_NUMBER_OF_SESSIONS);
|
||||
|
||||
decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, NULL,
|
||||
&session_id_);
|
||||
GenerateKeyRequest(kOfflineClip4, kLicenseTypeOffline);
|
||||
@@ -1398,7 +1390,6 @@ TEST_P(WvCdmStreamingUsageReportTest, UsageTest) {
|
||||
decryptor_.CloseSession(session_id_);
|
||||
|
||||
// Create usage report and validate
|
||||
uint32_t num_usage_info = 0;
|
||||
CdmUsageInfo usage_info;
|
||||
CdmUsageInfoReleaseMessage release_msg;
|
||||
CdmResponseType status = decryptor_.GetUsageInfo(
|
||||
|
||||
@@ -47,12 +47,11 @@ namespace {
|
||||
|
||||
#define N_ELEM(a) (sizeof(a) / sizeof(a[0]))
|
||||
|
||||
const char kPathDelimiter = '/';
|
||||
|
||||
// HTTP response codes.
|
||||
const int kHttpOk = 200;
|
||||
const int kHttpBadRequest = 400;
|
||||
const int kHttpInternalServerError = 500;
|
||||
// The following two responses are unused, but left here for human debuggers.
|
||||
// const int kHttpBadRequest = 400;
|
||||
// const int kHttpInternalServerError = 500;
|
||||
|
||||
// Default license server, can be configured using --server command line option
|
||||
// Default key id (pssh), can be configured using --keyid command line option
|
||||
|
||||
@@ -42,8 +42,6 @@ namespace {
|
||||
|
||||
#define N_ELEM(a) (sizeof(a)/sizeof(a[0]))
|
||||
|
||||
const char kPathDelimiter = '/';
|
||||
|
||||
// HTTP response codes.
|
||||
const int kHttpOk = 200;
|
||||
const int kHttpBadRequest = 400;
|
||||
|
||||
Reference in New Issue
Block a user