mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-11-09 01:51:58 +00:00
Reformat code with clang format
This commit is contained in:
1 parent
22e17272fd
commit
6b4f5d94a8
1099 files changed
+16763
-18076
No files matched your search
@@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "DeclarationModifier.h"
|
||||
#include "Domain/Evaluation/IEvaluation.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class ArrayDeclarationModifier final : public DeclarationModifier
|
||||
{
|
||||
|
||||
@@ -42,21 +42,6 @@ const BaseTypeDefinition* const BaseTypeDefinition::UNSIGNED_LONG = new BaseType
|
||||
const BaseTypeDefinition* const BaseTypeDefinition::LONG_LONG = new BaseTypeDefinition("long long", 8);
|
||||
const BaseTypeDefinition* const BaseTypeDefinition::UNSIGNED_LONG_LONG = new BaseTypeDefinition("unsigned long long", 8);
|
||||
const BaseTypeDefinition* const BaseTypeDefinition::VOID = new BaseTypeDefinition("void", 0);
|
||||
const BaseTypeDefinition* const BaseTypeDefinition::ALL_BASE_TYPES[]
|
||||
{
|
||||
FLOAT,
|
||||
DOUBLE,
|
||||
BOOL,
|
||||
CHAR,
|
||||
UNSIGNED_CHAR,
|
||||
SHORT,
|
||||
UNSIGNED_SHORT,
|
||||
INT,
|
||||
UNSIGNED_INT,
|
||||
LONG,
|
||||
UNSIGNED_LONG,
|
||||
LONG_LONG,
|
||||
UNSIGNED_LONG_LONG,
|
||||
VOID
|
||||
};
|
||||
const size_t BaseTypeDefinition::ALL_BASE_TYPES_COUNT = std::extent<decltype(ALL_BASE_TYPES)>::value;
|
||||
const BaseTypeDefinition* const BaseTypeDefinition::ALL_BASE_TYPES[]{
|
||||
FLOAT, DOUBLE, BOOL, CHAR, UNSIGNED_CHAR, SHORT, UNSIGNED_SHORT, INT, UNSIGNED_INT, LONG, UNSIGNED_LONG, LONG_LONG, UNSIGNED_LONG_LONG, VOID};
|
||||
const size_t BaseTypeDefinition::ALL_BASE_TYPES_COUNT = std::extent<decltype(ALL_BASE_TYPES)>::value;
|
||||
@@ -1,11 +1,10 @@
|
||||
#include "DataDefinition.h"
|
||||
|
||||
#include "Utils/NamespaceBuilder.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <sstream>
|
||||
|
||||
#include "Utils/NamespaceBuilder.h"
|
||||
|
||||
DataDefinition::DataDefinition(std::string _namespace, std::string name)
|
||||
: m_namespace(std::move(_namespace)),
|
||||
m_name(std::move(name))
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
enum class DataDefinitionType
|
||||
{
|
||||
STRUCT,
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
|
||||
std::string m_namespace;
|
||||
std::string m_name;
|
||||
|
||||
|
||||
_NODISCARD virtual DataDefinitionType GetType() const = 0;
|
||||
_NODISCARD virtual unsigned GetAlignment() const = 0;
|
||||
_NODISCARD virtual bool GetForceAlignment() const = 0;
|
||||
|
||||
@@ -19,4 +19,4 @@ public:
|
||||
DeclarationModifier& operator=(DeclarationModifier&& other) noexcept = default;
|
||||
|
||||
_NODISCARD virtual DeclarationModifierType GetType() const = 0;
|
||||
};
|
||||
};
|
||||
@@ -14,25 +14,25 @@ DefinitionWithMembers::DefinitionWithMembers(std::string _namespace, std::string
|
||||
{
|
||||
}
|
||||
|
||||
//void DefinitionWithMembers::CalculateAlignment()
|
||||
// void DefinitionWithMembers::CalculateAlignment()
|
||||
//{
|
||||
// if (m_has_alignment_override)
|
||||
// {
|
||||
// m_flags |= FLAG_ALIGNMENT_FORCED;
|
||||
// m_alignment = m_alignment_override;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// m_alignment = 0;
|
||||
// for (const auto& member : m_members)
|
||||
// {
|
||||
// const auto memberAlignment = member->GetAlignment();
|
||||
// if (memberAlignment > m_alignment)
|
||||
// m_alignment = memberAlignment;
|
||||
// }
|
||||
// }
|
||||
// m_flags |= FLAG_ALIGNMENT_CALCULATED;
|
||||
//}
|
||||
// if (m_has_alignment_override)
|
||||
// {
|
||||
// m_flags |= FLAG_ALIGNMENT_FORCED;
|
||||
// m_alignment = m_alignment_override;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// m_alignment = 0;
|
||||
// for (const auto& member : m_members)
|
||||
// {
|
||||
// const auto memberAlignment = member->GetAlignment();
|
||||
// if (memberAlignment > m_alignment)
|
||||
// m_alignment = memberAlignment;
|
||||
// }
|
||||
// }
|
||||
// m_flags |= FLAG_ALIGNMENT_CALCULATED;
|
||||
// }
|
||||
|
||||
unsigned DefinitionWithMembers::GetAlignment() const
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "DataDefinition.h"
|
||||
#include "Variable.h"
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
class DefinitionWithMembers : public DataDefinition
|
||||
{
|
||||
public:
|
||||
@@ -30,4 +30,4 @@ public:
|
||||
_NODISCARD unsigned GetAlignment() const override;
|
||||
_NODISCARD bool GetForceAlignment() const override;
|
||||
_NODISCARD unsigned GetSize() const override;
|
||||
};
|
||||
};
|
||||
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "BaseTypeDefinition.h"
|
||||
#include "DataDefinition.h"
|
||||
#include "EnumMember.h"
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
class EnumDefinition final : public DataDefinition
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -10,4 +10,4 @@ public:
|
||||
|
||||
EnumMember();
|
||||
EnumMember(std::string name, int value);
|
||||
};
|
||||
};
|
||||
@@ -49,7 +49,7 @@ bool PointerDeclarationModifier::CountEvaluationIsArray() const
|
||||
|
||||
bool PointerDeclarationModifier::CountEvaluationIsArray(const int index) const
|
||||
{
|
||||
if(index >= 0 && m_count_evaluation_by_array_index.size() > static_cast<unsigned>(index))
|
||||
if (index >= 0 && m_count_evaluation_by_array_index.size() > static_cast<unsigned>(index))
|
||||
{
|
||||
return EvaluationIsArray(m_count_evaluation_by_array_index[index].get());
|
||||
}
|
||||
@@ -62,7 +62,7 @@ bool PointerDeclarationModifier::AnyCountEvaluationIsArray() const
|
||||
if (m_count_evaluation && EvaluationIsArray(m_count_evaluation.get()))
|
||||
return true;
|
||||
|
||||
for(const auto& arrayCountEvaluation : m_count_evaluation_by_array_index)
|
||||
for (const auto& arrayCountEvaluation : m_count_evaluation_by_array_index)
|
||||
{
|
||||
if (EvaluationIsArray(arrayCountEvaluation.get()))
|
||||
return true;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "DeclarationModifier.h"
|
||||
#include "Domain/Evaluation/IEvaluation.h"
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
class PointerDeclarationModifier final : public DeclarationModifier
|
||||
{
|
||||
static const IEvaluation* const DEFAULT_COUNT;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "TypeDeclaration.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "ArrayDeclarationModifier.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
TypeDeclaration::TypeDeclaration(const DataDefinition* type)
|
||||
: m_flags(0),
|
||||
m_size(0),
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "DataDefinition.h"
|
||||
#include "DeclarationModifier.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "DataDefinition.h"
|
||||
#include "DeclarationModifier.h"
|
||||
|
||||
class TypeDeclaration
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
class UnionDefinition final : public DefinitionWithMembers
|
||||
{
|
||||
//protected:
|
||||
// void CalculateSize() override;
|
||||
// protected:
|
||||
// void CalculateSize() override;
|
||||
|
||||
public:
|
||||
UnionDefinition(std::string _namespace, std::string name, int pack);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "TypeDeclaration.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "TypeDeclaration.h"
|
||||
|
||||
class Variable
|
||||
{
|
||||
public:
|
||||
|
||||
Reference in new issue
Block a user