diff --git a/common/lc_commands.cpp b/common/lc_commands.cpp index 0574e1a7..50a82c10 100644 --- a/common/lc_commands.cpp +++ b/common/lc_commands.cpp @@ -1,6 +1,5 @@ #include "lc_global.h" #include "lc_commands.h" -#include "system.h" lcCommand gCommands[LC_NUM_COMMANDS] = { diff --git a/common/lc_profile.cpp b/common/lc_profile.cpp index d680aea2..a11bab06 100644 --- a/common/lc_profile.cpp +++ b/common/lc_profile.cpp @@ -4,7 +4,6 @@ #include "image.h" #include "lc_model.h" #include "project.h" -#include "system.h" lcProfileEntry::lcProfileEntry(const char* Section, const char* Key, int DefaultValue) { @@ -145,8 +144,6 @@ int lcGetProfileInt(LC_PROFILE_KEY Key) lcProfileEntry& Entry = gProfileEntries[Key]; QSettings Settings; - LC_ASSERT(Entry.mType == LC_PROFILE_ENTRY_INT); - return Settings.value(QString("%1/%2").arg(Entry.mSection, Entry.mKey), Entry.mDefault.IntValue).toInt(); } @@ -155,8 +152,6 @@ float lcGetProfileFloat(LC_PROFILE_KEY Key) lcProfileEntry& Entry = gProfileEntries[Key]; QSettings Settings; - LC_ASSERT(Entry.mType == LC_PROFILE_ENTRY_FLOAT); - return Settings.value(QString("%1/%2").arg(Entry.mSection, Entry.mKey), Entry.mDefault.FloatValue).toFloat(); } @@ -165,8 +160,6 @@ QString lcGetProfileString(LC_PROFILE_KEY Key) lcProfileEntry& Entry = gProfileEntries[Key]; QSettings Settings; - LC_ASSERT(Entry.mType == LC_PROFILE_ENTRY_STRING); - return Settings.value(QString("%1/%2").arg(Entry.mSection, Entry.mKey), Entry.mDefault.StringValue).toString(); } @@ -175,8 +168,6 @@ QStringList lcGetProfileStringList(LC_PROFILE_KEY Key) lcProfileEntry& Entry = gProfileEntries[Key]; QSettings Settings; - LC_ASSERT(Entry.mType == LC_PROFILE_ENTRY_STRINGLIST); - return Settings.value(QString("%1/%2").arg(Entry.mSection, Entry.mKey), QStringList()).toStringList(); } @@ -185,8 +176,6 @@ QByteArray lcGetProfileBuffer(LC_PROFILE_KEY Key) lcProfileEntry& Entry = gProfileEntries[Key]; QSettings Settings; - LC_ASSERT(Entry.mType == LC_PROFILE_ENTRY_BUFFER); - return Settings.value(QString("%1/%2").arg(Entry.mSection, Entry.mKey)).toByteArray(); } @@ -195,8 +184,6 @@ void lcSetProfileInt(LC_PROFILE_KEY Key, int Value) lcProfileEntry& Entry = gProfileEntries[Key]; QSettings Settings; - LC_ASSERT(Entry.mType == LC_PROFILE_ENTRY_INT); - Settings.setValue(QString("%1/%2").arg(Entry.mSection, Entry.mKey), Value); } @@ -205,8 +192,6 @@ void lcSetProfileFloat(LC_PROFILE_KEY Key, float Value) lcProfileEntry& Entry = gProfileEntries[Key]; QSettings Settings; - LC_ASSERT(Entry.mType == LC_PROFILE_ENTRY_FLOAT); - Settings.setValue(QString("%1/%2").arg(Entry.mSection, Entry.mKey), Value); } @@ -215,8 +200,6 @@ void lcSetProfileString(LC_PROFILE_KEY Key, const QString& Value) lcProfileEntry& Entry = gProfileEntries[Key]; QSettings Settings; - LC_ASSERT(Entry.mType == LC_PROFILE_ENTRY_STRING); - Settings.setValue(QString("%1/%2").arg(Entry.mSection, Entry.mKey), Value); } @@ -225,8 +208,6 @@ void lcSetProfileStringList(LC_PROFILE_KEY Key, const QStringList& Value) lcProfileEntry& Entry = gProfileEntries[Key]; QSettings Settings; - LC_ASSERT(Entry.mType == LC_PROFILE_ENTRY_STRINGLIST); - Settings.setValue(QString("%1/%2").arg(Entry.mSection, Entry.mKey), Value); } @@ -235,7 +216,5 @@ void lcSetProfileBuffer(LC_PROFILE_KEY Key, const QByteArray& Buffer) lcProfileEntry& Entry = gProfileEntries[Key]; QSettings Settings; - LC_ASSERT(Entry.mType == LC_PROFILE_ENTRY_BUFFER); - Settings.setValue(QString("%1/%2").arg(Entry.mSection, Entry.mKey), Buffer); } diff --git a/common/lc_texture.cpp b/common/lc_texture.cpp index 5bd21af3..bffd70c9 100644 --- a/common/lc_texture.cpp +++ b/common/lc_texture.cpp @@ -3,7 +3,6 @@ #include "lc_application.h" #include "lc_library.h" #include "image.h" -#include "system.h" #include "lc_glextensions.h" lcTexture* gGridTexture; @@ -213,7 +212,6 @@ bool lcTexture::Load(Image* images, int NumLevels, int Flags) // todo: this shou { default: case LC_PIXEL_FORMAT_INVALID: - LC_ASSERT(false); Format = 0; break; case LC_PIXEL_FORMAT_A8: diff --git a/common/system.h b/common/system.h deleted file mode 100644 index ee349798..00000000 --- a/common/system.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _SYSTEM_H_ -#define _SYSTEM_H_ - -// Assert macros. -#ifdef LC_DEBUG - -extern bool lcAssert(const char* FileName, int Line, const char* Expression, const char* Description); - -#define LC_ASSERT(Expr, Desc) \ -do \ -{ \ - static bool Ignore = false; \ - if (!Expr && !Ignore) \ - Ignore = lcAssert(__FILE__, __LINE__, #Expr, Desc); \ -} while (0) - -#define LC_ASSERT_FALSE(Desc) LC_ASSERT(0, Desc) - -#else - -#define LC_ASSERT(...) do { } while(0) - -#define LC_ASSERT_FALSE(Desc) LC_ASSERT(0, Desc) - -#endif - -#if _MSC_VER >= 1600 -#define LC_CASSERT(x) static_assert(x, "Assertion failed: " #x) -#else -#define LC_CASSERT_CONCAT(arg1, arg2) LC_CASSERT_CONCAT_(arg1, arg2) -#define LC_CASSERT_CONCAT_(arg1, arg2) arg1##arg2 - -#define LC_CASSERT(expression)\ -struct LC_CASSERT_CONCAT(__assertion_at_line_, __LINE__) \ -{ \ - lcStaticAssert((expression))> LC_CASSERT_CONCAT(LC_CASSERT_CONCAT(_ASSERTION_FAILED_AT_LINE_, __LINE__), _); \ -}; \ -typedef lcStaticAssertTest LC_CASSERT_CONCAT(__assertion_test_at_line_, __LINE__) - -template struct lcStaticAssert; -template<> struct lcStaticAssert { }; -template struct lcStaticAssertTest { }; -#endif - -#endif // _SYSTEM_H_ diff --git a/common/view.cpp b/common/view.cpp index 49165446..24a1381e 100644 --- a/common/view.cpp +++ b/common/view.cpp @@ -3,7 +3,6 @@ #include "lc_mainwindow.h" #include "camera.h" #include "view.h" -#include "system.h" #include "tr.h" #include "texfont.h" #include "lc_texture.h" @@ -2146,8 +2145,6 @@ bool View::IsTrackToolAllowed(lcTrackTool TrackTool, lcuint32 AllowedTransforms) void View::StartTracking(lcTrackButton TrackButton) { - LC_ASSERT(mTrackButton == LC_TRACKBUTTON_NONE); - mTrackButton = TrackButton; mTrackUpdated = false; mMouseDownX = mInputState.x; diff --git a/leocad.pro b/leocad.pro index 0003d044..a9f89374 100644 --- a/leocad.pro +++ b/leocad.pro @@ -181,7 +181,6 @@ HEADERS += \ common/view.h \ common/tr.h \ common/texfont.h \ - common/system.h \ common/project.h \ common/pieceinf.h \ common/piece.h \ diff --git a/qt/system.cpp b/qt/system.cpp index fb4984cf..a8ed4206 100644 --- a/qt/system.cpp +++ b/qt/system.cpp @@ -1,5 +1,4 @@ #include "lc_global.h" -#include "system.h" #ifdef WIN32