GCC 4.3 fixes, thanks to Tom Browder

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@898 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
syntheticpp 2008-08-09 15:35:12 +00:00
parent 1ca2df042d
commit c6d6cada99
4 changed files with 9 additions and 13 deletions

View file

@ -516,7 +516,7 @@ namespace Loki
{
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";}

View file

@ -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

View file

@ -24,7 +24,7 @@
#include <cstdio>
#include <climits>
#include <string>
#include <string>
#include <cstring>
#include <stdexcept>
#include <utility>
#include <cassert>
@ -207,7 +207,7 @@ namespace Loki
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 @@ namespace Loki
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;

View file

@ -74,7 +74,7 @@ Loki::OrderedStatic<1,L1> l1;
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);