Skip to content

Commit 3b0f2e9

Browse files
committed
Fix Mac build.
1 parent e25b1b5 commit 3b0f2e9

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

Common/Cpp/Options/TimeDurationOption.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,6 @@ std::string TimeDurationCell<Type>::current_text() const{
190190
return data.m_current;
191191
}
192192
template <typename Type>
193-
TimeDurationCell<Type>::operator Type() const{
194-
const Data& data = *m_data;
195-
ReadSpinLock lg(data.m_lock);
196-
return data.m_value;
197-
}
198-
template <typename Type>
199-
TimeDurationCell<Type>::operator WallDuration() const{
200-
return get();
201-
}
202-
template <typename Type>
203193
Type TimeDurationCell<Type>::get() const{
204194
const Data& data = *m_data;
205195
ReadSpinLock lg(data.m_lock);

Common/Cpp/Options/TimeDurationOption.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@ class TimeDurationCell : public ConfigOption{
4747
const std::string& default_value() const;
4848
std::string current_text() const;
4949

50-
operator Type() const;
51-
operator WallDuration() const;
50+
template <class Rep, class Period>
51+
operator std::chrono::duration<Rep, Period>() const{
52+
return std::chrono::duration_cast<std::chrono::duration<Rep, Period>>(get());
53+
}
54+
5255
Type get() const;
5356
std::string set(std::string text);
5457

SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_TurboButton.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,21 @@ TurboButton::TurboButton()
7272
void TurboButton::program(SingleSwitchProgramEnvironment& env, ProControllerContext& context){
7373
if (TOTAL_PRESSES == 0){
7474
while (true){
75-
pbf_press_button(context, (Button)BUTTON.current_value(), PRESS_DURATION0, RELEASE_DURATION0);
75+
pbf_press_button(
76+
context,
77+
(Button)BUTTON.current_value(),
78+
PRESS_DURATION0,
79+
RELEASE_DURATION0
80+
);
7681
}
7782
}else{
7883
for (uint64_t c = 0; c < TOTAL_PRESSES; c++){
79-
pbf_press_button(context, (Button)BUTTON.current_value(), PRESS_DURATION0, RELEASE_DURATION0);
84+
pbf_press_button(
85+
context,
86+
(Button)BUTTON.current_value(),
87+
PRESS_DURATION0,
88+
RELEASE_DURATION0
89+
);
8090
}
8191
}
8292
context.wait_for_all_requests();

0 commit comments

Comments
 (0)