fix usage of numeric_limits static functions min() and max()

Functions min() and max() of std::numeric_limits<T> are static
and can therefore be accessed via class name and :: operator.
pull/324/head
Thoronador 10 years ago
parent 8d6f953185
commit 4d62541b62

@ -507,7 +507,7 @@ namespace MWGui
mScrollBar->setVisible(true);
}
BookTypesetter::Ptr typesetter = BookTypesetter::create (mHistory->getWidth(), std::numeric_limits<int>().max());
BookTypesetter::Ptr typesetter = BookTypesetter::create (mHistory->getWidth(), std::numeric_limits<int>::max());
for (std::vector<DialogueText*>::iterator it = mHistoryContents.begin(); it != mHistoryContents.end(); ++it)
(*it)->write(typesetter, &mKeywordSearch, mTopicLinks);

@ -220,7 +220,7 @@ namespace MWMechanics
// Use the smallest soulgem that is large enough to hold the soul
MWWorld::ContainerStore& container = caster.getClass().getContainerStore(caster);
MWWorld::ContainerStoreIterator gem = container.end();
float gemCapacity = std::numeric_limits<float>().max();
float gemCapacity = std::numeric_limits<float>::max();
std::string soulgemFilter = "misc_soulgem"; // no other way to check for soulgems? :/
for (MWWorld::ContainerStoreIterator it = container.begin(MWWorld::ContainerStore::Type_Miscellaneous);
it != container.end(); ++it)

@ -515,7 +515,7 @@ void RenderingManager::configureFog(const float density, const Ogre::ColourValue
if (density == 0)
{
mFogStart = 0;
mFogEnd = std::numeric_limits<float>().max();
mFogEnd = std::numeric_limits<float>::max();
mRendering.getCamera()->setFarClipDistance (max);
}
else

@ -153,7 +153,7 @@ namespace MWScript
if (cell->getCell()->hasWater())
runtime.push (cell->getWaterLevel());
else
runtime.push (-std::numeric_limits<float>().max());
runtime.push (-std::numeric_limits<float>::max());
}
};

@ -438,7 +438,7 @@ namespace MWScript
// If the objects are in different worldspaces, return a large value (just like vanilla)
if (ref.getCell()->getCell()->getCellId().mWorldspace != ref2.getCell()->getCell()->getCellId().mWorldspace)
return std::numeric_limits<float>().max();
return std::numeric_limits<float>::max();
double diff[3];

@ -29,7 +29,7 @@ namespace MWSound
else if (type == SampleType_Int16)
{
value = *reinterpret_cast<const Ogre::int16*>(&data[sample*advance]);
value /= float(std::numeric_limits<Ogre::int16>().max());
value /= float(std::numeric_limits<Ogre::int16>::max());
}
else if (type == SampleType_Float32)
{

@ -124,10 +124,10 @@ namespace MWWorld
void Scene::getGridCenter(int &cellX, int &cellY)
{
int maxX = std::numeric_limits<int>().min();
int maxY = std::numeric_limits<int>().min();
int minX = std::numeric_limits<int>().max();
int minY = std::numeric_limits<int>().max();
int maxX = std::numeric_limits<int>::min();
int maxY = std::numeric_limits<int>::min();
int minX = std::numeric_limits<int>::max();
int minY = std::numeric_limits<int>::max();
CellStoreCollection::iterator iter = mActiveCells.begin();
while (iter!=mActiveCells.end())
{

@ -34,8 +34,8 @@ namespace ESMTerrain
if (!land)
return false;
min = std::numeric_limits<float>().max();
max = -std::numeric_limits<float>().max();
min = std::numeric_limits<float>::max();
max = -std::numeric_limits<float>::max();
for (int row=0; row<ESM::Land::LAND_SIZE; ++row)
{
for (int col=0; col<ESM::Land::LAND_SIZE; ++col)

@ -15,8 +15,8 @@ namespace Gui
public:
NumericEditBox()
: mValue(0), mMinValue(std::numeric_limits<int>().min()),
mMaxValue(std::numeric_limits<int>().max())
: mValue(0), mMinValue(std::numeric_limits<int>::min()),
mMaxValue(std::numeric_limits<int>::max())
{}
void initialiseOverride();

Loading…
Cancel
Save