[mac] Fixed build errors

This commit is contained in:
Alex Zolotarev 2011-10-03 04:11:59 +03:00 committed by Alex Zolotarev
parent 8f57de6066
commit 1e40e08c61
3 changed files with 15 additions and 11 deletions

View file

@ -110,9 +110,6 @@ unix|win32-g++ {
QMAKE_CXXFLAGS_RELEASE += -O3
QMAKE_CFLAGS_RELEASE *= -ffast-math
QMAKE_CXXFLAGS_RELEASE *= -ffast-math
QMAKE_CFLAGS *= -fdata-sections -ffunction-sections
QMAKE_CXXFLAGS *= -fdata-sections -ffunction-sections
QMAKE_LFLAGS *= -Wl,--gc-sections
}
linux-g++* {
@ -121,6 +118,9 @@ linux-g++* {
QMAKE_CFLAGS_RELEASE += -flto
QMAKE_CXXFLAGS_RELEASE += -flto
QMAKE_LFLAGS_RELEASE += -flto
QMAKE_CFLAGS *= -fdata-sections -ffunction-sections
QMAKE_CXXFLAGS *= -fdata-sections -ffunction-sections
QMAKE_LFLAGS *= -Wl,--gc-sections
}
win32-g++ {

View file

@ -1,5 +1,7 @@
#include "feature_utils.hpp"
#include "classificator.hpp"
#include "feature.hpp"
#include "../geometry/point2d.hpp"
#include "../base/base.hpp"
#include "../std/vector.hpp"
@ -47,24 +49,24 @@ public:
uint8_t GetSearchRank(FeatureType const & feature) const
{
uint32_t const population = feature.GetPopulation();
uint32_t population = feature.GetPopulation();
FeatureBase::GetTypesFn types;
feature.ForEachTypeRef(types);
for (size_t i = 0; i < types.m_size; ++i)
{
if (types.m_types[i] == m_TypeVillage)
population = max(population, 1000);
population = max(population, static_cast<uint32_t>(1000));
else if (types.m_types[i] == m_TypeTown)
population = max(population, 10000);
population = max(population, static_cast<uint32_t>(10000));
else if (types.m_types[i] == m_TypeCity)
population = max(population, 100000);
population = max(population, static_cast<uint32_t>(100000));
else if (types.m_types[i] == m_TypeCityCapital)
population = max(population, 1000000);
population = max(population, static_cast<uint32_t>(1000000));
else if (types.m_types[i] == m_TypeCountry)
population = max(population, 2000000);
population = max(population, static_cast<uint32_t>(2000000));
else if (types.m_types[i] == m_TypeContinent)
population = max(population, 20000000);
population = max(population, static_cast<uint32_t>(20000000));
}
return static_cast<uint8_t>(log(double(population)) / log(1.1));

View file

@ -1,8 +1,10 @@
#pragma once
#include "feature.hpp"
#include "../geometry/rect2d.hpp"
#include "../base/base.hpp"
class FeatureType;
namespace feature
{