Minor fixes including removing <> from make_pair usage and using explicit conversions where required by the explicit constructor flags

Now builds/runs using c++11
This commit is contained in:
Anonymous
2014-01-23 08:55:46 -07:00
parent fabe85739d
commit e6431a9fd4
14 changed files with 34 additions and 49 deletions
@@ -180,7 +180,7 @@ void Squad::addUnit(NetworkId const & unit)
//-- Add the unit to the new squad
IGNORE_RETURN(m_unitMap->insert(std::make_pair(unit, &PersistentCrcString::empty)));
IGNORE_RETURN(m_unitMap->insert(std::make_pair(CachedNetworkId(unit), &PersistentCrcString::empty)));
if (leader)
{
@@ -419,7 +419,7 @@ void Squad::buildFormation()
NetworkId const & unit = iterSortedUnitList->second.first;
PersistentCrcString const * unitName = iterSortedUnitList->second.second;
IGNORE_RETURN(m_unitMap->insert(std::make_pair(unit, unitName)));
IGNORE_RETURN(m_unitMap->insert(std::make_pair(CachedNetworkId(unit), unitName)));
}
m_formation.build(*this);
@@ -29,7 +29,7 @@ public:
uint32 sequenceId,
bool clearable,
Command::Priority,
bool auto );
bool autoAttack );
CommandQueueEntry(CommandQueueEntry const &entry);
CommandQueueEntry& operator=(CommandQueueEntry const &);
@@ -168,12 +168,12 @@ void CentralServerConnection::onReceive(const Archive::ByteStream & message)
// return an appropriate response.
if( object && object->isAuthoritative() )
{
GenericValueTypeMessage< std::pair< unsigned int, bool > > rmsg( "CSFindAuthObjectReply", std::make_pair< unsigned int, bool >( msg.getValue().second, true ) );
GenericValueTypeMessage< std::pair< unsigned int, bool > > rmsg( "CSFindAuthObjectReply", std::make_pair( msg.getValue().second, true ) );
GameServer::getInstance().sendToCentralServer( rmsg );
}
else
{
GenericValueTypeMessage< std::pair< unsigned int, bool > > rmsg( "CSFindAuthObjectReply", std::make_pair< unsigned int, bool >( msg.getValue().second, false ) );
GenericValueTypeMessage< std::pair< unsigned int, bool > > rmsg( "CSFindAuthObjectReply", std::make_pair( msg.getValue().second, false ) );
GameServer::getInstance().sendToCentralServer( rmsg );
}
}
@@ -108,20 +108,20 @@ namespace PlanetObjectNamespace
if(index == std::string::npos)
{
parsedVector.push_back(std::make_pair<std::string, std::string::size_type>(eventString, 0));
parsedVector.push_back(std::make_pair(eventString, 0));
return;
}
while(index != std::string::npos)
{
std::string subString = eventString.substr(offset, (index - offset));
parsedVector.push_back(std::make_pair<std::string, std::string::size_type>(subString, index));
parsedVector.push_back(std::make_pair(subString, index));
offset = index + 1;
index = eventString.find(delimiter, offset);
}
std::string subString = eventString.substr(offset, eventString.size());
parsedVector.push_back(std::make_pair<std::string, std::string::size_type>(subString, index));
parsedVector.push_back(std::make_pair(subString, index));
}
const char * makeCopyOfString(const char * rhs)
@@ -279,7 +279,7 @@ void PlayerQuestObject::addNewTask(std::string title, std::string description, i
{
m_taskStatus.push_back(0);
m_taskCounters.push_back(std::make_pair<int,int>(0, counterMax));
m_taskCounters.push_back(std::make_pair(0, counterMax));
m_waypoints.push_back(waypoint);
@@ -315,7 +315,7 @@ void PlayerQuestObject::readInObjVarData()
std::vector<int> maxValues;
if(getObjVars().getItem(s_taskMaxCounterObjVar, maxValues))
for(std::vector<int>::size_type i = 0; i < counters.size(); ++i)
m_taskCounters.push_back(std::make_pair<int,int>(counters[i], maxValues[i]));
m_taskCounters.push_back(std::make_pair(counters[i], maxValues[i]));
}
// Task Status
@@ -463,7 +463,7 @@ std::string const & PlayerQuestObject::getTaskDescription(int index)
void PlayerQuestObject::setTaskCounter(int index, int value)
{
int maxValue = m_taskCounters.get()[index].second;
m_taskCounters.set(static_cast<unsigned int>(index), std::make_pair<int, int>(value, maxValue));
m_taskCounters.set(static_cast<unsigned int>(index), std::make_pair(value, maxValue));
saveDataToObjVars();
}
@@ -6190,7 +6190,7 @@ void TangibleObject::addUserToAccessList(const NetworkId user)
}
else
{
sendControllerMessageToAuthServer(CM_addUserToAccessList, new MessageQueueGenericValueType< std::pair<int, NetworkId> >(std::make_pair<int, NetworkId>(-1, user) ) );
sendControllerMessageToAuthServer(CM_addUserToAccessList, new MessageQueueGenericValueType< std::pair<int, NetworkId> >(std::make_pair(-1, user) ) );
}
}
@@ -6210,7 +6210,7 @@ void TangibleObject::addGuildToAccessList(int guildId)
}
else
{
sendControllerMessageToAuthServer(CM_addUserToAccessList, new MessageQueueGenericValueType< std::pair<int, NetworkId> >(std::make_pair<int, NetworkId>(guildId, NetworkId::cms_invalid) ) );
sendControllerMessageToAuthServer(CM_addUserToAccessList, new MessageQueueGenericValueType< std::pair<int, NetworkId> >(std::make_pair(guildId, NetworkId::cms_invalid) ) );
}
}
@@ -6239,7 +6239,7 @@ void TangibleObject::removeUserFromAccessList(const NetworkId user)
}
else
{
sendControllerMessageToAuthServer(CM_removeUserFromAccessList, new MessageQueueGenericValueType< std::pair<int, NetworkId> >(std::make_pair<int, NetworkId>(-1, user)));
sendControllerMessageToAuthServer(CM_removeUserFromAccessList, new MessageQueueGenericValueType< std::pair<int, NetworkId> >(std::make_pair(-1, user)));
}
}
@@ -6267,7 +6267,7 @@ void TangibleObject::removeGuildFromAccessList(int guildId)
}
else
{
sendControllerMessageToAuthServer(CM_removeUserFromAccessList, new MessageQueueGenericValueType< std::pair<int, NetworkId> >(std::make_pair<int, NetworkId>(guildId, NetworkId::cms_invalid)));
sendControllerMessageToAuthServer(CM_removeUserFromAccessList, new MessageQueueGenericValueType< std::pair<int, NetworkId> >(std::make_pair(guildId, NetworkId::cms_invalid)));
}
}
@@ -6543,7 +6543,7 @@ jlongArray JNICALL ScriptMethodsObjectInfoNamespace::getAllWornItems(JNIEnv *env
{
SlottedContainmentProperty::SlotArrangement const slots = slottedContainment->getSlotArrangement(slottedContainment->getCurrentArrangement()); // Get the old arrangement
for(unsigned int j = 0; j < slots.size(); ++j)
wornObjects.insert(std::make_pair<SlotId, const ServerObject*>(slots[j], item));
wornObjects.insert(std::make_pair(slots[j], item));
}
}
}
@@ -6586,7 +6586,7 @@ jlongArray JNICALL ScriptMethodsObjectInfoNamespace::getAllWornItems(JNIEnv *env
if(!slotOccupied)
{
for(unsigned int j = 0; j < slots.size(); ++j)
wornObjects.insert(std::make_pair<SlotId, const ServerObject*>(slots[j], item));
wornObjects.insert(std::make_pair(slots[j], item));
}
}
}
@@ -61,7 +61,7 @@ int PopulationList::getNearestPopulation(const std::string &scene, int x, int z)
}
}
}
m_populationCache.insert(std::make_pair<Location, int>(where,population));
m_populationCache.insert(std::make_pair(where,population));
return population;
}
}