From 2facd6374517d88f03e3f06b1ccc02565da26b45 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 6 Dec 2012 14:30:56 -0800 Subject: SH-3406 WIP convert fast timers to lltrace system improved LLUnit compile time errors removed cassert in favor of llstatic_assert --- indra/llcommon/llevents.cpp | 1 - indra/llcommon/llmd5.cpp | 1 - indra/llcommon/llskipmap.h | 6 ++---- indra/llcommon/llunit.h | 7 ++++--- 4 files changed, 6 insertions(+), 9 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp index 0855180dcd..1c928b3db8 100644 --- a/indra/llcommon/llevents.cpp +++ b/indra/llcommon/llevents.cpp @@ -41,7 +41,6 @@ #include // std headers #include -#include #include #include // external library headers diff --git a/indra/llcommon/llmd5.cpp b/indra/llcommon/llmd5.cpp index 1409c55d1c..ed80af36d8 100644 --- a/indra/llcommon/llmd5.cpp +++ b/indra/llcommon/llmd5.cpp @@ -76,7 +76,6 @@ documentation and/or software. #include "llmd5.h" -#include #include // cerr // how many bytes to grab at a time when checking files diff --git a/indra/llcommon/llskipmap.h b/indra/llcommon/llskipmap.h index 49ff2928d1..ed53973baa 100644 --- a/indra/llcommon/llskipmap.h +++ b/indra/llcommon/llskipmap.h @@ -210,8 +210,7 @@ inline LLSkipMap::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::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; diff --git a/indra/llcommon/llunit.h b/indra/llcommon/llunit.h index 01e9eb751d..e57974c429 100644 --- a/indra/llcommon/llunit.h +++ b/indra/llcommon/llunit.h @@ -271,10 +271,11 @@ LLUnit operator * (LLUnit firs } template -void operator * (LLUnit, LLUnit) +LLUnit operator * (LLUnit, LLUnit) { // 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(); } // @@ -293,10 +294,10 @@ LLUnit operator / (LLUnit firs } template -void operator / (LLUnit, LLUnit) +STORAGE_TYPE1 operator / (LLUnit first, LLUnit 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) \ -- cgit v1.2.3