mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-29 05:17:58 +03:00
Apply clang-format to code base
This commit is contained in:
parent
f37d0be806
commit
ddb0522bbf
2199 changed files with 118692 additions and 114392 deletions
|
@ -1,48 +1,51 @@
|
|||
#include "output.hpp"
|
||||
|
||||
#include <cassert>
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
|
||||
#include "locals.hpp"
|
||||
|
||||
namespace Compiler
|
||||
{
|
||||
Output::Output (Locals& locals) : mLocals (locals) {}
|
||||
Output::Output(Locals& locals)
|
||||
: mLocals(locals)
|
||||
{
|
||||
}
|
||||
|
||||
void Output::getCode (std::vector<Interpreter::Type_Code>& code) const
|
||||
void Output::getCode(std::vector<Interpreter::Type_Code>& code) const
|
||||
{
|
||||
code.clear();
|
||||
|
||||
|
||||
// header
|
||||
code.push_back (static_cast<Interpreter::Type_Code> (mCode.size()));
|
||||
|
||||
assert (mLiterals.getIntegerSize()%4==0);
|
||||
code.push_back (static_cast<Interpreter::Type_Code> (mLiterals.getIntegerSize()/4));
|
||||
|
||||
assert (mLiterals.getFloatSize()%4==0);
|
||||
code.push_back (static_cast<Interpreter::Type_Code> (mLiterals.getFloatSize()/4));
|
||||
|
||||
assert (mLiterals.getStringSize()%4==0);
|
||||
code.push_back (static_cast<Interpreter::Type_Code> (mLiterals.getStringSize()/4));
|
||||
|
||||
code.push_back(static_cast<Interpreter::Type_Code>(mCode.size()));
|
||||
|
||||
assert(mLiterals.getIntegerSize() % 4 == 0);
|
||||
code.push_back(static_cast<Interpreter::Type_Code>(mLiterals.getIntegerSize() / 4));
|
||||
|
||||
assert(mLiterals.getFloatSize() % 4 == 0);
|
||||
code.push_back(static_cast<Interpreter::Type_Code>(mLiterals.getFloatSize() / 4));
|
||||
|
||||
assert(mLiterals.getStringSize() % 4 == 0);
|
||||
code.push_back(static_cast<Interpreter::Type_Code>(mLiterals.getStringSize() / 4));
|
||||
|
||||
// code
|
||||
std::copy (mCode.begin(), mCode.end(), std::back_inserter (code));
|
||||
|
||||
std::copy(mCode.begin(), mCode.end(), std::back_inserter(code));
|
||||
|
||||
// literals
|
||||
mLiterals.append (code);
|
||||
mLiterals.append(code);
|
||||
}
|
||||
|
||||
const Literals& Output::getLiterals() const
|
||||
{
|
||||
return mLiterals;
|
||||
}
|
||||
|
||||
|
||||
const std::vector<Interpreter::Type_Code>& Output::getCode() const
|
||||
{
|
||||
return mCode;
|
||||
}
|
||||
|
||||
|
||||
const Locals& Output::getLocals() const
|
||||
{
|
||||
return mLocals;
|
||||
|
@ -52,17 +55,17 @@ namespace Compiler
|
|||
{
|
||||
return mLiterals;
|
||||
}
|
||||
|
||||
|
||||
std::vector<Interpreter::Type_Code>& Output::getCode()
|
||||
{
|
||||
return mCode;
|
||||
}
|
||||
|
||||
|
||||
Locals& Output::getLocals()
|
||||
{
|
||||
return mLocals;
|
||||
}
|
||||
|
||||
|
||||
void Output::clear()
|
||||
{
|
||||
mLiterals.clear();
|
||||
|
@ -70,4 +73,3 @@ namespace Compiler
|
|||
mLocals.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue