summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2020-08-02 20:17:42 -0400
committerGravatar Lioncash2020-08-14 04:43:44 -0400
commita93f6e51d355ee95009a07c8a574fc9eaed212bf (patch)
tree51ecd620a23b0b379ba40318c0ea43f4d8959c19
parentkernel/scheduler: Mark SchedulerLock constructor as nodiscard (diff)
downloadyuzu-a93f6e51d355ee95009a07c8a574fc9eaed212bf.tar.gz
yuzu-a93f6e51d355ee95009a07c8a574fc9eaed212bf.tar.xz
yuzu-a93f6e51d355ee95009a07c8a574fc9eaed212bf.zip
emu_window: Mark Scoped constructor and Acquire() as nodiscard
Ensures that callers make use of the constructor, preventing bugs from silently occurring.
-rw-r--r--src/core/frontend/emu_window.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/frontend/emu_window.h b/src/core/frontend/emu_window.h
index 13aa14934..3e8780243 100644
--- a/src/core/frontend/emu_window.h
+++ b/src/core/frontend/emu_window.h
@@ -39,7 +39,7 @@ public:
39 39
40 class Scoped { 40 class Scoped {
41 public: 41 public:
42 explicit Scoped(GraphicsContext& context_) : context(context_) { 42 [[nodiscard]] explicit Scoped(GraphicsContext& context_) : context(context_) {
43 context.MakeCurrent(); 43 context.MakeCurrent();
44 } 44 }
45 ~Scoped() { 45 ~Scoped() {
@@ -52,7 +52,7 @@ public:
52 52
53 /// Calls MakeCurrent on the context and calls DoneCurrent when the scope for the returned value 53 /// Calls MakeCurrent on the context and calls DoneCurrent when the scope for the returned value
54 /// ends 54 /// ends
55 Scoped Acquire() { 55 [[nodiscard]] Scoped Acquire() {
56 return Scoped{*this}; 56 return Scoped{*this};
57 } 57 }
58}; 58};