diff options
author | Moonchild <moonchild@palemoon.org> | 2023-11-04 22:28:58 +0100 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2023-11-08 13:48:43 +0100 |
commit | 037fb1d1238e6ff09f19b63352baba365994d449 (patch) | |
tree | 94fe0c48a341ad4025f3f52a68daec9d82442b04 | |
parent | 706d07b3d560955745a7dd4addb0ea52ac18d94b (diff) | |
download | uxp-037fb1d1238e6ff09f19b63352baba365994d449.tar.gz |
Issue #2342: Use [[nodiscard]] in /media
3 files changed, 11 insertions, 11 deletions
diff --git a/media/libstagefright/binding/include/mp4_demuxer/BufferReader.h b/media/libstagefright/binding/include/mp4_demuxer/BufferReader.h index 160c97fa0d..e88b5a3c57 100644 --- a/media/libstagefright/binding/include/mp4_demuxer/BufferReader.h +++ b/media/libstagefright/binding/include/mp4_demuxer/BufferReader.h @@ -182,7 +182,7 @@ public: } template <typename T> - MOZ_MUST_USE bool ReadArray(nsTArray<T>& aDest, size_t aLength) + [[nodiscard]] bool ReadArray(nsTArray<T>& aDest, size_t aLength) { const uint8_t* ptr; if (!Read(aLength * sizeof(T), &ptr)) { @@ -196,7 +196,7 @@ public: } template <typename T> - MOZ_MUST_USE bool ReadArray(FallibleTArray<T>& aDest, size_t aLength) + [[nodiscard]] bool ReadArray(FallibleTArray<T>& aDest, size_t aLength) { const uint8_t* ptr; if (!Read(aLength * sizeof(T), &ptr)) { diff --git a/media/libstagefright/binding/include/mp4_demuxer/ByteReader.h b/media/libstagefright/binding/include/mp4_demuxer/ByteReader.h index f316daa417..9085f4196f 100644 --- a/media/libstagefright/binding/include/mp4_demuxer/ByteReader.h +++ b/media/libstagefright/binding/include/mp4_demuxer/ByteReader.h @@ -308,7 +308,7 @@ public: } template <typename T> - MOZ_MUST_USE bool ReadArray(nsTArray<T>& aDest, size_t aLength) + [[nodiscard]] bool ReadArray(nsTArray<T>& aDest, size_t aLength) { auto ptr = Read(aLength * sizeof(T)); if (!ptr) { @@ -322,7 +322,7 @@ public: } template <typename T> - MOZ_MUST_USE bool ReadArray(FallibleTArray<T>& aDest, size_t aLength) + [[nodiscard]] bool ReadArray(FallibleTArray<T>& aDest, size_t aLength) { auto ptr = Read(aLength * sizeof(T)); if (!ptr) { diff --git a/media/libstagefright/binding/include/mp4_demuxer/ByteWriter.h b/media/libstagefright/binding/include/mp4_demuxer/ByteWriter.h index 48ebdd460f..f1ab4b3a34 100644 --- a/media/libstagefright/binding/include/mp4_demuxer/ByteWriter.h +++ b/media/libstagefright/binding/include/mp4_demuxer/ByteWriter.h @@ -22,47 +22,47 @@ public: { } - MOZ_MUST_USE bool WriteU8(uint8_t aByte) + [[nodiscard]] bool WriteU8(uint8_t aByte) { return Write(&aByte, 1); } - MOZ_MUST_USE bool WriteU16(uint16_t aShort) + [[nodiscard]] bool WriteU16(uint16_t aShort) { uint8_t c[2]; mozilla::BigEndian::writeUint16(&c[0], aShort); return Write(&c[0], 2); } - MOZ_MUST_USE bool WriteU32(uint32_t aLong) + [[nodiscard]] bool WriteU32(uint32_t aLong) { uint8_t c[4]; mozilla::BigEndian::writeUint32(&c[0], aLong); return Write(&c[0], 4); } - MOZ_MUST_USE bool Write32(int32_t aLong) + [[nodiscard]] bool Write32(int32_t aLong) { uint8_t c[4]; mozilla::BigEndian::writeInt32(&c[0], aLong); return Write(&c[0], 4); } - MOZ_MUST_USE bool WriteU64(uint64_t aLongLong) + [[nodiscard]] bool WriteU64(uint64_t aLongLong) { uint8_t c[8]; mozilla::BigEndian::writeUint64(&c[0], aLongLong); return Write(&c[0], 8); } - MOZ_MUST_USE bool Write64(int64_t aLongLong) + [[nodiscard]] bool Write64(int64_t aLongLong) { uint8_t c[8]; mozilla::BigEndian::writeInt64(&c[0], aLongLong); return Write(&c[0], 8); } - MOZ_MUST_USE bool Write(const uint8_t* aSrc, size_t aCount) + [[nodiscard]] bool Write(const uint8_t* aSrc, size_t aCount) { return mPtr.append(aSrc, aCount); } |