diff options
author | Richard Linden <none@none> | 2012-11-20 15:55:04 -0800 |
---|---|---|
committer | Richard Linden <none@none> | 2012-11-20 15:55:04 -0800 |
commit | 5d51175cd79b15cf036cd7e6bd646a1a0777eb7f (patch) | |
tree | d1716593a5afaf5602e6b62d7440751c046c78b4 /indra/llcommon/llunit.h | |
parent | c0224cc47a2994956f20e8f65177b60cc709e434 (diff) |
SH-3406 WIP convert fast timers to lltrace system
fixes to merge
Diffstat (limited to 'indra/llcommon/llunit.h')
-rw-r--r-- | indra/llcommon/llunit.h | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/indra/llcommon/llunit.h b/indra/llcommon/llunit.h index 1fe492fdce..53570779fc 100644 --- a/indra/llcommon/llunit.h +++ b/indra/llcommon/llunit.h @@ -109,9 +109,9 @@ struct LLUnit return mValue; } - template<typename NEW_UNIT_TYPE> LLUnit<NEW_UNIT_TYPE, STORAGE_TYPE> as() + template<typename NEW_UNIT_TYPE, typename NEW_STORAGE_TYPE> LLUnit<NEW_UNIT_TYPE, NEW_STORAGE_TYPE> as() { - return LLUnit<NEW_UNIT_TYPE, STORAGE_TYPE>(*this); + return LLUnit<NEW_UNIT_TYPE, NEW_STORAGE_TYPE>(*this); } void operator += (storage_t value) @@ -332,21 +332,27 @@ struct HighestPrecisionType<LLUnit<UNIT_TYPE, STORAGE_TYPE> > typedef typename HighestPrecisionType<STORAGE_TYPE>::type_t type_t; }; -#define LL_DECLARE_DERIVED_UNIT(base_unit_name, unit_name, conversion_factor) \ -struct unit_name \ -{ \ - typedef base_unit_name base_unit_t; \ -}; \ -template<typename STORAGE_TYPE> \ -struct ConversionFactor<unit_name, base_unit_name, STORAGE_TYPE> \ -{ \ - static typename HighestPrecisionType<STORAGE_TYPE>::type_t get() { return typename HighestPrecisionType<STORAGE_TYPE>::type_t(conversion_factor); } \ -}; \ - \ -template<typename STORAGE_TYPE> \ -struct ConversionFactor<base_unit_name, unit_name, STORAGE_TYPE> \ -{ \ - static typename HighestPrecisionType<STORAGE_TYPE>::type_t get() { return typename HighestPrecisionType<STORAGE_TYPE>::type_t(1.0 / (conversion_factor)); } \ +#define LL_DECLARE_DERIVED_UNIT(base_unit_name, unit_name, conversion_factor) \ +struct unit_name \ +{ \ + typedef base_unit_name base_unit_t; \ +}; \ +template<typename STORAGE_TYPE> \ +struct ConversionFactor<unit_name, base_unit_name, STORAGE_TYPE> \ +{ \ + static typename HighestPrecisionType<STORAGE_TYPE>::type_t get() \ + { \ + return typename HighestPrecisionType<STORAGE_TYPE>::type_t(conversion_factor); \ + } \ +}; \ + \ +template<typename STORAGE_TYPE> \ +struct ConversionFactor<base_unit_name, unit_name, STORAGE_TYPE> \ +{ \ + static typename HighestPrecisionType<STORAGE_TYPE>::type_t get() \ + { \ + return typename HighestPrecisionType<STORAGE_TYPE>::type_t(1.0 / (conversion_factor)); \ + } \ } struct Bytes { typedef Bytes base_unit_t; }; |