From b3eef140da853414776c8e03a70629a613a25ed0 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 15 Jun 2026 14:05:29 +0200 Subject: workflows/ci: add clang-format job --- um/service/src/windows_error.cpp | 55 +++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 29 deletions(-) (limited to 'um/service/src/windows_error.cpp') diff --git a/um/service/src/windows_error.cpp b/um/service/src/windows_error.cpp index c228536..c6cca1e 100644 --- a/um/service/src/windows_error.cpp +++ b/um/service/src/windows_error.cpp @@ -9,34 +9,31 @@ #include -namespace service -{ - namespace windows_error - { - std::string Category::message(int code) const - { - char* buf_ptr; - - const auto nbwritten = FormatMessageA( - FORMAT_MESSAGE_ALLOCATE_BUFFER - | FORMAT_MESSAGE_FROM_SYSTEM - | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - code, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - reinterpret_cast(&buf_ptr), - 0, - NULL); - - if (0 == nbwritten) - { - LocalFree(buf_ptr); - return "Couldn't format the error message"; - } - - std::string str(buf_ptr, nbwritten - 2); - LocalFree(buf_ptr); - return str; - } +namespace service { +namespace windows_error { + +std::string Category::message(int code) const { + char* buf_ptr; + + const auto nbwritten = FormatMessageA( + FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + code, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + reinterpret_cast(&buf_ptr), + 0, + NULL + ); + + if (0 == nbwritten) { + LocalFree(buf_ptr); + return "Couldn't format the error message"; } + + std::string str(buf_ptr, nbwritten - 2); + LocalFree(buf_ptr); + return str; } + +} // namespace windows_error +} // namespace service -- cgit v1.3