diff options
| author | 2020-07-12 15:41:32 -0400 | |
|---|---|---|
| committer | 2020-07-12 15:41:35 -0400 | |
| commit | 839c91cd14d65d0d62a946078aa62657530fd55a (patch) | |
| tree | 97d4c63c1e6e056663380725d89484f3374a07ff /src/input_common | |
| parent | gc_poller: Silence sign conversion warnings (diff) | |
| download | yuzu-839c91cd14d65d0d62a946078aa62657530fd55a.tar.gz yuzu-839c91cd14d65d0d62a946078aa62657530fd55a.tar.xz yuzu-839c91cd14d65d0d62a946078aa62657530fd55a.zip | |
gc_poller: Get rid of undefined behavior in Create()
Ensures that the function always has returns in all control paths.
Diffstat (limited to 'src/input_common')
| -rw-r--r-- | src/input_common/gcadapter/gc_poller.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/input_common/gcadapter/gc_poller.cpp b/src/input_common/gcadapter/gc_poller.cpp index ead1a1b0e..d9296c496 100644 --- a/src/input_common/gcadapter/gc_poller.cpp +++ b/src/input_common/gcadapter/gc_poller.cpp | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #include <list> | 6 | #include <list> |
| 7 | #include <mutex> | 7 | #include <mutex> |
| 8 | #include <utility> | 8 | #include <utility> |
| 9 | #include "common/assert.h" | ||
| 9 | #include "common/threadsafe_queue.h" | 10 | #include "common/threadsafe_queue.h" |
| 10 | #include "input_common/gcadapter/gc_adapter.h" | 11 | #include "input_common/gcadapter/gc_adapter.h" |
| 11 | #include "input_common/gcadapter/gc_poller.h" | 12 | #include "input_common/gcadapter/gc_poller.h" |
| @@ -94,6 +95,9 @@ std::unique_ptr<Input::ButtonDevice> GCButtonFactory::Create(const Common::Param | |||
| 94 | return std::make_unique<GCAxisButton>(port, axis, threshold, trigger_if_greater, | 95 | return std::make_unique<GCAxisButton>(port, axis, threshold, trigger_if_greater, |
| 95 | adapter.get()); | 96 | adapter.get()); |
| 96 | } | 97 | } |
| 98 | |||
| 99 | UNREACHABLE(); | ||
| 100 | return nullptr; | ||
| 97 | } | 101 | } |
| 98 | 102 | ||
| 99 | Common::ParamPackage GCButtonFactory::GetNextInput() { | 103 | Common::ParamPackage GCButtonFactory::GetNextInput() { |