add CachedFactory, remove gcc warnings

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@722 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
syntheticpp 2006-10-16 10:30:16 +00:00
parent 8e2c06d853
commit 6f706cff82
3 changed files with 31 additions and 6 deletions

View file

@ -214,7 +214,7 @@ namespace Loki
{
assert(byTime>0);
this->maxCreation = maxCreation;
this->timeValidity = (clock_t)(byTime * CLOCKS_PER_SEC / 1000);
this->timeValidity = static_cast<clock_t>(byTime * CLOCKS_PER_SEC / 1000);
D( cout << "Setting no more than "<< maxCreation <<" creation within " << this->timeValidity <<" ms"<< endl; )
}
};
@ -467,7 +467,7 @@ namespace Loki
{
if(m_vKeys.size()==0)
throw EvictionException();
size_type random = (size_type)((m_vKeys.size()*rand())/(int)(RAND_MAX + 1));
size_type random = static_cast<size_type>((m_vKeys.size()*rand())/int(RAND_MAX + 1));
iterator pos = m_vKeys.begin()+random;
DT& evictKey = *pos;
remove(evictKey);