SH-3406 WIP convert fast timers to lltrace system

improved LLUnit compile time errors
removed cassert in favor of llstatic_assert
master
Richard Linden 2012-12-06 14:30:56 -08:00
parent 60800dacdd
commit 2facd63745
5 changed files with 6 additions and 10 deletions

View File

@ -41,7 +41,6 @@
#include <algorithm>
// std headers
#include <typeinfo>
#include <cassert>
#include <cmath>
#include <cctype>
// external library headers

View File

@ -76,7 +76,6 @@ documentation and/or software.
#include "llmd5.h"
#include <cassert>
#include <iostream> // cerr
// how many bytes to grab at a time when checking files

View File

@ -210,8 +210,7 @@ inline LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::LLSkipMap()
: mInsertFirst(NULL),
mEquals(defaultEquals)
{
// Skipmaps must have binary depth of at least 2
cassert(BINARY_DEPTH >= 2);
llstatic_assert(BINARY_DEPTH >= 2, "Skipmaps must have binary depth of at least 2");
S32 i;
for (i = 0; i < BINARY_DEPTH; i++)
@ -229,8 +228,7 @@ inline LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::LLSkipMap(BOOL (*insert_f
: mInsertFirst(insert_first),
mEquals(equals)
{
// Skipmaps must have binary depth of at least 2
cassert(BINARY_DEPTH >= 2);
llstatic_assert(BINARY_DEPTH >= 2, "Skipmaps must have binary depth of at least 2");
mLevel = 1;
S32 i;

View File

@ -271,10 +271,11 @@ LLUnit<UNIT_TYPE, STORAGE_TYPE> operator * (LLUnit<UNIT_TYPE, STORAGE_TYPE> firs
}
template<typename UNIT_TYPE1, typename STORAGE_TYPE1, typename UNIT_TYPE2, typename STORAGE_TYPE2>
void operator * (LLUnit<UNIT_TYPE1, STORAGE_TYPE1>, LLUnit<UNIT_TYPE2, STORAGE_TYPE2>)
LLUnit<UNIT_TYPE1, STORAGE_TYPE1> operator * (LLUnit<UNIT_TYPE1, STORAGE_TYPE1>, LLUnit<UNIT_TYPE2, STORAGE_TYPE2>)
{
// spurious use of dependent type to stop gcc from triggering the static assertion before instantiating the template
llstatic_assert(sizeof(STORAGE_TYPE1) == 0, "Multiplication of unit types results in new unit type - not supported.");
return LLUnit<UNIT_TYPE1, STORAGE_TYPE1>();
}
//
@ -293,10 +294,10 @@ LLUnit<UNIT_TYPE, STORAGE_TYPE> operator / (LLUnit<UNIT_TYPE, STORAGE_TYPE> firs
}
template<typename UNIT_TYPE1, typename STORAGE_TYPE1, typename UNIT_TYPE2, typename STORAGE_TYPE2>
void operator / (LLUnit<UNIT_TYPE1, STORAGE_TYPE1>, LLUnit<UNIT_TYPE2, STORAGE_TYPE2>)
STORAGE_TYPE1 operator / (LLUnit<UNIT_TYPE1, STORAGE_TYPE1> first, LLUnit<UNIT_TYPE2, STORAGE_TYPE2> second)
{
// spurious use of dependent type to stop gcc from triggering the static assertion before instantiating the template
llstatic_assert(sizeof(STORAGE_TYPE1) == 0, "Multiplication of unit types results in new unit type - not supported.");
return STORAGE_TYPE1(first.value() / second.value());
}
#define COMPARISON_OPERATORS(op) \

View File

@ -30,7 +30,6 @@
#define LLVIEW_CPP
#include "llview.h"
#include <cassert>
#include <sstream>
#include <boost/tokenizer.hpp>
#include <boost/foreach.hpp>