diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2021-05-06 08:53:42 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-06 08:53:42 -0400 |
| commit | bd4735480a2e6b53585a4f764ae13804e0737a21 (patch) | |
| tree | 52d2255734db8cbb8b36b334a79f41fc612d40ed /ZAPD/ZFile.cpp | |
| parent | ae468e0c343a37bb055fd495df49e6ca4885bd8f (diff) | |
Add a `format` rule to Makefile (#134)
* Add format rule to makefile
* run format
Diffstat (limited to 'ZAPD/ZFile.cpp')
| -rw-r--r-- | ZAPD/ZFile.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/ZAPD/ZFile.cpp b/ZAPD/ZFile.cpp index 37978c1..ada9f38 100644 --- a/ZAPD/ZFile.cpp +++ b/ZAPD/ZFile.cpp @@ -350,8 +350,8 @@ Declaration* ZFile::AddDeclarationArray(uint32_t address, DeclarationAlignment a } Declaration* ZFile::AddDeclarationArray(uint32_t address, DeclarationAlignment alignment, - size_t size, std::string varType, std::string varName, - std::string arrayItemCntStr, std::string body) + size_t size, std::string varType, std::string varName, + std::string arrayItemCntStr, std::string body) { AddDeclarationDebugChecks(address); @@ -530,7 +530,8 @@ void ZFile::GenerateSourceFiles(fs::path outputDir) { string path = Path::GetFileNameWithoutExtension(res->GetName()).c_str(); - string assetOutDir = (outputDir / Path::GetFileNameWithoutExtension(res->GetOutName())).string(); + string assetOutDir = + (outputDir / Path::GetFileNameWithoutExtension(res->GetOutName())).string(); string declType = res->GetSourceTypeName(); std::string incStr = StringHelper::Sprintf("%s.%s.inc", assetOutDir.c_str(), @@ -574,7 +575,8 @@ void ZFile::GenerateSourceFiles(fs::path outputDir) sourceOutput += ProcessDeclarations(); string outPath = - (Globals::Instance->sourceOutputPath / (Path::GetFileNameWithoutExtension(name) + ".c")).string(); + (Globals::Instance->sourceOutputPath / (Path::GetFileNameWithoutExtension(name) + ".c")) + .string(); OutputFormatter formatter; formatter.Write(sourceOutput); @@ -901,19 +903,19 @@ string ZFile::ProcessDeclarations() if (item.second->arrayItemCntStr != "") { output += StringHelper::Sprintf("%s %s[%s];\n", item.second->varType.c_str(), - item.second->varName.c_str(), - item.second->arrayItemCntStr.c_str()); + item.second->varName.c_str(), + item.second->arrayItemCntStr.c_str()); } else if (item.second->arrayItemCnt == 0) { output += StringHelper::Sprintf("%s %s[];\n", item.second->varType.c_str(), - item.second->varName.c_str()); + item.second->varName.c_str()); } else { output += StringHelper::Sprintf("%s %s[%i];\n", item.second->varType.c_str(), - item.second->varName.c_str(), - item.second->arrayItemCnt); + item.second->varName.c_str(), + item.second->arrayItemCnt); } } else @@ -1001,7 +1003,8 @@ string ZFile::ProcessDeclarations() if (item.second->arrayItemCntStr != "") output += StringHelper::Sprintf( "%s %s[%s] = {\n #include \"%s\"\n};\n\n", item.second->varType.c_str(), - item.second->varName.c_str(), item.second->arrayItemCntStr.c_str(), item.second->includePath.c_str()); + item.second->varName.c_str(), item.second->arrayItemCntStr.c_str(), + item.second->includePath.c_str()); else output += StringHelper::Sprintf( "%s %s[] = {\n #include \"%s\"\n};\n\n", item.second->varType.c_str(), @@ -1018,16 +1021,16 @@ string ZFile::ProcessDeclarations() { if (item.second->arrayItemCntStr != "") { - output += StringHelper::Sprintf("%s %s[%s];\n", item.second->varType.c_str(), - item.second->varName.c_str(), - item.second->arrayItemCntStr.c_str()); + output += StringHelper::Sprintf( + "%s %s[%s];\n", item.second->varType.c_str(), + item.second->varName.c_str(), item.second->arrayItemCntStr.c_str()); } else { if (item.second->arrayItemCnt == 0) output += - StringHelper::Sprintf("%s %s[] = {\n", item.second->varType.c_str(), - item.second->varName.c_str()); + StringHelper::Sprintf("%s %s[] = {\n", item.second->varType.c_str(), + item.second->varName.c_str()); else output += StringHelper::Sprintf( "%s %s[%i] = {\n", item.second->varType.c_str(), |
