diff options
| author | Léo Lam <leo@leolam.fr> | 2021-03-20 10:17:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-20 05:17:39 -0400 |
| commit | 4751db5c9ee0a25a26379ca5b44efad72215d256 (patch) | |
| tree | ce49e6e23e352c93424343f75b2e10601457a9c3 /ZAPD/ZVector.cpp | |
| parent | 963a282dc10036f367a2cb09bb5651aefc73d2a4 (diff) | |
Add a clang-format config and reformat all source files (#63)
* build: Add genbuildinfo as a dependency for ZAPD object files
* Add a clang-format config and reformat all source files
The existing code style is mostly preserved; this just makes formatting
more consistent and prevents lines from getting too long.
* Fix missing includes
Diffstat (limited to 'ZAPD/ZVector.cpp')
| -rw-r--r-- | ZAPD/ZVector.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ZAPD/ZVector.cpp b/ZAPD/ZVector.cpp index e02631b..68f3739 100644 --- a/ZAPD/ZVector.cpp +++ b/ZAPD/ZVector.cpp @@ -1,10 +1,10 @@ #include "ZVector.h" -#include "ZFile.h" +#include <assert.h> #include "BitConverter.h" -#include "StringHelper.h" #include "File.h" #include "Globals.h" -#include <assert.h> +#include "StringHelper.h" +#include "ZFile.h" ZVector::ZVector() : ZResource() { @@ -13,7 +13,8 @@ ZVector::ZVector() : ZResource() this->dimensions = 0; } -ZVector* ZVector::ExtractFromXML(tinyxml2::XMLElement* reader, const std::vector<uint8_t>& nRawData, const int rawDataIndex, const std::string& nRelPath) +ZVector* ZVector::ExtractFromXML(tinyxml2::XMLElement* reader, const std::vector<uint8_t>& nRawData, + const int rawDataIndex, const std::string& nRelPath) { ZVector* vector = new ZVector(); vector->rawData = nRawData; @@ -41,7 +42,7 @@ void ZVector::ParseRawData() scalars.clear(); - for (uint32_t i = 0; i < this->dimensions; i++) + for (uint32_t i = 0; i < this->dimensions; i++) { ZScalar* scalar = new ZScalar(this->scalarType); scalar->rawDataIndex = currentRawDataIndex; @@ -85,7 +86,9 @@ std::string ZVector::GetSourceTypeName() } else { - std::string output = StringHelper::Sprintf("Encountered unsupported vector type: %d dimensions, %s type", dimensions, ZScalar::MapScalarTypeToOutputType(scalarType).c_str()); + std::string output = StringHelper::Sprintf( + "Encountered unsupported vector type: %d dimensions, %s type", dimensions, + ZScalar::MapScalarTypeToOutputType(scalarType).c_str()); if (Globals::Instance->verbosity >= VERBOSITY_DEBUG) printf("%s\n", output.c_str()); @@ -105,7 +108,8 @@ std::string ZVector::GetSourceValue() std::string ZVector::GetSourceOutputCode(const std::string& prefix) { if (parent != nullptr) - parent->AddDeclaration(rawDataIndex, DeclarationAlignment::None, GetRawDataSize(), GetSourceTypeName(), GetName(), GetSourceValue()); + parent->AddDeclaration(rawDataIndex, DeclarationAlignment::None, GetRawDataSize(), + GetSourceTypeName(), GetName(), GetSourceValue()); return ""; } |
