kraken: Address comments from review
Fix compiler bug
This commit is contained in:
parent
f4e5f89e6f
commit
42949738f2
17 changed files with 54 additions and 66 deletions
|
@ -345,7 +345,7 @@ void Controller_NPad::RequestPadStateUpdate(Core::HID::NpadIdType npad_id) {
|
|||
constexpr btn right_button_mask = btn::A | btn::B | btn::X | btn::Y | btn::StickR | btn::R |
|
||||
btn::ZR | btn::Plus | btn::StickRLeft | btn::StickRUp |
|
||||
btn::StickRRight | btn::StickRDown;
|
||||
pad_entry.npad_buttons.raw |= button_state.raw & right_button_mask;
|
||||
pad_entry.npad_buttons.raw = button_state.raw & right_button_mask;
|
||||
pad_entry.r_stick = stick_state.right;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include <array>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/swap.h"
|
||||
|
||||
namespace Service::HID {
|
||||
constexpr std::size_t max_buffer_size = 17;
|
||||
|
@ -21,7 +20,7 @@ struct AtomicStorage {
|
|||
template <typename State>
|
||||
struct Lifo {
|
||||
s64 timestamp{};
|
||||
s64 total_buffer_count = max_buffer_size;
|
||||
s64 total_buffer_count = static_cast<s64>(max_buffer_size);
|
||||
s64 buffer_tail{};
|
||||
s64 buffer_count{};
|
||||
std::array<AtomicStorage<State>, max_buffer_size> entries{};
|
||||
|
@ -35,11 +34,11 @@ struct Lifo {
|
|||
}
|
||||
|
||||
std::size_t GetPreviousEntryIndex() const {
|
||||
return (buffer_tail + total_buffer_count - 1) % total_buffer_count;
|
||||
return static_cast<size_t>((buffer_tail + total_buffer_count - 1) % total_buffer_count);
|
||||
}
|
||||
|
||||
std::size_t GetNextEntryIndex() const {
|
||||
return (buffer_tail + 1) % total_buffer_count;
|
||||
return static_cast<size_t>((buffer_tail + 1) % total_buffer_count);
|
||||
}
|
||||
|
||||
void WriteNextEntry(const State& new_state) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue