Replacing NULL with nullptr in core/
[ Merge of http://go/wvgerrit/84647 ] [ Merge of http://go/wvgerrit/84648 ] Replacing most instances of C's NULL with C++'s nullptr. Also changed how a NULL check is performed on smart pointers. They provided an implicit boolean operator for null checks, meaning the underlying pointer does not need to be compared directly (as it was in some places before). Note that clang-format has performed additional changes to some of the test files that have not yet been formatted. Bug: 120602075 Test: Linux and Android unittests Change-Id: I06ddebe34b0ea6dfecedb5527e7e808e32f5269a
This commit is contained in:
@@ -27,7 +27,7 @@ namespace wvcdm {
|
||||
class BufferReader {
|
||||
public:
|
||||
BufferReader(const uint8_t* buf, size_t size)
|
||||
: buf_(buf), size_(buf != NULL ? size : 0), pos_(0) {}
|
||||
: buf_(buf), size_(buf != nullptr ? size : 0), pos_(0) {}
|
||||
|
||||
bool HasBytes(size_t count) const { return pos_ + count <= size_; }
|
||||
bool IsEOF() const { return pos_ >= size_; }
|
||||
|
||||
@@ -151,7 +151,7 @@ class CdmSession {
|
||||
virtual bool is_temporary() { return is_temporary_; }
|
||||
virtual bool license_received() { return license_received_; }
|
||||
virtual bool has_provider_session_token() {
|
||||
return (license_parser_.get() != NULL &&
|
||||
return (license_parser_ &&
|
||||
license_parser_->provider_session_token().size() > 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ class CdmLicense {
|
||||
virtual CdmResponseType RestoreLicenseForRelease(
|
||||
const CdmKeyMessage& license_request,
|
||||
const CdmKeyResponse& license_response);
|
||||
virtual bool HasInitData() { return stored_init_data_.get(); }
|
||||
virtual bool HasInitData() { return static_cast<bool>(stored_init_data_); }
|
||||
virtual bool IsKeyLoaded(const KeyId& key_id);
|
||||
|
||||
virtual std::string provider_session_token() {
|
||||
|
||||
@@ -592,12 +592,12 @@ struct CdmDecryptionParameters {
|
||||
: is_encrypted(true),
|
||||
is_secure(true),
|
||||
cipher_mode(kCipherModeCtr),
|
||||
key_id(NULL),
|
||||
encrypt_buffer(NULL),
|
||||
key_id(nullptr),
|
||||
encrypt_buffer(nullptr),
|
||||
encrypt_length(0),
|
||||
iv(NULL),
|
||||
iv(nullptr),
|
||||
block_offset(0),
|
||||
decrypt_buffer(NULL),
|
||||
decrypt_buffer(nullptr),
|
||||
decrypt_buffer_length(0),
|
||||
decrypt_buffer_offset(0),
|
||||
subsample_flags(0),
|
||||
|
||||
Reference in New Issue
Block a user