improvements from clang-tidy

This commit is contained in:
Axel Kohlmeyer
2023-12-19 23:37:07 -05:00
parent 3237c30117
commit dedbd8f6db
16 changed files with 33 additions and 46 deletions

View File

@ -38,7 +38,7 @@
StdCapture::StdCapture() : m_oldStdOut(0), m_capturing(false)
{
// make stdout unbuffered so that we don't need to flush the stream
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stdout, nullptr, _IONBF, 0);
m_pipe[READ] = 0;
m_pipe[WRITE] = 0;
@ -106,7 +106,7 @@ bool StdCapture::EndCapture()
std::string StdCapture::GetChunk()
{
if (!m_capturing) return std::string();
if (!m_capturing) return {};
int bytesRead = 0;
buf[0] = '\0';
@ -120,7 +120,7 @@ std::string StdCapture::GetChunk()
if (bytesRead > 0) {
buf[bytesRead] = '\0';
}
return std::string(buf);
return {buf};
}
std::string StdCapture::GetCapture()