From 83a1f6894440394cbd9ef398309822b34a884428 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Tue, 25 Aug 2015 10:47:17 -0700 Subject: [PATCH] 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 --- mkvparser.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/mkvparser.cpp b/mkvparser.cpp index c1cf6fa..d538baf 100644 --- a/mkvparser.cpp +++ b/mkvparser.cpp @@ -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); - 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); - 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); - 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); - 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); 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;