Apply formating to all files. CLeanup
This commit is contained in:
parent
b4ae5dde77
commit
91fb72bd49
928 changed files with 14515 additions and 21479 deletions
|
|
@ -1,59 +1,54 @@
|
|||
#include "NewPlacement.hpp"
|
||||
|
||||
#include "Logging.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
namespace tp {
|
||||
|
||||
Logger* gLogger = nullptr;
|
||||
|
||||
ualni Logger::Report::getLineCount() const {
|
||||
return (ualni)(mLineOffsets.size() - 1);
|
||||
}
|
||||
|
||||
String Logger::Report::getString() const {
|
||||
return mData;
|
||||
}
|
||||
|
||||
void Logger::Report::calcLineCount() {
|
||||
mData.calcLineOffsets(mLineOffsets);
|
||||
}
|
||||
|
||||
Logger::Report::Report() {
|
||||
mData = " - ";
|
||||
}
|
||||
|
||||
Logger::Report::Report(const String& text) : mData(text) {
|
||||
calcLineCount();
|
||||
}
|
||||
|
||||
Logger::Report::Report(const String& text, Type type) : mType(type), mData(text) {
|
||||
calcLineCount();
|
||||
}
|
||||
|
||||
void Logger::write(const String& in, bool post, Report::Type type) {
|
||||
mBuff.pushBack(Report(in, type));
|
||||
mLineCount += mBuff.last()->data.getLineCount();
|
||||
if (!mCursor) mCursor = mBuff.last();
|
||||
if (post) printf("%s", in.read());
|
||||
}
|
||||
|
||||
String Logger::read() {
|
||||
if (!mCursor) return {};
|
||||
const Report& out = mCursor->data;
|
||||
mCursor = mCursor->next;
|
||||
return out.getString();
|
||||
}
|
||||
|
||||
void Logger::initializeGlobal() {
|
||||
DEBUG_ASSERT(!gLogger)
|
||||
gLogger = new Logger();
|
||||
}
|
||||
|
||||
void Logger::deinitializeGlobal() {
|
||||
DEBUG_ASSERT(gLogger)
|
||||
delete gLogger;
|
||||
gLogger = nullptr;
|
||||
}
|
||||
#include "NewPlacement.hpp"
|
||||
|
||||
#include "Logging.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
namespace tp {
|
||||
|
||||
Logger* gLogger = nullptr;
|
||||
|
||||
ualni Logger::Report::getLineCount() const { return (ualni) (mLineOffsets.size() - 1); }
|
||||
|
||||
String Logger::Report::getString() const { return mData; }
|
||||
|
||||
void Logger::Report::calcLineCount() { mData.calcLineOffsets(mLineOffsets); }
|
||||
|
||||
Logger::Report::Report() { mData = " - "; }
|
||||
|
||||
Logger::Report::Report(const String& text) :
|
||||
mData(text) {
|
||||
calcLineCount();
|
||||
}
|
||||
|
||||
Logger::Report::Report(const String& text, Type type) :
|
||||
mType(type),
|
||||
mData(text) {
|
||||
calcLineCount();
|
||||
}
|
||||
|
||||
void Logger::write(const String& in, bool post, Report::Type type) {
|
||||
mBuff.pushBack(Report(in, type));
|
||||
mLineCount += mBuff.last()->data.getLineCount();
|
||||
if (!mCursor) mCursor = mBuff.last();
|
||||
if (post) printf("%s", in.read());
|
||||
}
|
||||
|
||||
String Logger::read() {
|
||||
if (!mCursor) return {};
|
||||
const Report& out = mCursor->data;
|
||||
mCursor = mCursor->next;
|
||||
return out.getString();
|
||||
}
|
||||
|
||||
void Logger::initializeGlobal() {
|
||||
DEBUG_ASSERT(!gLogger)
|
||||
gLogger = new Logger();
|
||||
}
|
||||
|
||||
void Logger::deinitializeGlobal() {
|
||||
DEBUG_ASSERT(gLogger)
|
||||
delete gLogger;
|
||||
gLogger = nullptr;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,23 +1,17 @@
|
|||
|
||||
#include "Strings.hpp"
|
||||
#include "Allocators.hpp"
|
||||
#include "Logging.hpp"
|
||||
|
||||
using namespace tp;
|
||||
|
||||
bool initialize(const ModuleManifest*) {
|
||||
Logger::initializeGlobal();
|
||||
return true;
|
||||
}
|
||||
|
||||
void deinitialize(const ModuleManifest*) {
|
||||
Logger::deinitializeGlobal();
|
||||
}
|
||||
|
||||
static tp::ModuleManifest* sModuleDependencies[] = {
|
||||
&tp::gModuleContainers,
|
||||
&tp::gModuleAllocators,
|
||||
nullptr
|
||||
};
|
||||
|
||||
|
||||
#include "Strings.hpp"
|
||||
#include "Allocators.hpp"
|
||||
#include "Logging.hpp"
|
||||
|
||||
using namespace tp;
|
||||
|
||||
bool initialize(const ModuleManifest*) {
|
||||
Logger::initializeGlobal();
|
||||
return true;
|
||||
}
|
||||
|
||||
void deinitialize(const ModuleManifest*) { Logger::deinitializeGlobal(); }
|
||||
|
||||
static tp::ModuleManifest* sModuleDependencies[] = { &tp::gModuleContainers, &tp::gModuleAllocators, nullptr };
|
||||
|
||||
ModuleManifest tp::gModuleStrings = ModuleManifest("Strings", initialize, deinitialize, sModuleDependencies);
|
||||
Loading…
Add table
Add a link
Reference in a new issue