From 9bf9d53a25169200a75ac45192d100b0352acb9b Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Fri, 26 Apr 2024 11:49:20 +0800 Subject: [PATCH] fix style issues --- sherpa-onnx/csrc/sherpa-onnx-microphone.cc | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/sherpa-onnx/csrc/sherpa-onnx-microphone.cc b/sherpa-onnx/csrc/sherpa-onnx-microphone.cc index c41d61095..69a988aa5 100644 --- a/sherpa-onnx/csrc/sherpa-onnx-microphone.cc +++ b/sherpa-onnx/csrc/sherpa-onnx-microphone.cc @@ -38,29 +38,29 @@ static void Handler(int32_t sig) { fprintf(stderr, "\nCaught Ctrl + C. Exiting...\n"); } -static std::string tolowerUnicode(const std::string& input_str) { - - // Use system locale - std::setlocale(LC_ALL, ""); - - // From char string to wchar string - std::wstring input_wstr(input_str.size()+1, '\0'); - std::mbstowcs(&input_wstr[0], input_str.c_str(), input_str.size()); - std::wstring lowercase_wstr; - - for (wchar_t wc : input_wstr) { - if (std::iswupper(wc)) { - lowercase_wstr += std::towlower(wc); - } else { - lowercase_wstr += wc; - } +static std::string tolowerUnicode(const std::string &input_str) { + // Use system locale + std::setlocale(LC_ALL, ""); + + // From char string to wchar string + std::wstring input_wstr(input_str.size() + 1, '\0'); + std::mbstowcs(&input_wstr[0], input_str.c_str(), input_str.size()); + std::wstring lowercase_wstr; + + for (wchar_t wc : input_wstr) { + if (std::iswupper(wc)) { + lowercase_wstr += std::towlower(wc); + } else { + lowercase_wstr += wc; } - - // Back to char string - std::string lowercase_str(input_str.size()+1, '\0'); - std:wcstombs(&lowercase_str[0], lowercase_wstr.c_str(), lowercase_wstr.size()); + } + + // Back to char string + std::string lowercase_str(input_str.size() + 1, '\0'); + std::wcstombs(&lowercase_str[0], lowercase_wstr.c_str(), + lowercase_wstr.size()); - return lowercase_str; + return lowercase_str; } int32_t main(int32_t argc, char *argv[]) {