aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/buffer_cache/buffer_block.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-12-07 01:53:37 -0500
committerLioncash <mathew1800@gmail.com>2020-12-07 01:53:40 -0500
commit4704a22c3faabace386bf7511061451bb4d2aa79 (patch)
tree97f4a13530a49e517105139da56f8e703d98f991 /src/video_core/buffer_cache/buffer_block.h
parent7caec769701048face1b686ffb155282721e2e8b (diff)
buffer_block: Mark interface as nodiscard where applicable
Prevents logic errors from occurring from unused values.
Diffstat (limited to 'src/video_core/buffer_cache/buffer_block.h')
-rw-r--r--src/video_core/buffer_cache/buffer_block.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/video_core/buffer_cache/buffer_block.h b/src/video_core/buffer_cache/buffer_block.h
index eee6908b19..e9306194af 100644
--- a/src/video_core/buffer_cache/buffer_block.h
+++ b/src/video_core/buffer_cache/buffer_block.h
@@ -10,23 +10,23 @@ namespace VideoCommon {
class BufferBlock {
public:
- bool Overlaps(VAddr start, VAddr end) const {
+ [[nodiscard]] bool Overlaps(VAddr start, VAddr end) const {
return (cpu_addr < end) && (cpu_addr_end > start);
}
- bool IsInside(VAddr other_start, VAddr other_end) const {
+ [[nodiscard]] bool IsInside(VAddr other_start, VAddr other_end) const {
return cpu_addr <= other_start && other_end <= cpu_addr_end;
}
- std::size_t Offset(VAddr in_addr) const {
+ [[nodiscard]] std::size_t Offset(VAddr in_addr) const {
return static_cast<std::size_t>(in_addr - cpu_addr);
}
- VAddr CpuAddr() const {
+ [[nodiscard]] VAddr CpuAddr() const {
return cpu_addr;
}
- VAddr CpuAddrEnd() const {
+ [[nodiscard]] VAddr CpuAddrEnd() const {
return cpu_addr_end;
}
@@ -35,11 +35,11 @@ public:
cpu_addr_end = new_addr + size;
}
- std::size_t Size() const {
+ [[nodiscard]] std::size_t Size() const {
return size;
}
- u64 Epoch() const {
+ [[nodiscard]] u64 Epoch() const {
return epoch;
}