From f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 29 Oct 2024 14:49:26 +0800 Subject: format * format * Minor test fixes * enable checking cpp format in ci --- source/core/slang-process-util.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'source/core/slang-process-util.cpp') diff --git a/source/core/slang-process-util.cpp b/source/core/slang-process-util.cpp index 47484156d..62cc4b1dc 100644 --- a/source/core/slang-process-util.cpp +++ b/source/core/slang-process-util.cpp @@ -2,15 +2,17 @@ #include "slang-process-util.h" -#include "slang-string.h" +#include "slang-com-helper.h" #include "slang-string-escape-util.h" #include "slang-string-util.h" +#include "slang-string.h" -#include "slang-com-helper.h" - -namespace Slang { +namespace Slang +{ -/* static */SlangResult ProcessUtil::execute(const CommandLine& commandLine, ExecuteResult& outExecuteResult) +/* static */ SlangResult ProcessUtil::execute( + const CommandLine& commandLine, + ExecuteResult& outExecuteResult) { RefPtr process; SLANG_RETURN_ON_FAIL(Process::create(commandLine, 0, process)); @@ -27,11 +29,15 @@ static Index _getCount(List* buf) static String _getText(const ConstArrayView& bytes) { StringBuilder buf; - StringUtil::appendStandardLines(UnownedStringSlice((const char*)bytes.begin(), (const char*)bytes.end()), buf); + StringUtil::appendStandardLines( + UnownedStringSlice((const char*)bytes.begin(), (const char*)bytes.end()), + buf); return buf.produceString(); } -/* static */SlangResult ProcessUtil::readUntilTermination(Process* process, ExecuteResult& outExecuteResult) +/* static */ SlangResult ProcessUtil::readUntilTermination( + Process* process, + ExecuteResult& outExecuteResult) { List stdOut; List stdError; @@ -47,7 +53,10 @@ static String _getText(const ConstArrayView& bytes) return SLANG_OK; } -/* static */SlangResult ProcessUtil::readUntilTermination(Process* process, List* outStdOut, List* outStdError) +/* static */ SlangResult ProcessUtil::readUntilTermination( + Process* process, + List* outStdOut, + List* outStdError) { Stream* stdOutStream = process->getStream(StdStreamType::Out); Stream* stdErrorStream = process->getStream(StdStreamType::ErrorOut); @@ -70,7 +79,7 @@ static String _getText(const ConstArrayView& bytes) } // Read anything remaining - for(;;) + for (;;) { const auto preCount = _getCount(outStdOut) + _getCount(outStdError); StreamUtil::readOrDiscard(stdOutStream, 0, outStdOut); -- cgit v1.2.3