From 4607df13b96a79d702dd1848b4d435f5831eb622 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 14 Oct 2014 16:25:06 -0400 Subject: Reorder LLEventDetail::listenerNameForCoro[Impl]() decls for Xcode 6. --- indra/llcommon/lleventcoro.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/lleventcoro.h b/indra/llcommon/lleventcoro.h index a42af63b65..f55b74ac7e 100755 --- a/indra/llcommon/lleventcoro.h +++ b/indra/llcommon/lleventcoro.h @@ -102,6 +102,9 @@ LLVoidListener voidlistener(const LISTENER& listener) namespace LLEventDetail { + /// Implementation for listenerNameForCoro(), see below + LL_COMMON_API std::string listenerNameForCoroImpl(const void* self_id); + /** * waitForEventOn() permits a coroutine to temporarily listen on an * LLEventPump any number of times. We don't really want to have to ask @@ -129,9 +132,6 @@ namespace LLEventDetail return listenerNameForCoroImpl(self.get_id()); } - /// Implementation for listenerNameForCoro() - LL_COMMON_API std::string listenerNameForCoroImpl(const void* self_id); - /** * Implement behavior described for postAndWait()'s @a replyPumpNamePath * parameter: -- cgit v1.2.3 From f45b809bd7f0b9afb4d530ec0acb2d06eaafe41b Mon Sep 17 00:00:00 2001 From: callum_linden Date: Fri, 17 Oct 2014 12:39:09 -0700 Subject: Update to build on Xcode 6.0: reorder code and additional scoing in template classes to make clang happy --- indra/llcommon/llunittype.h | 92 +++++++++++++++++++++++---------------------- 1 file changed, 47 insertions(+), 45 deletions(-) (limited to 'indra/llcommon') 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 + LL_FORCE_INLINE static self_t convert(LLUnit v) + { + self_t result; + result.mValue = (STORAGE_TYPE)v.value(); + return result; + } + + template + LL_FORCE_INLINE static self_t convert(LLUnit v) + { + self_t result; + STORAGE_TYPE divisor = ll_convert_units(v, result); + result.mValue /= divisor; + return result; + } + + template + LL_FORCE_INLINE static self_t convert(LLUnit v) + { + typedef typename LLResultTypePromote::type_t result_storage_t; + LLUnit 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 LL_FORCE_INLINE LLUnit(LLUnit 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 - LL_FORCE_INLINE static self_t convert(LLUnit v) - { - self_t result; - result.mValue = (STORAGE_TYPE)v.value(); - return result; - } - - template - LL_FORCE_INLINE static self_t convert(LLUnit v) - { - self_t result; - STORAGE_TYPE divisor = ll_convert_units(v, result); - result.mValue /= divisor; - return result; - } - - template - LL_FORCE_INLINE static self_t convert(LLUnit v) - { - typedef typename LLResultTypePromote::type_t result_storage_t; - LLUnit 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 template LL_FORCE_INLINE void operator += (LLUnitImplicit 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 template LL_FORCE_INLINE void operator -= (LLUnitImplicit other) { - base_t::mValue -= convert(other).value(); + base_t::mValue -= base_t::convert(other).value(); } template LL_FORCE_INLINE bool operator == (LLUnit other) const { - return base_t::mValue == convert(other).value(); + return base_t::mValue == base_t::convert(other).value(); } template LL_FORCE_INLINE bool operator == (LLUnitImplicit other) const { - return base_t::mValue == convert(other).value(); + return base_t::mValue == base_t::convert(other).value(); } template @@ -313,7 +315,7 @@ struct LLUnitImplicit : public LLUnit template LL_FORCE_INLINE bool operator != (LLUnitImplicit other) const { - return base_t::mValue != convert(other).value(); + return base_t::mValue != base_t::convert(other).value(); } template @@ -325,13 +327,13 @@ struct LLUnitImplicit : public LLUnit template LL_FORCE_INLINE bool operator < (LLUnit other) const { - return base_t::mValue < convert(other).value(); + return base_t::mValue < base_t::convert(other).value(); } template LL_FORCE_INLINE bool operator < (LLUnitImplicit other) const { - return base_t::mValue < convert(other).value(); + return base_t::mValue < base_t::convert(other).value(); } template @@ -343,13 +345,13 @@ struct LLUnitImplicit : public LLUnit template LL_FORCE_INLINE bool operator <= (LLUnit other) const { - return base_t::mValue <= convert(other).value(); + return base_t::mValue <= base_t::convert(other).value(); } template LL_FORCE_INLINE bool operator <= (LLUnitImplicit other) const { - return base_t::mValue <= convert(other).value(); + return base_t::mValue <= base_t::convert(other).value(); } template @@ -361,13 +363,13 @@ struct LLUnitImplicit : public LLUnit template LL_FORCE_INLINE bool operator > (LLUnit other) const { - return base_t::mValue > convert(other).value(); + return base_t::mValue > base_t::convert(other).value(); } template LL_FORCE_INLINE bool operator > (LLUnitImplicit other) const { - return base_t::mValue > convert(other).value(); + return base_t::mValue > base_t::convert(other).value(); } template @@ -379,13 +381,13 @@ struct LLUnitImplicit : public LLUnit template LL_FORCE_INLINE bool operator >= (LLUnit other) const { - return base_t::mValue >= convert(other).value(); + return base_t::mValue >= base_t::convert(other).value(); } template LL_FORCE_INLINE bool operator >= (LLUnitImplicit other) const { - return base_t::mValue >= convert(other).value(); + return base_t::mValue >= base_t::convert(other).value(); } template -- cgit v1.2.3 From aca7976b8770aa7464bdba717d508372732f0e39 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Fri, 17 Oct 2014 13:05:04 -0700 Subject: Update to build on Xcode 6.0: turn BACK ON warnings as errors for overloaded virtuals [-Woverloaded-virtual] and fix up first (of many) files --- indra/llcommon/llfile.cpp | 2 +- indra/llcommon/llfile.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llcommon') 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 }; -- cgit v1.2.3 From 4785da9b9f786d761828f711cfda401974cd9238 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Fri, 17 Oct 2014 13:27:48 -0700 Subject: Update to build on Xcode 6.0: TEMP fix to remove broken code (clang) until it's true purpose becomes clear --- indra/llcommon/llpredicate.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llpredicate.h b/indra/llcommon/llpredicate.h index a0e970a799..91d96e64f5 100644 --- a/indra/llcommon/llpredicate.h +++ b/indra/llcommon/llpredicate.h @@ -141,7 +141,8 @@ namespace LLPredicate void require(ENUM e) { - mRule.set(e, require); + // TEMP XCODE6FIX checkin while i figure out what the heck this is supposed to mean + // mRule.set(e, require); } void allow(ENUM e) -- cgit v1.2.3 From 791858f517dcb7df1f056323439966ee685410c4 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Fri, 17 Oct 2014 13:36:05 -0700 Subject: Update to build on Xcode 6.0: remove unused variable [-Wunused-const-variable] --- indra/llcommon/llframetimer.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llcommon') 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 -- cgit v1.2.3 From 41712d35fbc0517854f21a4ccf54fafeda336aa3 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Fri, 17 Oct 2014 13:40:15 -0700 Subject: Update to build on Xcode 6.0: additional scoping required for clang --- indra/llcommon/llinitparam.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/llcommon') 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; } -- cgit v1.2.3 From b826dbcb84f7c047dca5684d36ee1f6f94b7be88 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Fri, 17 Oct 2014 13:48:03 -0700 Subject: Update to build on Xcode 6.0: remove unused member variable that makes clang sad --- indra/llcommon/llsdparam.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llcommon') 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; }; -- cgit v1.2.3 From b2d84b5fc68e947e59b96289a357bd2f515c896c Mon Sep 17 00:00:00 2001 From: callum_linden Date: Fri, 17 Oct 2014 13:50:06 -0700 Subject: Update to build on Xcode 6.0: remove unused function that makes clang sad --- indra/llcommon/llprocessor.cpp | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'indra/llcommon') 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"; -- cgit v1.2.3 From 5c5821b7583bf55889bb13147376919553727a01 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Fri, 17 Oct 2014 14:01:08 -0700 Subject: Update to build on Xcode 6.0: clang warned about comparison of unsigned int to >=0 - correct ifx here is to retype the variable as signed --- indra/llcommon/llsdutil.cpp | 2 +- indra/llcommon/llsdutil.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llcommon') 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. -- cgit v1.2.3 From 8db1250b73b89727b60ba852bb65cf09ff824993 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Fri, 17 Oct 2014 14:08:58 -0700 Subject: Update to build on Xcode 6.0: collection of similar const var not used warnings/errors [-Wunused-const-variable] --- indra/llcommon/llsys.cpp | 4 ---- indra/llcommon/lltimer.cpp | 4 ---- 2 files changed, 8 deletions(-) (limited to 'indra/llcommon') 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 -- cgit v1.2.3 From b23afb709d194d5000963de55c2eb8d19031b0f7 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Fri, 17 Oct 2014 20:24:02 -0700 Subject: Update to build on Xcode 6.0: fix Boost intrusive_ptr scoping issue --- indra/llcommon/llrefcount.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h index 72011d04a0..52b6f8eaa9 100755 --- a/indra/llcommon/llrefcount.h +++ b/indra/llcommon/llrefcount.h @@ -151,8 +151,8 @@ private: * intrusive pointer support for LLThreadSafeRefCount * this allows you to use boost::intrusive_ptr with any LLThreadSafeRefCount-derived type */ -namespace boost -{ +// namespace boost +// { inline void intrusive_ptr_add_ref(LLThreadSafeRefCount* p) { p->ref(); @@ -172,7 +172,7 @@ namespace boost { p->unref(); } -}; +//}; -- cgit v1.2.3 From 3d35d2f78da8a12336df3f12374d91614db2f035 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Fri, 17 Oct 2014 20:24:58 -0700 Subject: Update to build on Xcode 6.0: fix Boost intrusive_ptr scoping issue (part 2 - tidy up) --- indra/llcommon/llrefcount.h | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h index 52b6f8eaa9..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 -- cgit v1.2.3 From cad1df584be0ed62e4ae0393b84e57f192009da5 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Mon, 20 Oct 2014 15:20:10 -0700 Subject: Update to build on Xcode 6.0: fix typo in functions params --- indra/llcommon/llpredicate.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llpredicate.h b/indra/llcommon/llpredicate.h index 91d96e64f5..e6c56a5711 100644 --- a/indra/llcommon/llpredicate.h +++ b/indra/llcommon/llpredicate.h @@ -139,10 +139,9 @@ namespace LLPredicate Rule() {} - void require(ENUM e) + void require(ENUM e, bool match) { - // TEMP XCODE6FIX checkin while i figure out what the heck this is supposed to mean - // mRule.set(e, require); + mRule.set(e, match); } void allow(ENUM e) -- cgit v1.2.3 From ade93d5d19490a1c94df0b749a42c5514d4d88a7 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Tue, 21 Oct 2014 11:38:20 -0700 Subject: Update to build on Xcode 6.0: remove release build unused function --- indra/llcommon/llsd.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp index d8bbb3a74f..57aa7d9c07 100755 --- a/indra/llcommon/llsd.cpp +++ b/indra/llcommon/llsd.cpp @@ -789,10 +789,7 @@ namespace { inline LLSD::Impl& safe(LLSD::Impl* impl) { return LLSD::Impl::safe(impl); } - - inline const LLSD::Impl& safe(const LLSD::Impl* impl) - { return LLSD::Impl::safe(impl); } - + inline ImplMap& makeMap(LLSD::Impl*& var) { return safe(var).makeMap(var); } -- cgit v1.2.3 From 98d8313847c51b415009c9131a0aed14380de1a6 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 22 Oct 2014 12:00:03 -0400 Subject: added skip to llerror_test of nested logging, noted in todo file --- indra/llcommon/tests/llerror_test.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp index 3cefe83440..8084a05288 100755 --- a/indra/llcommon/tests/llerror_test.cpp +++ b/indra/llcommon/tests/llerror_test.cpp @@ -38,6 +38,7 @@ namespace { +# pragma clang diagnostic ignored "-Wunused-function" static bool fatalWasCalled; void fatalCall(const std::string&) { fatalWasCalled = true; } } @@ -383,8 +384,8 @@ namespace if (n1 == std::string::npos) { std::stringstream ss; - ss << message << ": " << "expected to find a copy of " << expected - << " in actual " << actual; + ss << message << ": " << "expected to find a copy of '" << expected + << "' in actual '" << actual << "'"; throw tut::failure(ss.str().c_str()); } } @@ -476,6 +477,7 @@ namespace tut // handle nested logging void ErrorTestObject::test<7>() { + skip("Fails on clang TODO"); outerLogger(); ensure_message_contains(0, "inside"); ensure_message_contains(1, "outside(moo)"); -- cgit v1.2.3 From 745151936e44347b98d48932174168634b72256b Mon Sep 17 00:00:00 2001 From: callum_linden Date: Wed, 22 Oct 2014 10:09:24 -0700 Subject: Update to build on Xcode 6.0 (fix unit tests): fix up Boost linker errors --- indra/llcommon/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 763f5a3521..63d25225c9 100755 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -301,7 +301,7 @@ if (LL_TESTS) LL_ADD_INTEGRATION_TEST(llunits "" "${test_libs}") LL_ADD_INTEGRATION_TEST(stringize "" "${test_libs}") LL_ADD_INTEGRATION_TEST(lleventdispatcher "" "${test_libs}") - LL_ADD_INTEGRATION_TEST(lleventcoro "" "${test_libs};${BOOST_CONTEXT_LIBRARY};${BOOST_COROUTINE_LIBRARY};${BOOST_SYSTEM_LIBRARY}") + LL_ADD_INTEGRATION_TEST(lleventcoro "" "${test_libs};${BOOST_CONTEXT_LIBRARY};${BOOST_THREAD_LIBRARY};${BOOST_COROUTINE_LIBRARY};${BOOST_SYSTEM_LIBRARY}") LL_ADD_INTEGRATION_TEST(llprocess "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llleap "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llstreamqueue "" "${test_libs}") -- cgit v1.2.3 From 428adcb35c2d68700adfebfd14ab1dbae3af654e Mon Sep 17 00:00:00 2001 From: callum_linden Date: Wed, 22 Oct 2014 10:12:36 -0700 Subject: Update to build on Xcode 6.0 (fix unit tests): remove unused functions that trigger clang warnings --- indra/llcommon/tests/llerror_test.cpp | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp index a5aaff10c5..3cefe83440 100755 --- a/indra/llcommon/tests/llerror_test.cpp +++ b/indra/llcommon/tests/llerror_test.cpp @@ -36,14 +36,6 @@ #include "../test/lltut.h" -namespace -{ - void test_that_error_h_includes_enough_things_to_compile_a_message() - { - LL_INFOS() << "!" << LL_ENDL; - } -} - namespace { static bool fatalWasCalled; @@ -381,8 +373,6 @@ namespace }; std::string logFromNamespace(bool id) { return Foo::logFromNamespace(id); } - std::string logFromClassWithNoLogTypeMember(bool id) { ClassWithNoLogType c; return c.logFromMember(id); } - std::string logFromClassWithNoLogTypeStatic(bool id) { return ClassWithNoLogType::logFromStatic(id); } std::string logFromClassWithLogTypeMember(bool id) { ClassWithLogType c; return c.logFromMember(id); } std::string logFromClassWithLogTypeStatic(bool id) { return ClassWithLogType::logFromStatic(id); } @@ -435,9 +425,6 @@ namespace tut testLogName(mRecorder, logFromStatic); testLogName(mRecorder, logFromAnon); testLogName(mRecorder, logFromNamespace); - //testLogName(mRecorder, logFromClassWithNoLogTypeMember, "ClassWithNoLogType"); - //testLogName(mRecorder, logFromClassWithNoLogTypeStatic, "ClassWithNoLogType"); - // XXX: figure out what the exepcted response is for these testLogName(mRecorder, logFromClassWithLogTypeMember, "ClassWithLogType"); testLogName(mRecorder, logFromClassWithLogTypeStatic, "ClassWithLogType"); } -- cgit v1.2.3 From 0bcfb017cec463f6bf79efcc45754dbe6ddb20a2 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Wed, 22 Oct 2014 11:03:00 -0700 Subject: Update to build on Xcode 6.0 (fix unit tests): skip llerror_test test for now - operator << issues on clang --- indra/llcommon/tests/llerror_test.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp index 3cefe83440..2939ae1ece 100755 --- a/indra/llcommon/tests/llerror_test.cpp +++ b/indra/llcommon/tests/llerror_test.cpp @@ -476,6 +476,9 @@ namespace tut // handle nested logging void ErrorTestObject::test<7>() { +#if LL_DARWIN + skip("Skip known failure on clang and intelc due to operator << differences"); +#endif outerLogger(); ensure_message_contains(0, "inside"); ensure_message_contains(1, "outside(moo)"); -- cgit v1.2.3 From 221c521f23e7c661e0c36fcd7a8b40b9db18608f Mon Sep 17 00:00:00 2001 From: callum_linden Date: Wed, 22 Oct 2014 11:38:56 -0700 Subject: Update to build on Xcode 6.0 (fix unit tests): remove unused statement warning --- indra/llcommon/tests/lleventcoro_test.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/tests/lleventcoro_test.cpp b/indra/llcommon/tests/lleventcoro_test.cpp index cb5e15eff2..2096807e53 100755 --- a/indra/llcommon/tests/lleventcoro_test.cpp +++ b/indra/llcommon/tests/lleventcoro_test.cpp @@ -94,7 +94,6 @@ using coroutines::coroutine; template bool match(Iter first, Iter last, std::string match) { std::string::iterator i = match.begin(); - i != match.end(); for(; (first != last) && (i != match.end()); ++i) { if (*first != *i) return false; -- cgit v1.2.3 From 04291ba319a6e68f2c2e9bd8e299878b93424452 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 22 Oct 2014 16:42:18 -0400 Subject: correct merge error in llerror_test.cpp --- indra/llcommon/tests/llerror_test.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp index 8084a05288..febfa782ca 100755 --- a/indra/llcommon/tests/llerror_test.cpp +++ b/indra/llcommon/tests/llerror_test.cpp @@ -39,6 +39,14 @@ namespace { # pragma clang diagnostic ignored "-Wunused-function" + void test_that_error_h_includes_enough_things_to_compile_a_message() + { + LL_INFOS() << "!" << LL_ENDL; + } +} + +namespace +{ static bool fatalWasCalled; void fatalCall(const std::string&) { fatalWasCalled = true; } } -- cgit v1.2.3 From 9e9779d3f88a35bd9d3eb949b6fa08a36b505d5f Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 22 Oct 2014 21:20:10 -0400 Subject: Remove unit test case that relied on undefined order of evaluation in: 'cout << a() << b()' the order of evaluation of a() and b() is undefined. --- indra/llcommon/tests/llerror_test.cpp | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp index 1ac72d13bf..fee9492618 100755 --- a/indra/llcommon/tests/llerror_test.cpp +++ b/indra/llcommon/tests/llerror_test.cpp @@ -453,11 +453,6 @@ namespace return "bar"; } - void uberLogger() - { - LL_INFOS() << "uber(" << outerLogger() << "," << innerLogger() << ")" << LL_ENDL; - } - class LogWhileLogging { public: @@ -485,25 +480,15 @@ namespace tut // handle nested logging void ErrorTestObject::test<7>() { -#if LL_DARWIN - skip("Skip known failure on clang and intelc due to operator << differences"); -#endif outerLogger(); ensure_message_contains(0, "inside"); ensure_message_contains(1, "outside(moo)"); ensure_message_count(2); - uberLogger(); - ensure_message_contains(2, "inside"); - ensure_message_contains(3, "inside"); - ensure_message_contains(4, "outside(moo)"); - ensure_message_contains(5, "uber(bar,moo)"); - ensure_message_count(6); - metaLogger(); - ensure_message_contains(6, "logging"); - ensure_message_contains(7, "meta(baz)"); - ensure_message_count(8); + ensure_message_contains(2, "logging"); + ensure_message_contains(3, "meta(baz)"); + ensure_message_count(4); } template<> template<> -- cgit v1.2.3 From e66844570e42601c1c653d7169c694fd8310fb56 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Wed, 22 Oct 2014 21:31:15 -0700 Subject: Update to build on Xcode 6.0 (fix unit tests): minor fix for debug only unit test --- indra/llcommon/llstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index 76979f29f6..617969ab2a 100755 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -1397,7 +1397,7 @@ void LLStringUtilBase::testHarness() s2.erase( 4, 1 ); llassert( s2 == "hell"); - s2.insert( 0, 'y' ); + s2.insert( 0, "y" ); llassert( s2 == "yhell"); s2.erase( 1, 3 ); llassert( s2 == "yl"); -- cgit v1.2.3 From 918e2b629bd3dadfbe5288c0d72d93bcca1b8cfe Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 23 Oct 2014 20:23:08 -0700 Subject: Bring in new TUT library build. Clean up ensure_equals() overloads. The new TUT library build eliminates the ambiguity about ensure_equals(const char*, ...) versus ensure_equals(const std::string&, ...). Now it's all based on const std::string&. Remove pointless const char* overloads and ambiguous forwarding templates. With clang in Xcode 6, any new datatypes we intend to use with ensure_equals() must have operator<<(std::ostream&, datatype) declared BEFORE lltut.h #includes tut.hpp. Reorder code in certain test source files to guarantee that visibility. --- indra/llcommon/tests/lldependencies_test.cpp | 46 +++++++++++++++++----------- indra/llcommon/tests/llstring_test.cpp | 4 +-- 2 files changed, 30 insertions(+), 20 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/tests/lldependencies_test.cpp b/indra/llcommon/tests/lldependencies_test.cpp index 5395d785b6..b5e189a465 100755 --- a/indra/llcommon/tests/lldependencies_test.cpp +++ b/indra/llcommon/tests/lldependencies_test.cpp @@ -37,29 +37,14 @@ // associated header #include "../lldependencies.h" // other Linden headers -#include "../test/lltut.h" - -using boost::assign::list_of; #if LL_WINDOWS #pragma warning (disable : 4675) // "resolved by ADL" -- just as I want! #endif -typedef LLDependencies<> StringDeps; -typedef StringDeps::KeyList StringList; - -// We use the very cool boost::assign::list_of() construct to specify vectors -// of strings inline. For reasons on which I'm not entirely clear, though, it -// needs a helper function. You can use list_of() to construct an implicit -// StringList (std::vector) by conversion, e.g. for a function -// parameter -- but if you simply write StringList(list_of("etc.")), you get -// ambiguity errors. Shrug! -template -CONTAINER make(const CONTAINER& data) -{ - return data; -} - +/***************************************************************************** +* Display helpers: must be defined BEFORE lltut.h! +*****************************************************************************/ // Display an arbitary value as itself... template std::ostream& display(std::ostream& out, const T& value) @@ -113,6 +98,31 @@ std::ostream& operator<<(std::ostream& out, const std::set& set) return out; } +/***************************************************************************** +* Now we can #include lltut.h +*****************************************************************************/ +#include "../test/lltut.h" + +/***************************************************************************** +* Other helpers +*****************************************************************************/ +using boost::assign::list_of; + +typedef LLDependencies<> StringDeps; +typedef StringDeps::KeyList StringList; + +// We use the very cool boost::assign::list_of() construct to specify vectors +// of strings inline. For reasons on which I'm not entirely clear, though, it +// needs a helper function. You can use list_of() to construct an implicit +// StringList (std::vector) by conversion, e.g. for a function +// parameter -- but if you simply write StringList(list_of("etc.")), you get +// ambiguity errors. Shrug! +template +CONTAINER make(const CONTAINER& data) +{ + return data; +} + const std::string& extract_key(const LLDependencies<>::value_type& entry) { return entry.first; diff --git a/indra/llcommon/tests/llstring_test.cpp b/indra/llcommon/tests/llstring_test.cpp index 93d3968dbf..a7aa347222 100755 --- a/indra/llcommon/tests/llstring_test.cpp +++ b/indra/llcommon/tests/llstring_test.cpp @@ -27,11 +27,11 @@ */ #include "linden_common.h" -#include "../test/lltut.h" #include #include "../llstring.h" -#include "StringVec.h" +#include "StringVec.h" // must come BEFORE lltut.h +#include "../test/lltut.h" using boost::assign::list_of; -- cgit v1.2.3