mkvparser: Remove buf_t typedef.

- It is useless.
- It masks errors; buf_t was unsigned char*, but const buf_t was
  not seen by the compiler as const unsigned char*, which allowed
  passing a const pointer as a mutable argument to
  IMkvReader::Read at every site where buf_t was in use.

Change-Id: I293015e11c69d992e76c88ac02052a5a9a2b2c9c
This commit is contained in:
Tom Finegan 2015-08-25 10:47:17 -07:00
parent 507471457e
commit 83a1f68944

View File

@ -4286,8 +4286,7 @@ long ContentEncoding::ParseCompressionEntry(long long start, long long size,
return E_FILE_FORMAT_INVALID;
const size_t buflen = static_cast<size_t>(size);
typedef unsigned char* buf_t;
const buf_t buf = new (std::nothrow) unsigned char[buflen];
unsigned char* buf = new (std::nothrow) unsigned char[buflen];
if (buf == NULL)
return -1;
@ -4344,8 +4343,7 @@ long ContentEncoding::ParseEncryptionEntry(long long start, long long size,
return E_FILE_FORMAT_INVALID;
const size_t buflen = static_cast<size_t>(size);
typedef unsigned char* buf_t;
const buf_t buf = new (std::nothrow) unsigned char[buflen];
unsigned char* buf = new (std::nothrow) unsigned char[buflen];
if (buf == NULL)
return -1;
@ -4368,8 +4366,7 @@ long ContentEncoding::ParseEncryptionEntry(long long start, long long size,
return E_FILE_FORMAT_INVALID;
const size_t buflen = static_cast<size_t>(size);
typedef unsigned char* buf_t;
const buf_t buf = new (std::nothrow) unsigned char[buflen];
unsigned char* buf = new (std::nothrow) unsigned char[buflen];
if (buf == NULL)
return -1;
@ -4392,8 +4389,7 @@ long ContentEncoding::ParseEncryptionEntry(long long start, long long size,
return E_FILE_FORMAT_INVALID;
const size_t buflen = static_cast<size_t>(size);
typedef unsigned char* buf_t;
const buf_t buf = new (std::nothrow) unsigned char[buflen];
unsigned char* buf = new (std::nothrow) unsigned char[buflen];
if (buf == NULL)
return -1;
@ -5504,9 +5500,7 @@ long Tracks::ParseTrackEntry(long long track_start, long long track_size,
const size_t buflen = static_cast<size_t>(size);
if (buflen) {
typedef unsigned char* buf_t;
const buf_t buf = new (std::nothrow) unsigned char[buflen];
unsigned char* buf = new (std::nothrow) unsigned char[buflen];
if (buf == NULL)
return -1;