diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-10-29 14:49:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-29 14:49:26 +0800 |
| commit | f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch) | |
| tree | ea1d61342cd29368e19135000ec2948813096205 /tools/slang-replay/main.cpp | |
| parent | a729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff) | |
format
* format
* Minor test fixes
* enable checking cpp format in ci
Diffstat (limited to 'tools/slang-replay/main.cpp')
| -rw-r--r-- | tools/slang-replay/main.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/tools/slang-replay/main.cpp b/tools/slang-replay/main.cpp index ac7654794..d27faacb3 100644 --- a/tools/slang-replay/main.cpp +++ b/tools/slang-replay/main.cpp @@ -1,16 +1,15 @@ -#include <memory> -#include <stdio.h> +#include "../../source/core/slang-io.h" -#include <replay/recordFile-processor.h> +#include <memory> #include <replay/json-consumer.h> +#include <replay/recordFile-processor.h> #include <replay/replay-consumer.h> #include <replay/slang-decoder.h> - -#include "../../source/core/slang-io.h" +#include <stdio.h> struct Options { - bool convertToJson {false}; + bool convertToJson{false}; Slang::String recordFileName; }; @@ -18,14 +17,15 @@ void printUsage() { printf("Usage: slang-replay [options] <record-file>\n"); printf("Options:\n"); - printf(" --convert-json, -cj: Convert the record file to a JSON file in the same directory with record file.\n\ + printf( + " --convert-json, -cj: Convert the record file to a JSON file in the same directory with record file.\n\ When this option is set, it won't replay the record file.\n"); } -Options parseOption(int argc, char *argv[]) +Options parseOption(int argc, char* argv[]) { Options option; - char const* arg {}; + char const* arg{}; if (argc <= 1) { printUsage(); @@ -33,7 +33,7 @@ Options parseOption(int argc, char *argv[]) } int argIndex = 1; - while(argIndex < argc) + while (argIndex < argc) { arg = argv[argIndex]; @@ -43,14 +43,12 @@ Options parseOption(int argc, char *argv[]) option.recordFileName = arg; argIndex++; } - else if ( (strcmp("--convert-json", arg) == 0) || - (strcmp("-cj", arg) == 0) ) + else if ((strcmp("--convert-json", arg) == 0) || (strcmp("-cj", arg) == 0)) { option.convertToJson = true; argIndex++; } - else if ( (strcmp("--help", arg) == 0) || - (strcmp("-h", arg) == 0) ) + else if ((strcmp("--help", arg) == 0) || (strcmp("-h", arg) == 0)) { printUsage(); exit(0); @@ -73,7 +71,7 @@ Options parseOption(int argc, char *argv[]) return option; } -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { Options options = parseOption(argc, argv); @@ -97,9 +95,9 @@ int main(int argc, char *argv[]) recordFileProcessor.addDecoder(&decoder); - while(true) + while (true) { - if(!recordFileProcessor.processNextBlock()) + if (!recordFileProcessor.processNextBlock()) { break; } |
