codebase cleanups

This commit is contained in:
Jack Andersen 2015-07-04 20:27:24 -10:00
parent 0b5cd024d2
commit cd0b2f0926
5 changed files with 28 additions and 21 deletions

View File

@ -9,6 +9,9 @@
#include <string.h>
#include "HECL/Database.hpp"
#include "LogVisor/LogVisor.hpp"
extern LogVisor::LogModule LogModule;
struct ToolPassInfo
{
@ -71,7 +74,10 @@ private:
++it;
}
if (counter == WRAP_INDENT)
it = string.insert(it, WRAP_INDENT, _S(' ')) + WRAP_INDENT;
{
string.insert(it, WRAP_INDENT, _S(' '));
it += WRAP_INDENT;
}
if (it >= string.end())
return;
if (*it != _S('\n'))

View File

@ -50,10 +50,10 @@ public:
}
catch (HECL::Exception& e)
{
HECL::FPrintf(stderr, _S("unable to init project: '%s'\n"), e.swhat());
LogModule.report(LogVisor::Error, _S("unable to init project: '%s'\n"), e.swhat());
return -1;
}
HECL::Printf(_S("initialized project at '%s/.hecl'\n"), m_dir->c_str());
LogModule.report(LogVisor::Info, _S("initialized project at '%s/.hecl'\n"), m_dir->c_str());
return 0;
}

View File

@ -1,13 +1,14 @@
TEMPLATE = app
TARGET = hecl
CONFIG -= Qt
CONFIG += c++11
QT =
LIBS -= -lQtGui -lQtCore
unix:QMAKE_CXXFLAGS += -std=c++11
unix:LIBS += -std=c++11
clang:QMAKE_CXXFLAGS += -stdlib=libc++
clang:LIBS += -stdlib=libc++ -lc++abi
INCLUDEPATH += ../include ../extern/Athena/include ../extern
INCLUDEPATH += ../include \
../extern/Athena/include \
../extern/LogVisor/include \
../extern
LIBPATH += $$OUT_PWD/../lib \
$$OUT_PWD/../blender \

View File

@ -6,6 +6,9 @@
#include <stdexcept>
#include <list>
#include "HECL/Database.hpp"
#include "LogVisor/LogVisor.hpp"
LogVisor::LogModule LogModule("HECLDriver");
#include "ToolBase.hpp"
#include "ToolInit.hpp"
@ -21,6 +24,7 @@
bool XTERM_COLOR = false;
/*
#define HECL_GIT 1234567
#define HECL_GIT_S "1234567"
@ -164,7 +168,7 @@ int main(int argc, const char** argv)
}
catch (HECL::Exception& ex)
{
HECL::FPrintf(stderr,
LogModule.report(LogVisor::Error,
_S("Unable to open discovered project at '%s':\n%s\n"),
rootPath->getAbsolutePath().c_str(), ex.swhat());
return -1;
@ -202,14 +206,14 @@ int main(int argc, const char** argv)
}
catch (HECL::Exception& ex)
{
HECL::FPrintf(stderr,
_S("Unable to construct HECL tool '%s':\n%s\n"),
LogModule.report(LogVisor::Error, _S("Unable to construct HECL tool '%s':\n%s\n"),
toolName.c_str(), ex.swhat());
return -1;
}
if (info.verbosityLevel)
HECL::Printf(_S("Constructed tool '%s' %d\n"), tool->toolName().c_str(), info.verbosityLevel);
LogModule.report(LogVisor::Info, _S("Constructed tool '%s' %d\n"),
tool->toolName().c_str(), info.verbosityLevel);
/* Run tool */
int retval;
@ -219,7 +223,8 @@ int main(int argc, const char** argv)
}
catch (HECL::Exception& ex)
{
HECL::FPrintf(stderr, _S("Error running HECL tool '%s':\n%s\n"), toolName.c_str(), ex.swhat());
LogModule.report(LogVisor::Error, _S("Error running HECL tool '%s':\n%s\n"),
toolName.c_str(), ex.swhat());
return -1;
}

View File

@ -3,11 +3,6 @@ CONFIG += staticlib c++11
TARGET = hecl
CONFIG -= Qt
QT =
unix:QMAKE_CXXFLAGS += -std=c++11
unix:QMAKE_CFLAGS += -std=c99
unix:LIBS += -std=c++11
clang:QMAKE_CXXFLAGS += -stdlib=libc++
clang:LIBS += -stdlib=libc++ -lc++abi
INCLUDEPATH += $$PWD ../include ../extern ../extern/Athena/include