From: <syn...@us...> - 2008-08-09 15:35:15
|
Revision: 898 http://loki-lib.svn.sourceforge.net/loki-lib/?rev=898&view=rev Author: syntheticpp Date: 2008-08-09 15:35:12 +0000 (Sat, 09 Aug 2008) Log Message: ----------- GCC 4.3 fixes, thanks to Tom Browder Modified Paths: -------------- trunk/include/loki/CachedFactory.h trunk/include/loki/LevelMutex.h trunk/include/loki/SafeFormat.h trunk/test/OrderedStatic/main.cpp Modified: trunk/include/loki/CachedFactory.h =================================================================== --- trunk/include/loki/CachedFactory.h 2008-08-08 22:53:19 UTC (rev 897) +++ trunk/include/loki/CachedFactory.h 2008-08-09 15:35:12 UTC (rev 898) @@ -516,7 +516,7 @@ { if(m_vKeys.empty()) throw EvictionException(); - size_type random = static_cast<size_type>((m_vKeys.size()*rand())/int(RAND_MAX + 1)); + size_type random = static_cast<size_type>((m_vKeys.size()*rand())/(static_cast<size_type>(RAND_MAX) + 1)); remove(*(m_vKeys.begin()+random)); } const char* name(){return "random";} Modified: trunk/include/loki/LevelMutex.h =================================================================== --- trunk/include/loki/LevelMutex.h 2008-08-08 22:53:19 UTC (rev 897) +++ trunk/include/loki/LevelMutex.h 2008-08-09 15:35:12 UTC (rev 898) @@ -34,6 +34,9 @@ #include <pthread.h> #endif +#if !defined(_WIN32) && !defined(_WIN64) + #include <unistd.h> // declares sleep under Linux +#endif /** @par thread_local Keyword The mutexes require compilers to provide thread local storage - meaning each Modified: trunk/include/loki/SafeFormat.h =================================================================== --- trunk/include/loki/SafeFormat.h 2008-08-08 22:53:19 UTC (rev 897) +++ trunk/include/loki/SafeFormat.h 2008-08-09 15:35:12 UTC (rev 898) @@ -24,7 +24,7 @@ #include <cstdio> #include <climits> #include <string> -#include <string> +#include <cstring> #include <stdexcept> #include <utility> #include <cassert> @@ -207,7 +207,7 @@ result_ = -1; return *this; } - const size_t len = std::min(strlen(s), prec_); + const size_t len = std::min(std::strlen(s), prec_); if (width_ > len) { if (LeftJustify()) { Write(s, s + len); @@ -397,15 +397,8 @@ const Char hex1st = uppercase ? 'A' : 'a'; for (;;) { const LOKI_SAFEFORMAT_UNSIGNED_LONG next = n / base; -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable: 4244) -#endif - Char c = n - next * base; -#ifdef _MSC_VER -#pragma warning(pop) -#endif - c += (c <= 9) ? '0' : hex1st - 10; + Char c = static_cast<Char>(n - next * base); + c += (c <= static_cast<Char>(9)) ? '0' : static_cast<Char>(hex1st - 10); *bufLast = c; n = next; if (n == 0) break; Modified: trunk/test/OrderedStatic/main.cpp =================================================================== --- trunk/test/OrderedStatic/main.cpp 2008-08-08 22:53:19 UTC (rev 897) +++ trunk/test/OrderedStatic/main.cpp 2008-08-09 15:35:12 UTC (rev 898) @@ -74,7 +74,7 @@ Loki::OrderedStatic<2,L2> l2; Loki::OrderedStatic<1, std::string, std::string(*)() > s1( &func ); -Loki::OrderedStatic<2, std::string, Loki::Seq<char *> > s2( "s2" ); +Loki::OrderedStatic<2, std::string, Loki::Seq<const char *> > s2( "s2" ); Loki::OrderedStatic<1, Loki::Functor<int>, Loki::Seq<int(*)()> > f1(f); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |