Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 3, 2025
1 parent c772e24 commit cd2cfb6
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 21 deletions.
6 changes: 3 additions & 3 deletions cpp-terminal/iostream_initializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
std::size_t Term::IOStreamInitializer::m_counter{0};

#ifdef _WIN32
#pragma warning( push )
#pragma warning( disable : 4297)
#pragma warning(push)
#pragma warning(disable : 4297)
#endif

Term::IOStreamInitializer::IOStreamInitializer() noexcept
Expand Down Expand Up @@ -63,5 +63,5 @@ catch(...)
}

#ifdef _WIN32
#pragma warning( pop )
#pragma warning(pop)
#endif
7 changes: 4 additions & 3 deletions cpp-terminal/private/exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,11 @@ Term::Private::ErrnoException::ErrnoException(const std::int64_t& error, const s
{
setContext(context);
#if defined(_WIN32)
std::wstring message(m_maxSize, L'\0');
std::wstring message(m_maxSize, L'\0');
const errno_t result = _wcserror_s(&message[0], message.size(), static_cast<int>(error));
if(result==0) setMessage(Term::Private::to_narrow(message.c_str()));
else setMessage("_wcserror_s failed");
if(result == 0) setMessage(Term::Private::to_narrow(message.c_str()));
else
setMessage("_wcserror_s failed");
#else
std::string message(m_maxSize, '\0');
message = ::strerror_r(static_cast<std::int32_t>(error), &message[0], message.size()); // NOLINT(readability-container-data-pointer)
Expand Down
6 changes: 3 additions & 3 deletions cpp-terminal/private/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Term::Private::OutputFileHandler& Term::Private::out = reinterpret_cast<Term::Pr
//

#ifdef _WIN32
#pragma warning( push )
#pragma warning( disable : 4297)
#pragma warning(push)
#pragma warning(disable : 4297)
#endif

Term::Private::FileHandler::FileHandler(std::recursive_mutex& mutex, const std::string& file, const std::string& mode) noexcept
Expand Down Expand Up @@ -116,7 +116,7 @@ catch(...)
}

#ifdef _WIN32
#pragma warning( pop )
#pragma warning(pop)
#endif

bool Term::Private::FileHandler::null() const noexcept { return m_null; }
Expand Down
6 changes: 3 additions & 3 deletions cpp-terminal/private/file_initializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ catch(...)
}

#ifdef _WIN32
#pragma warning( push )
#pragma warning( disable : 4297)
#pragma warning(push)
#pragma warning(disable : 4297)
#endif

Term::Private::FileInitializer::FileInitializer() noexcept
Expand Down Expand Up @@ -112,7 +112,7 @@ catch(...)
}

#ifdef _WIN32
#pragma warning( pop )
#pragma warning(pop)
#endif

void Term::Private::FileInitializer::openStandardStreams() noexcept
Expand Down
7 changes: 4 additions & 3 deletions cpp-terminal/private/signals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

#include "cpp-terminal/private/signals.hpp"

#include "cpp-terminal/terminal_impl.hpp"

#include <algorithm>
Expand All @@ -18,10 +19,10 @@
#endif

#ifdef _WIN32
#pragma warning( push )
#pragma warning( disable : 4668)
#pragma warning(push)
#pragma warning(disable : 4668)
#include <windows.h>
#pragma warning( pop )
#pragma warning(pop)
static BOOL WINAPI consoleHandler(DWORD signal)
{
switch(signal)
Expand Down
6 changes: 3 additions & 3 deletions cpp-terminal/terminal_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ std::string Term::Terminal::clear() const noexcept { return "\u001b[3J"; }
Term::Options Term::Terminal::getOptions() const noexcept { return m_options; }

#ifdef _WIN32
#pragma warning( push )
#pragma warning( disable : 4297)
#pragma warning(push)
#pragma warning(disable : 4297)
#endif

Term::Terminal::Terminal() noexcept
Expand All @@ -48,7 +48,7 @@ catch(...)
}

#ifdef _WIN32
#pragma warning( pop )
#pragma warning(pop)
#endif

void Term::Terminal::clean()
Expand Down
6 changes: 3 additions & 3 deletions cpp-terminal/terminal_initializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
std::size_t Term::TerminalInitializer::m_counter{0};

#ifdef _WIN32
#pragma warning( push )
#pragma warning( disable : 4297)
#pragma warning(push)
#pragma warning(disable : 4297)
#endif

Term::TerminalInitializer::TerminalInitializer() noexcept
Expand Down Expand Up @@ -53,5 +53,5 @@ catch(...)
}

#ifdef _WIN32
#pragma warning( pop )
#pragma warning(pop)
#endif

0 comments on commit cd2cfb6

Please sign in to comment.