From 02ade14f676a35a5247c5eaaf8ec04d34cd40f92 Mon Sep 17 00:00:00 2001 From: Fraxy V Date: Tue, 28 Nov 2023 16:21:46 +0200 Subject: [PATCH] wchess minor --- examples/wchess/CMakeLists.txt | 2 +- examples/wchess/libwchess/WChess.cpp | 5 ++--- examples/wchess/libwchess/WChess.h | 6 +++--- examples/wchess/wchess.cmd/wchess.cmd.cpp | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/examples/wchess/CMakeLists.txt b/examples/wchess/CMakeLists.txt index 4bbc85ab..227c2fa5 100644 --- a/examples/wchess/CMakeLists.txt +++ b/examples/wchess/CMakeLists.txt @@ -1,4 +1,4 @@ -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) add_subdirectory(libwchess) diff --git a/examples/wchess/libwchess/WChess.cpp b/examples/wchess/libwchess/WChess.cpp index 4725384e..370fc923 100644 --- a/examples/wchess/libwchess/WChess.cpp +++ b/examples/wchess/libwchess/WChess.cpp @@ -48,9 +48,8 @@ bool WChess::check_running() const { return false; } -bool WChess::clear_audio() const { - if (m_cb.clear_audio) return (*m_cb.clear_audio)(); - return false; +void WChess::clear_audio() const { + if (m_cb.clear_audio) (*m_cb.clear_audio)(); } void WChess::get_audio(int ms, std::vector& pcmf32) const { diff --git a/examples/wchess/libwchess/WChess.h b/examples/wchess/libwchess/WChess.h index 2c89518e..dcb00bfc 100644 --- a/examples/wchess/libwchess/WChess.h +++ b/examples/wchess/libwchess/WChess.h @@ -12,14 +12,14 @@ public: using CheckRunningCb = bool (*)(); using GetAudioCb = void (*)(int, std::vector &); using SetMovesCb = void (*)(const std::string &); - using CleartAudioCb = bool (*)(); + using ClearAudioCb = void (*)(); struct callbacks { SetStatusCb set_status = nullptr; CheckRunningCb check_running = nullptr; GetAudioCb get_audio = nullptr; SetMovesCb set_moves = nullptr; - CleartAudioCb clear_audio = nullptr; + ClearAudioCb clear_audio = nullptr; }; struct settings { @@ -46,7 +46,7 @@ private: void set_status(const std::string& msg) const; void set_moves(const std::string& moves) const; bool check_running() const; - bool clear_audio() const; + void clear_audio() const; std::string transcribe( const std::vector & pcmf32, float & logprob_min, diff --git a/examples/wchess/wchess.cmd/wchess.cmd.cpp b/examples/wchess/wchess.cmd/wchess.cmd.cpp index 735209a5..4de4a2b9 100644 --- a/examples/wchess/wchess.cmd/wchess.cmd.cpp +++ b/examples/wchess/wchess.cmd/wchess.cmd.cpp @@ -118,7 +118,7 @@ void get_audio(int ms, std::vector & pcmf32_cur) { g_audio.get(ms, pcmf32_cur); } -bool clear_audio() { +void clear_audio() { g_audio.clear(); }