Bug 1374774: P6. Fix ByteReader constness. r=gerald

MozReview-Commit-ID: 8bQA189OOVF

--HG--
extra : rebase_source : 4f4e371c43da839ae6168241879d580b97435bb0
This commit is contained in:
Jean-Yves Avenard 2017-06-22 22:50:08 +02:00
Родитель d2bb0f2ec4
Коммит 8d489f9bb9
1 изменённых файлов: 13 добавлений и 13 удалений

Просмотреть файл

@ -50,14 +50,14 @@ public:
{
}
size_t Offset()
size_t Offset() const
{
return mLength - mRemaining;
}
size_t Remaining() const { return mRemaining; }
bool CanRead8() { return mRemaining >= 1; }
bool CanRead8() const { return mRemaining >= 1; }
uint8_t ReadU8()
{
@ -188,7 +188,7 @@ public:
return mPtr;
}
uint8_t PeekU8()
uint8_t PeekU8() const
{
auto ptr = Peek(1);
if (!ptr) {
@ -198,7 +198,7 @@ public:
return *ptr;
}
uint16_t PeekU16()
uint16_t PeekU16() const
{
auto ptr = Peek(2);
if (!ptr) {
@ -208,7 +208,7 @@ public:
return mozilla::BigEndian::readUint16(ptr);
}
uint32_t PeekU24()
uint32_t PeekU24() const
{
auto ptr = Peek(3);
if (!ptr) {
@ -218,12 +218,12 @@ public:
return ptr[0] << 16 | ptr[1] << 8 | ptr[2];
}
uint32_t Peek24()
uint32_t Peek24() const
{
return (uint32_t)PeekU24();
}
uint32_t PeekU32()
uint32_t PeekU32() const
{
auto ptr = Peek(4);
if (!ptr) {
@ -233,7 +233,7 @@ public:
return mozilla::BigEndian::readUint32(ptr);
}
int32_t Peek32()
int32_t Peek32() const
{
auto ptr = Peek(4);
if (!ptr) {
@ -243,7 +243,7 @@ public:
return mozilla::BigEndian::readInt32(ptr);
}
uint64_t PeekU64()
uint64_t PeekU64() const
{
auto ptr = Peek(8);
if (!ptr) {
@ -253,7 +253,7 @@ public:
return mozilla::BigEndian::readUint64(ptr);
}
int64_t Peek64()
int64_t Peek64() const
{
auto ptr = Peek(8);
if (!ptr) {
@ -263,7 +263,7 @@ public:
return mozilla::BigEndian::readInt64(ptr);
}
const uint8_t* Peek(size_t aCount)
const uint8_t* Peek(size_t aCount) const
{
if (aCount > mRemaining) {
return nullptr;
@ -290,12 +290,12 @@ public:
return mPtr;
}
uint32_t Align()
uint32_t Align() const
{
return 4 - ((intptr_t)mPtr & 3);
}
template <typename T> bool CanReadType() { return mRemaining >= sizeof(T); }
template <typename T> bool CanReadType() const { return mRemaining >= sizeof(T); }
template <typename T> T ReadType()
{