Просмотр исходного кода

Merge pull request #4463 from lioncash/lockdiscard

kernel/scheduler: Mark SchedulerLock constructor as nodiscard
bunnei 6 лет назад
Родитель
Сommit
2aabd1eb05
2 измененных файлов с 3 добавлено и 3 удалено
  1. 2 2
      src/core/frontend/emu_window.h
  2. 1 1
      src/core/hle/kernel/scheduler.h

+ 2 - 2
src/core/frontend/emu_window.h

@@ -39,7 +39,7 @@ public:
 
 
     class Scoped {
     class Scoped {
     public:
     public:
-        explicit Scoped(GraphicsContext& context_) : context(context_) {
+        [[nodiscard]] explicit Scoped(GraphicsContext& context_) : context(context_) {
             context.MakeCurrent();
             context.MakeCurrent();
         }
         }
         ~Scoped() {
         ~Scoped() {
@@ -52,7 +52,7 @@ public:
 
 
     /// Calls MakeCurrent on the context and calls DoneCurrent when the scope for the returned value
     /// Calls MakeCurrent on the context and calls DoneCurrent when the scope for the returned value
     /// ends
     /// ends
-    Scoped Acquire() {
+    [[nodiscard]] Scoped Acquire() {
         return Scoped{*this};
         return Scoped{*this};
     }
     }
 };
 };

+ 1 - 1
src/core/hle/kernel/scheduler.h

@@ -289,7 +289,7 @@ private:
 
 
 class SchedulerLock {
 class SchedulerLock {
 public:
 public:
-    explicit SchedulerLock(KernelCore& kernel);
+    [[nodiscard]] explicit SchedulerLock(KernelCore& kernel);
     ~SchedulerLock();
     ~SchedulerLock();
 
 
 protected:
 protected: