summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2014-10-21 09:16:56 -0400
committerOz Linden <oz@lindenlab.com>2014-10-21 09:16:56 -0400
commit4c8e526b99cb717e9086dec87a94b56fecad8984 (patch)
tree45294c593721be9bc8def1563b07438554dfa08b /indra/llcommon
parentd3387faca57c560279a6b8b83711a789b84f0ecd (diff)
parenta0a61ff61e6cf38ccbd0d0a9eecb10d532feaf55 (diff)
merge changes for callum fixes and workarounds
Diffstat (limited to 'indra/llcommon')
-rwxr-xr-xindra/llcommon/llfile.cpp2
-rwxr-xr-xindra/llcommon/llfile.h2
-rwxr-xr-xindra/llcommon/llframetimer.cpp1
-rwxr-xr-xindra/llcommon/llinitparam.h10
-rw-r--r--indra/llcommon/llpredicate.h4
-rwxr-xr-xindra/llcommon/llprocessor.cpp15
-rwxr-xr-xindra/llcommon/llrefcount.h36
-rwxr-xr-xindra/llcommon/llsdparam.h1
-rwxr-xr-xindra/llcommon/llsdutil.cpp2
-rwxr-xr-xindra/llcommon/llsdutil.h2
-rwxr-xr-xindra/llcommon/llsys.cpp4
-rwxr-xr-xindra/llcommon/lltimer.cpp4
-rw-r--r--indra/llcommon/llunittype.h92
13 files changed, 74 insertions, 101 deletions
diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp
index 259187c52f..aabc195ba8 100755
--- a/indra/llcommon/llfile.cpp
+++ b/indra/llcommon/llfile.cpp
@@ -807,7 +807,7 @@ std::streamsize llstdio_filebuf::xsgetn(char_type* __s, std::streamsize __n)
return __ret;
}
-std::streamsize llstdio_filebuf::xsputn(char_type* __s, std::streamsize __n)
+std::streamsize llstdio_filebuf::xsputn(const char_type* __s, std::streamsize __n)
{
// Optimization in the always_noconv() case, to be generalized in the
// future: when __n is sufficiently large we write directly instead of
diff --git a/indra/llcommon/llfile.h b/indra/llcommon/llfile.h
index f56b22bf9a..0612071d67 100755
--- a/indra/llcommon/llfile.h
+++ b/indra/llcommon/llfile.h
@@ -188,7 +188,7 @@ protected:
/*virtual*/ int sync();
std::streamsize xsgetn(char_type*, std::streamsize);
- std::streamsize xsputn(char_type*, std::streamsize);
+ std::streamsize xsputn(const char_type*, std::streamsize);
#endif
};
diff --git a/indra/llcommon/llframetimer.cpp b/indra/llcommon/llframetimer.cpp
index 1af2cb8afd..1e9920746b 100755
--- a/indra/llcommon/llframetimer.cpp
+++ b/indra/llcommon/llframetimer.cpp
@@ -37,7 +37,6 @@ U64 LLFrameTimer::sTotalTime = 0;
F64 LLFrameTimer::sTotalSeconds = 0.0;
S32 LLFrameTimer::sFrameCount = 0;
U64 LLFrameTimer::sFrameDeltaTime = 0;
-const F64 USEC_PER_SECOND = 1000000.0;
const F64 USEC_TO_SEC_F64 = 0.000001;
// static
diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h
index 7aa87fcd0e..be3552cb46 100755
--- a/indra/llcommon/llinitparam.h
+++ b/indra/llcommon/llinitparam.h
@@ -1123,7 +1123,7 @@ namespace LLInitParam
void set(const value_t& val, bool flag_as_provided = true)
{
named_value_t::clearValueName();
- setValue(val);
+ named_value_t::setValue(val);
setProvided(flag_as_provided);
}
@@ -1287,7 +1287,7 @@ namespace LLInitParam
// assign block contents to this param-that-is-a-block
void set(const value_t& val, bool flag_as_provided = true)
{
- setValue(val);
+ named_value_t::setValue(val);
named_value_t::clearValueName();
setProvided(flag_as_provided);
}
@@ -2054,7 +2054,7 @@ namespace LLInitParam
Optional& operator =(const value_t& val)
{
- set(val);
+ super_t::set(val);
return *this;
}
@@ -2084,7 +2084,7 @@ namespace LLInitParam
Mandatory& operator =(const value_t& val)
{
- set(val);
+ super_t::set(val);
return *this;
}
@@ -2120,7 +2120,7 @@ namespace LLInitParam
Multiple& operator =(const container_t& val)
{
- set(val);
+ super_t::set(val);
return *this;
}
diff --git a/indra/llcommon/llpredicate.h b/indra/llcommon/llpredicate.h
index a0e970a799..e6c56a5711 100644
--- a/indra/llcommon/llpredicate.h
+++ b/indra/llcommon/llpredicate.h
@@ -139,9 +139,9 @@ namespace LLPredicate
Rule()
{}
- void require(ENUM e)
+ void require(ENUM e, bool match)
{
- mRule.set(e, require);
+ mRule.set(e, match);
}
void allow(ENUM e)
diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp
index 69043dc173..1ee3c7edb0 100755
--- a/indra/llcommon/llprocessor.cpp
+++ b/indra/llcommon/llprocessor.cpp
@@ -204,21 +204,6 @@ namespace
return "Unknown";
}
- std::string compute_CPUFamilyName(const char* cpu_vendor, int composed_family)
- {
- const char* intel_string = "GenuineIntel";
- const char* amd_string = "AuthenticAMD";
- if(!strncmp(cpu_vendor, intel_string, strlen(intel_string)))
- {
- return intel_CPUFamilyName(composed_family);
- }
- else if(!strncmp(cpu_vendor, amd_string, strlen(amd_string)))
- {
- return amd_CPUFamilyName(composed_family);
- }
- return "Unknown";
- }
-
std::string compute_CPUFamilyName(const char* cpu_vendor, int family, int ext_family)
{
const char* intel_string = "GenuineIntel";
diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h
index 72011d04a0..3836a9b5fb 100755
--- a/indra/llcommon/llrefcount.h
+++ b/indra/llcommon/llrefcount.h
@@ -151,29 +151,25 @@ private:
* intrusive pointer support for LLThreadSafeRefCount
* this allows you to use boost::intrusive_ptr with any LLThreadSafeRefCount-derived type
*/
-namespace boost
-{
- inline void intrusive_ptr_add_ref(LLThreadSafeRefCount* p)
- {
- p->ref();
- }
-
- inline void intrusive_ptr_release(LLThreadSafeRefCount* p)
- {
- p->unref();
- }
- inline void intrusive_ptr_add_ref(LLRefCount* p)
- {
- p->ref();
- }
+inline void intrusive_ptr_add_ref(LLThreadSafeRefCount* p)
+{
+ p->ref();
+}
- inline void intrusive_ptr_release(LLRefCount* p)
- {
- p->unref();
- }
-};
+inline void intrusive_ptr_release(LLThreadSafeRefCount* p)
+{
+ p->unref();
+}
+inline void intrusive_ptr_add_ref(LLRefCount* p)
+{
+ p->ref();
+}
+inline void intrusive_ptr_release(LLRefCount* p)
+{
+ p->unref();
+}
#endif
diff --git a/indra/llcommon/llsdparam.h b/indra/llcommon/llsdparam.h
index 1542f95e68..09f1bdf1e3 100755
--- a/indra/llcommon/llsdparam.h
+++ b/indra/llcommon/llsdparam.h
@@ -106,7 +106,6 @@ private:
Parser::name_stack_t mNameStack;
const LLSD* mCurReadSD;
LLSD* mWriteRootSD;
- LLSD* mCurWriteSD;
};
diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp
index 562fd26658..6ad4a97149 100755
--- a/indra/llcommon/llsdutil.cpp
+++ b/indra/llcommon/llsdutil.cpp
@@ -572,7 +572,7 @@ std::string llsd_matches(const LLSD& prototype, const LLSD& data, const std::str
return match_types(prototype.type(), TypeVector(), data.type(), pfx);
}
-bool llsd_equals(const LLSD& lhs, const LLSD& rhs, unsigned bits)
+bool llsd_equals(const LLSD& lhs, const LLSD& rhs, int bits)
{
// We're comparing strict equality of LLSD representation rather than
// performing any conversions. So if the types aren't equal, the LLSD
diff --git a/indra/llcommon/llsdutil.h b/indra/llcommon/llsdutil.h
index d0b536c39a..99cb79aa54 100755
--- a/indra/llcommon/llsdutil.h
+++ b/indra/llcommon/llsdutil.h
@@ -126,7 +126,7 @@ LL_COMMON_API std::string llsd_matches(const LLSD& prototype, const LLSD& data,
/// Deep equality. If you want to compare LLSD::Real values for approximate
/// equality rather than bitwise equality, pass @a bits as for
/// is_approx_equal_fraction().
-LL_COMMON_API bool llsd_equals(const LLSD& lhs, const LLSD& rhs, unsigned bits=-1);
+LL_COMMON_API bool llsd_equals(const LLSD& lhs, const LLSD& rhs, int bits=-1);
// Simple function to copy data out of input & output iterators if
// there is no need for casting.
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index 06e118aa44..c9db73eb99 100755
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -99,8 +99,6 @@ const char MEMINFO_FILE[] = "/proc/meminfo";
extern int errno;
#endif
-
-static const S32 CPUINFO_BUFFER_SIZE = 16383;
LLCPUInfo gSysCPU;
// Don't log memory info any more often than this. It also serves as our
@@ -672,8 +670,6 @@ const std::string& LLOSInfo::getOSVersionString() const
return mOSVersionString;
}
-const S32 STATUS_SIZE = 8192;
-
//static
U32 LLOSInfo::getProcessVirtualSizeKB()
{
diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp
index ab105a82e6..76e892212a 100755
--- a/indra/llcommon/lltimer.cpp
+++ b/indra/llcommon/lltimer.cpp
@@ -39,14 +39,10 @@
# error "architecture not supported"
#endif
-
//
// Locally used constants
//
-const F64 SEC_TO_MICROSEC = 1000000.f;
const U64 SEC_TO_MICROSEC_U64 = 1000000;
-const F64 USEC_TO_SEC_F64 = 0.000001;
-
//---------------------------------------------------------------------------
// Globals and statics
diff --git a/indra/llcommon/llunittype.h b/indra/llcommon/llunittype.h
index 0e05ecd683..ac8504ca61 100644
--- a/indra/llcommon/llunittype.h
+++ b/indra/llcommon/llunittype.h
@@ -87,6 +87,40 @@ struct LLUnit
: mValue(value)
{}
+
+ LL_FORCE_INLINE static self_t convert(self_t v)
+ {
+ return v;
+ }
+
+ template<typename FROM_STORAGE_TYPE>
+ LL_FORCE_INLINE static self_t convert(LLUnit<FROM_STORAGE_TYPE, UNITS> v)
+ {
+ self_t result;
+ result.mValue = (STORAGE_TYPE)v.value();
+ return result;
+ }
+
+ template<typename FROM_UNITS>
+ LL_FORCE_INLINE static self_t convert(LLUnit<STORAGE_TYPE, FROM_UNITS> v)
+ {
+ self_t result;
+ STORAGE_TYPE divisor = ll_convert_units(v, result);
+ result.mValue /= divisor;
+ return result;
+ }
+
+ template<typename FROM_STORAGE_TYPE, typename FROM_UNITS>
+ LL_FORCE_INLINE static self_t convert(LLUnit<FROM_STORAGE_TYPE, FROM_UNITS> v)
+ {
+ typedef typename LLResultTypePromote<FROM_STORAGE_TYPE, STORAGE_TYPE>::type_t result_storage_t;
+ LLUnit<result_storage_t, UNITS> result;
+ result_storage_t divisor = ll_convert_units(v, result);
+ result.value(result.value() / divisor);
+ return self_t(result.value());
+ }
+
+
// unit initialization and conversion
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE LLUnit(LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other)
@@ -183,38 +217,6 @@ struct LLUnit
return mValue >= convert(other).value();
}
- LL_FORCE_INLINE static self_t convert(self_t v)
- {
- return v;
- }
-
- template<typename FROM_STORAGE_TYPE>
- LL_FORCE_INLINE static self_t convert(LLUnit<FROM_STORAGE_TYPE, UNITS> v)
- {
- self_t result;
- result.mValue = (STORAGE_TYPE)v.value();
- return result;
- }
-
- template<typename FROM_UNITS>
- LL_FORCE_INLINE static self_t convert(LLUnit<STORAGE_TYPE, FROM_UNITS> v)
- {
- self_t result;
- STORAGE_TYPE divisor = ll_convert_units(v, result);
- result.mValue /= divisor;
- return result;
- }
-
- template<typename FROM_STORAGE_TYPE, typename FROM_UNITS>
- LL_FORCE_INLINE static self_t convert(LLUnit<FROM_STORAGE_TYPE, FROM_UNITS> v)
- {
- typedef typename LLResultTypePromote<FROM_STORAGE_TYPE, STORAGE_TYPE>::type_t result_storage_t;
- LLUnit<result_storage_t, UNITS> result;
- result_storage_t divisor = ll_convert_units(v, result);
- result.value(result.value() / divisor);
- return self_t(result.value());
- }
-
protected:
storage_t mValue;
};
@@ -269,7 +271,7 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE void operator += (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other)
{
- base_t::mValue += convert(other).value();
+ base_t::mValue += base_t::convert(other).value();
}
using base_t::operator -=;
@@ -283,19 +285,19 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE void operator -= (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other)
{
- base_t::mValue -= convert(other).value();
+ base_t::mValue -= base_t::convert(other).value();
}
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator == (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
- return base_t::mValue == convert(other).value();
+ return base_t::mValue == base_t::convert(other).value();
}
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator == (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
- return base_t::mValue == convert(other).value();
+ return base_t::mValue == base_t::convert(other).value();
}
template<typename STORAGE_T>
@@ -313,7 +315,7 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator != (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
- return base_t::mValue != convert(other).value();
+ return base_t::mValue != base_t::convert(other).value();
}
template<typename STORAGE_T>
@@ -325,13 +327,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator < (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
- return base_t::mValue < convert(other).value();
+ return base_t::mValue < base_t::convert(other).value();
}
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator < (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
- return base_t::mValue < convert(other).value();
+ return base_t::mValue < base_t::convert(other).value();
}
template<typename STORAGE_T>
@@ -343,13 +345,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator <= (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
- return base_t::mValue <= convert(other).value();
+ return base_t::mValue <= base_t::convert(other).value();
}
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator <= (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
- return base_t::mValue <= convert(other).value();
+ return base_t::mValue <= base_t::convert(other).value();
}
template<typename STORAGE_T>
@@ -361,13 +363,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator > (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
- return base_t::mValue > convert(other).value();
+ return base_t::mValue > base_t::convert(other).value();
}
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator > (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
- return base_t::mValue > convert(other).value();
+ return base_t::mValue > base_t::convert(other).value();
}
template<typename STORAGE_T>
@@ -379,13 +381,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator >= (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
- return base_t::mValue >= convert(other).value();
+ return base_t::mValue >= base_t::convert(other).value();
}
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator >= (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
- return base_t::mValue >= convert(other).value();
+ return base_t::mValue >= base_t::convert(other).value();
}
template<typename STORAGE_T>