diff --git a/source/g3d_viewer/main.cpp b/source/g3d_viewer/main.cpp index 51908350..98d91732 100644 --- a/source/g3d_viewer/main.cpp +++ b/source/g3d_viewer/main.cpp @@ -314,7 +314,7 @@ MainWindow::MainWindow( std::pair > unitToLoad, if(modelPath != "") { this->modelPathList.push_back(modelPath); - printf("Startup Adding model [%s] list size %lu\n",modelPath.c_str(),this->modelPathList.size()); + printf("Startup Adding model [%s] list size %zu\n",modelPath.c_str(),this->modelPathList.size()); } if(particlePath != "") { this->particlePathList.push_back(particlePath); @@ -1232,14 +1232,14 @@ void MainWindow::loadModel(string path) { try { if(path != "" && fileExists(path) == true) { this->modelPathList.push_back(path); - printf("Adding model [%s] list size %lu\n",path.c_str(),this->modelPathList.size()); + printf("Adding model [%s] list size %zu\n",path.c_str(),this->modelPathList.size()); } string titlestring=winHeader; for(unsigned int idx =0; idx < this->modelPathList.size(); idx++) { string modelPath = this->modelPathList[idx]; - //printf("Loading model [%s] %u of %lu\n",modelPath.c_str(),idx, this->modelPathList.size()); + //printf("Loading model [%s] %u of %zu\n",modelPath.c_str(),idx, this->modelPathList.size()); if(timer) timer->Stop(); delete model; @@ -1369,7 +1369,7 @@ void MainWindow::loadParticle(string path) { } void MainWindow::loadProjectileParticle(string path) { - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] about to load [%s] particleProjectilePathList.size() = %lu\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,path.c_str(),this->particleProjectilePathList.size()); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] about to load [%s] particleProjectilePathList.size() = %zu\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,path.c_str(),this->particleProjectilePathList.size()); if(timer) timer->Stop(); if(path != "" && fileExists(path) == true) { @@ -1390,7 +1390,7 @@ void MainWindow::loadProjectileParticle(string path) { try { if(this->particleProjectilePathList.empty() == false) { - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("this->particleProjectilePathList.size() = %lu\n",this->particleProjectilePathList.size()); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("this->particleProjectilePathList.size() = %zu\n",this->particleProjectilePathList.size()); string titlestring=winHeader; for(unsigned int idx = 0; idx < this->particleProjectilePathList.size(); idx++) { @@ -1487,7 +1487,7 @@ void MainWindow::loadProjectileParticle(string path) { } void MainWindow::loadSplashParticle(string path) { // uses ParticleSystemTypeSplash::load (and own list...) - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] about to load [%s] particleSplashPathList.size() = %lu\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,path.c_str(),this->particleSplashPathList.size()); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] about to load [%s] particleSplashPathList.size() = %zu\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,path.c_str(),this->particleSplashPathList.size()); if(timer) timer->Stop(); if(path != "" && fileExists(path) == true) { @@ -1590,7 +1590,7 @@ void MainWindow::loadSplashParticle(string path) { // uses ParticleSystemTypeSp wxMessageDialog(NULL, ToUnicode(e.what()), ToUnicode("Not a Mega-Glest projectile particle XML file, or broken"), wxOK | wxICON_ERROR).ShowModal(); } if(timer) timer->Start(100); - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] after load [%s] particleSplashPathList.size() = %lu\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,path.c_str(),this->particleSplashPathList.size()); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] after load [%s] particleSplashPathList.size() = %zu\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,path.c_str(),this->particleSplashPathList.size()); } void MainWindow::onMenuModeNormals(wxCommandEvent &event){ diff --git a/source/glest_game/ai/ai_rule.cpp b/source/glest_game/ai/ai_rule.cpp index 73ecadde..e3cb9c28 100644 --- a/source/glest_game/ai/ai_rule.cpp +++ b/source/glest_game/ai/ai_rule.cpp @@ -921,8 +921,8 @@ void AiRuleProduce::produceSpecific(const ProduceTask *pt){ int currentProducerIndex = producers[i]; if(currentProducerIndex >= aiInterface->getMyUnitCount()) { char szBuf[8096]=""; - printf("In [%s::%s Line: %d] currentProducerIndex >= aiInterface->getMyUnitCount(), currentProducerIndex = %d, aiInterface->getMyUnitCount() = %d, i = %u,producers.size() = %lu\n",__FILE__,__FUNCTION__,__LINE__,currentProducerIndex,aiInterface->getMyUnitCount(),i,(unsigned long)producers.size()); - snprintf(szBuf,8096,"In [%s::%s Line: %d] currentProducerIndex >= aiInterface->getMyUnitCount(), currentProducerIndex = %d, aiInterface->getMyUnitCount() = %u, i = %u,producers.size() = %lu",__FILE__,__FUNCTION__,__LINE__,currentProducerIndex,aiInterface->getMyUnitCount(),i,(unsigned long)producers.size()); + printf("In [%s::%s Line: %d] currentProducerIndex >= aiInterface->getMyUnitCount(), currentProducerIndex = %d, aiInterface->getMyUnitCount() = %d, i = %u,producers.size() = %zu\n",__FILE__,__FUNCTION__,__LINE__,currentProducerIndex,aiInterface->getMyUnitCount(),i,(unsigned long)producers.size()); + snprintf(szBuf,8096,"In [%s::%s Line: %d] currentProducerIndex >= aiInterface->getMyUnitCount(), currentProducerIndex = %d, aiInterface->getMyUnitCount() = %u, i = %u,producers.size() = %zu",__FILE__,__FUNCTION__,__LINE__,currentProducerIndex,aiInterface->getMyUnitCount(),i,(unsigned long)producers.size()); throw megaglest_runtime_error(szBuf); } @@ -953,14 +953,14 @@ void AiRuleProduce::produceSpecific(const ProduceTask *pt){ if(currentProducerIndex >= aiInterface->getMyUnitCount()) { char szBuf[8096]=""; - printf("In [%s::%s Line: %d] currentProducerIndex >= aiInterface->getMyUnitCount(), currentProducerIndex = %d, aiInterface->getMyUnitCount() = %d, i = %u,producers.size() = %lu\n",__FILE__,__FUNCTION__,__LINE__,currentProducerIndex,aiInterface->getMyUnitCount(),i,(unsigned long)producers.size()); - snprintf(szBuf,8096,"In [%s::%s Line: %d] currentProducerIndex >= aiInterface->getMyUnitCount(), currentProducerIndex = %d, aiInterface->getMyUnitCount() = %u, i = %u,producers.size() = %lu",__FILE__,__FUNCTION__,__LINE__,currentProducerIndex,aiInterface->getMyUnitCount(),i,(unsigned long)producers.size()); + printf("In [%s::%s Line: %d] currentProducerIndex >= aiInterface->getMyUnitCount(), currentProducerIndex = %d, aiInterface->getMyUnitCount() = %d, i = %u,producers.size() = %zu\n",__FILE__,__FUNCTION__,__LINE__,currentProducerIndex,aiInterface->getMyUnitCount(),i,(unsigned long)producers.size()); + snprintf(szBuf,8096,"In [%s::%s Line: %d] currentProducerIndex >= aiInterface->getMyUnitCount(), currentProducerIndex = %d, aiInterface->getMyUnitCount() = %u, i = %u,producers.size() = %zu",__FILE__,__FUNCTION__,__LINE__,currentProducerIndex,aiInterface->getMyUnitCount(),i,(unsigned long)producers.size()); throw megaglest_runtime_error(szBuf); } if(prIndex >= producers.size()) { char szBuf[8096]=""; - printf("In [%s::%s Line: %d] prIndex >= producers.size(), currentProducerIndex = %d, i = %u,producers.size() = %lu \n",__FILE__,__FUNCTION__,__LINE__,prIndex,i,(unsigned long)producers.size()); - snprintf(szBuf,8096,"In [%s::%s Line: %d] currentProducerIndex >= producers.size(), currentProducerIndex = %d, i = %u,producers.size() = %lu",__FILE__,__FUNCTION__,__LINE__,currentProducerIndex,i,(unsigned long)producers.size()); + printf("In [%s::%s Line: %d] prIndex >= producers.size(), currentProducerIndex = %d, i = %u,producers.size() = %zu \n",__FILE__,__FUNCTION__,__LINE__,prIndex,i,(unsigned long)producers.size()); + snprintf(szBuf,8096,"In [%s::%s Line: %d] currentProducerIndex >= producers.size(), currentProducerIndex = %d, i = %u,producers.size() = %zu",__FILE__,__FUNCTION__,__LINE__,currentProducerIndex,i,(unsigned long)producers.size()); throw megaglest_runtime_error(szBuf); } @@ -1019,14 +1019,14 @@ void AiRuleProduce::produceSpecific(const ProduceTask *pt){ if(currentProducerIndex >= aiInterface->getMyUnitCount()) { char szBuf[8096]=""; - printf("In [%s::%s Line: %d] currentProducerIndex >= aiInterface->getMyUnitCount(), currentProducerIndex = %d, aiInterface->getMyUnitCount() = %d, i = %u,backupProducers.size() = %lu\n",__FILE__,__FUNCTION__,__LINE__,currentProducerIndex,aiInterface->getMyUnitCount(),i,(unsigned long)backupProducers.size()); - snprintf(szBuf,8096,"In [%s::%s Line: %d] currentProducerIndex >= aiInterface->getMyUnitCount(), currentProducerIndex = %d, aiInterface->getMyUnitCount() = %d, i = %u,backupProducers.size() = %lu",__FILE__,__FUNCTION__,__LINE__,currentProducerIndex,aiInterface->getMyUnitCount(),i,(unsigned long)backupProducers.size()); + printf("In [%s::%s Line: %d] currentProducerIndex >= aiInterface->getMyUnitCount(), currentProducerIndex = %d, aiInterface->getMyUnitCount() = %d, i = %u,backupProducers.size() = %zu\n",__FILE__,__FUNCTION__,__LINE__,currentProducerIndex,aiInterface->getMyUnitCount(),i,(unsigned long)backupProducers.size()); + snprintf(szBuf,8096,"In [%s::%s Line: %d] currentProducerIndex >= aiInterface->getMyUnitCount(), currentProducerIndex = %d, aiInterface->getMyUnitCount() = %d, i = %u,backupProducers.size() = %zu",__FILE__,__FUNCTION__,__LINE__,currentProducerIndex,aiInterface->getMyUnitCount(),i,(unsigned long)backupProducers.size()); throw megaglest_runtime_error(szBuf); } if(prIndex >= backupProducers.size()) { char szBuf[8096]=""; - printf("In [%s::%s Line: %d] prIndex >= backupProducers.size(), currentProducerIndex = %d, i = %u,backupProducers.size() = %lu \n",__FILE__,__FUNCTION__,__LINE__,prIndex,i,(unsigned long)backupProducers.size()); - snprintf(szBuf,8096,"In [%s::%s Line: %d] currentProducerIndex >= backupProducers.size(), currentProducerIndex = %d, i = %u,backupProducers.size() = %lu",__FILE__,__FUNCTION__,__LINE__,currentProducerIndex,i,(unsigned long)backupProducers.size()); + printf("In [%s::%s Line: %d] prIndex >= backupProducers.size(), currentProducerIndex = %d, i = %u,backupProducers.size() = %zu \n",__FILE__,__FUNCTION__,__LINE__,prIndex,i,(unsigned long)backupProducers.size()); + snprintf(szBuf,8096,"In [%s::%s Line: %d] currentProducerIndex >= backupProducers.size(), currentProducerIndex = %d, i = %u,backupProducers.size() = %zu",__FILE__,__FUNCTION__,__LINE__,currentProducerIndex,i,(unsigned long)backupProducers.size()); throw megaglest_runtime_error(szBuf); } diff --git a/source/glest_game/ai/path_finder.cpp b/source/glest_game/ai/path_finder.cpp index c8032c53..9bb8ac9b 100644 --- a/source/glest_game/ai/path_finder.cpp +++ b/source/glest_game/ai/path_finder.cpp @@ -132,7 +132,7 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu // if(frameIndex != factions[unit->getFactionIndex()].lastFromToNodeListFrame) { // if(factions[unit->getFactionIndex()].mapFromToNodeList.size() > 0) { -// printf("clear duplicate list = %lu for faction = %d frameIndex = %d\n",factions[unit->getFactionIndex()].mapFromToNodeList.size(),unit->getFactionIndex(),frameIndex); +// printf("clear duplicate list = %zu for faction = %d frameIndex = %d\n",factions[unit->getFactionIndex()].mapFromToNodeList.size(),unit->getFactionIndex(),frameIndex); // factions[unit->getFactionIndex()].mapFromToNodeList.clear(); // } // factions[unit->getFactionIndex()].lastFromToNodeListFrame = frameIndex; @@ -918,7 +918,7 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) { char szBuf[8096]=""; - snprintf(szBuf,8096,"[Setting new path for unit] openNodesList.size() [%lu] openPosList.size() [%lu] finalPos [%s] targetPos [%s] inBailout [%d] ts [%d]", + snprintf(szBuf,8096,"[Setting new path for unit] openNodesList.size() [%zu] openPosList.size() [%zu] finalPos [%s] targetPos [%s] inBailout [%d] ts [%d]", factions[unitFactionIndex].openNodesList.size(),factions[unitFactionIndex].openPosList.size(),finalPos.getString().c_str(),targetPos.getString().c_str(),inBailout,ts); unit->logSynchData(__FILE__,__LINE__,szBuf); } @@ -975,7 +975,7 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) { char szBuf[8096]=""; - snprintf(szBuf,8096,"[Setting new path for unit] openNodesList.size() [%lu] openPosList.size() [%lu] finalPos [%s] targetPos [%s] inBailout [%d] ts [%d]", + snprintf(szBuf,8096,"[Setting new path for unit] openNodesList.size() [%zu] openPosList.size() [%zu] finalPos [%s] targetPos [%s] inBailout [%d] ts [%d]", factions[unitFactionIndex].openNodesList.size(),factions[unitFactionIndex].openPosList.size(),finalPos.getString().c_str(),targetPos.getString().c_str(),inBailout,ts); unit->logSynchData(__FILE__,__LINE__,szBuf); } @@ -1192,7 +1192,7 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) { char szBuf[8096]=""; - snprintf(szBuf,8096,"[path for unit BLOCKED] openNodesList.size() [%lu] openPosList.size() [%lu] finalPos [%s] targetPos [%s] inBailout [%d] ts [%d]", + snprintf(szBuf,8096,"[path for unit BLOCKED] openNodesList.size() [%zu] openPosList.size() [%zu] finalPos [%s] targetPos [%s] inBailout [%d] ts [%d]", factions[unitFactionIndex].openNodesList.size(),factions[unitFactionIndex].openPosList.size(),finalPos.getString().c_str(),targetPos.getString().c_str(),inBailout,ts); unit->logSynchData(__FILE__,__LINE__,szBuf); } @@ -1268,7 +1268,7 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) { char szBuf[8096]=""; - snprintf(szBuf,8096,"[Setting new path for unit] openNodesList.size() [%lu] openPosList.size() [%lu] finalPos [%s] targetPos [%s] inBailout [%d] ts [%d]", + snprintf(szBuf,8096,"[Setting new path for unit] openNodesList.size() [%zu] openPosList.size() [%zu] finalPos [%s] targetPos [%s] inBailout [%d] ts [%d]", factions[unitFactionIndex].openNodesList.size(),factions[unitFactionIndex].openPosList.size(),finalPos.getString().c_str(),targetPos.getString().c_str(),inBailout,ts); unit->logSynchData(__FILE__,__LINE__,szBuf); diff --git a/source/glest_game/game/commander.cpp b/source/glest_game/game/commander.cpp index f57949b1..3a289c47 100644 --- a/source/glest_game/game/commander.cpp +++ b/source/glest_game/game/commander.cpp @@ -556,7 +556,7 @@ bool Commander::getReplayCommandListForFrame(int worldFrameCount) { bool haveReplyCommands = false; if(replayCommandList.empty() == false) { //int worldFrameCount = world->getFrameCount(); - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("worldFrameCount = %d replayCommandList.size() = %lu\n",worldFrameCount,replayCommandList.size()); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("worldFrameCount = %d replayCommandList.size() = %zu\n",worldFrameCount,replayCommandList.size()); std::vector replayList; for(unsigned int i = 0; i < replayCommandList.size(); ++i) { @@ -569,7 +569,7 @@ bool Commander::getReplayCommandListForFrame(int worldFrameCount) { if(haveReplyCommands == true) { replayCommandList.erase(replayCommandList.begin(),replayCommandList.begin() + replayList.size()); - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("worldFrameCount = %d GIVING COMMANDS replayList.size() = %lu\n",worldFrameCount,replayList.size()); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("worldFrameCount = %d GIVING COMMANDS replayList.size() = %zu\n",worldFrameCount,replayList.size()); for(int i= 0; i < replayList.size(); ++i){ giveNetworkCommand(&replayList[i]); //pushNetworkCommand(&replayList[i]); diff --git a/source/glest_game/game/game.cpp b/source/glest_game/game/game.cpp index 1e444ada..8ad20eb7 100644 --- a/source/glest_game/game/game.cpp +++ b/source/glest_game/game/game.cpp @@ -1648,7 +1648,7 @@ void Game::update() { try { gameStarted = false; - //printf("\nname [%s] scenarioFile [%s] results.size() = %lu\n",name.c_str(),scenarioFile.c_str(),results.size()); + //printf("\nname [%s] scenarioFile [%s] results.size() = %zu\n",name.c_str(),scenarioFile.c_str(),results.size()); //printf("[%s:%s] Line: %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); ScenarioInfo scenarioInfo; Scenario::loadScenarioInfo(scenarioFile, &scenarioInfo); @@ -2443,7 +2443,7 @@ void Game::removeCellMarker(Vec2i surfaceCellPos, const Faction *faction) { gameNetworkInterface->sendUnMarkCellMessage(mc.getTargetPos(),factionIndex); } } - //printf("#1 ADDED in marked list pos [%s] markedCells.size() = %lu\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); + //printf("#1 ADDED in marked list pos [%s] markedCells.size() = %zu\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); //isUnMarkCellEnabled = false; @@ -2818,7 +2818,7 @@ void Game::mouseDownLeft(int x, int y) { //GameNetworkInterface *gameNetworkInterface= NetworkManager::getInstance().getGameNetworkInterface(); //gameNetworkInterface->sendMarkCellMessage(mc.getTargetPos(),mc.getFaction()->getIndex(),mc.getNote()); - //printf("#1 ADDED in marked list pos [%s] markedCells.size() = %lu\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); + //printf("#1 ADDED in marked list pos [%s] markedCells.size() = %zu\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); isMarkCellEnabled = false; cellMarkedData = mc; @@ -2848,7 +2848,7 @@ void Game::mouseDownLeft(int x, int y) { isUnMarkCellEnabled = false; removeCellMarker(surfaceCellPos, world.getThisFaction()); - //printf("#1 ADDED in marked list pos [%s] markedCells.size() = %lu\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); + //printf("#1 ADDED in marked list pos [%s] markedCells.size() = %zu\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); Renderer &renderer= Renderer::getInstance(); //renderer.updateMarkedCellScreenPosQuadCache(surfaceCellPos); @@ -2895,7 +2895,7 @@ void Game::mouseDownLeft(int x, int y) { MarkedCell mc(targetPos,world.getThisFaction(),"placeholder for note",world.getThisFaction()->getStartLocationIndex()); - //printf("#2 ADDED in marked list pos [%s] markedCells.size() = %lu\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); + //printf("#2 ADDED in marked list pos [%s] markedCells.size() = %zu\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); isMarkCellEnabled = false; cellMarkedData = mc; @@ -2925,7 +2925,7 @@ void Game::mouseDownLeft(int x, int y) { isUnMarkCellEnabled = false; removeCellMarker(surfaceCellPos, world.getThisFaction()); - //printf("#1 ADDED in marked list pos [%s] markedCells.size() = %lu\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); + //printf("#1 ADDED in marked list pos [%s] markedCells.size() = %zu\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); //Renderer &renderer= Renderer::getInstance(); //renderer.updateMarkedCellScreenPosQuadCache(surfaceCellPos); @@ -5106,7 +5106,7 @@ void Game::loadGame(string name,Program *programPtr,bool isMasterserverMode) { newGame->lastworldFrameCountForReplay = gameNode->getAttribute("LastWorldFrameCount")->getIntValue(); vector networkCommandNodeList = gameNode->getChildList("NetworkCommand"); - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("networkCommandNodeList.size() = %lu\n",networkCommandNodeList.size()); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("networkCommandNodeList.size() = %zu\n",networkCommandNodeList.size()); for(unsigned int i = 0; i < networkCommandNodeList.size(); ++i) { XmlNode *node = networkCommandNodeList[i]; int worldFrameCount = node->getAttribute("worldFrameCount")->getIntValue(); diff --git a/source/glest_game/global/config.cpp b/source/glest_game/global/config.cpp index ff97b82f..075ea4cf 100644 --- a/source/glest_game/global/config.cpp +++ b/source/glest_game/global/config.cpp @@ -781,7 +781,7 @@ string Config::findValidLocalFileFromPath(string fileName) { vector dirList = config.getPathListForType(ptMaps); replaceFileWithLocalFile(dirList, fileNamePart, result); - printf("Found file [%s] @ %lu [%s]\nNew File [%s]\n",fileName.c_str(),pos,fileNamePart.c_str(),result.c_str()); + printf("Found file [%s] @ %zu [%s]\nNew File [%s]\n",fileName.c_str(),pos,fileNamePart.c_str(),result.c_str()); } else if(fileName.find("tilesets/") != fileName.npos ) { size_t pos = fileName.find("tilesets/"); @@ -790,7 +790,7 @@ string Config::findValidLocalFileFromPath(string fileName) { vector dirList = config.getPathListForType(ptTilesets); replaceFileWithLocalFile(dirList, fileNamePart, result); - printf("Found file [%s] @ %lu [%s]\nNew File [%s]\n",fileName.c_str(),pos,fileNamePart.c_str(),result.c_str()); + printf("Found file [%s] @ %zu [%s]\nNew File [%s]\n",fileName.c_str(),pos,fileNamePart.c_str(),result.c_str()); } else if(fileName.find("techs/") != fileName.npos ) { size_t pos = fileName.find("techs/"); @@ -799,7 +799,7 @@ string Config::findValidLocalFileFromPath(string fileName) { vector dirList = config.getPathListForType(ptTechs); replaceFileWithLocalFile(dirList, fileNamePart, result); - printf("Found file [%s] @ %lu [%s]\nNew File [%s]\n",fileName.c_str(),pos,fileNamePart.c_str(),result.c_str()); + printf("Found file [%s] @ %zu [%s]\nNew File [%s]\n",fileName.c_str(),pos,fileNamePart.c_str(),result.c_str()); } else if(fileName.find("scenarios/") != fileName.npos) { size_t pos = fileName.find("scenarios/"); @@ -808,7 +808,7 @@ string Config::findValidLocalFileFromPath(string fileName) { vector dirList = config.getPathListForType(ptScenarios); replaceFileWithLocalFile(dirList, fileNamePart, result); - printf("Found file [%s] @ %lu [%s]\nNew File [%s]\n",fileName.c_str(),pos,fileNamePart.c_str(),result.c_str()); + printf("Found file [%s] @ %zu [%s]\nNew File [%s]\n",fileName.c_str(),pos,fileNamePart.c_str(),result.c_str()); } else if(fileName.find("tutorials/") != fileName.npos) { size_t pos = fileName.find("tutorials/"); @@ -817,7 +817,7 @@ string Config::findValidLocalFileFromPath(string fileName) { vector dirList = config.getPathListForType(ptTutorials); replaceFileWithLocalFile(dirList, fileNamePart, result); - printf("Found file [%s] @ %lu [%s]\nNew File [%s]\n",fileName.c_str(),pos,fileNamePart.c_str(),result.c_str()); + printf("Found file [%s] @ %zu [%s]\nNew File [%s]\n",fileName.c_str(),pos,fileNamePart.c_str(),result.c_str()); } return result; diff --git a/source/glest_game/graphics/renderer.cpp b/source/glest_game/graphics/renderer.cpp index 73cdcfaa..5e0bd103 100644 --- a/source/glest_game/graphics/renderer.cpp +++ b/source/glest_game/graphics/renderer.cpp @@ -1521,7 +1521,7 @@ void Renderer::computeVisibleQuad() { visibleQuad.p[3].x,visibleQuad.p[3].y); for(unsigned int i = 0; i < quadCache.frustumData.size(); ++i) { - printf("\nFrustrum #%u [%lu]: ",i,quadCache.frustumData.size()); + printf("\nFrustrum #%u [%zu]: ",i,quadCache.frustumData.size()); vector &frustumDataInner = quadCache.frustumData[i]; for(unsigned int j = 0; j < frustumDataInner.size(); ++j) { printf("[%f]",quadCache.frustumData[i][j]); @@ -4468,7 +4468,7 @@ void Renderer::renderSurface(const int renderFps) { std::pair > &surfaceCacheEntity = mapSurfaceData[snapshotOfvisibleQuad.getString()]; surface = &surfaceCacheEntity.second; - //printf("Surface Cache Size for Rendering using VA's = %lu\n",mapSurfaceData.size()); + //printf("Surface Cache Size for Rendering using VA's = %zu\n",mapSurfaceData.size()); } glEnableClientState(GL_VERTEX_ARRAY); @@ -8796,14 +8796,14 @@ VisibleQuadContainerCache & Renderer::getQuadCache( bool updateOnDirtyFrame, if(markedCells.empty() == false) { if(markedCells.find(pos) != markedCells.end()) { - //printf("#1 ******** VISIBLE SCALED CELL FOUND in marked list pos [%s] markedCells.size() = %lu\n",pos.getString().c_str(),markedCells.size()); + //printf("#1 ******** VISIBLE SCALED CELL FOUND in marked list pos [%s] markedCells.size() = %zu\n",pos.getString().c_str(),markedCells.size()); //if(markedCells.empty() == false) { //SurfaceCell *sc = map->getSurfaceCell(pos); //quadCache.visibleScaledCellToScreenPosList[pos]=computeScreenPosition(sc->getVertex()); updateMarkedCellScreenPosQuadCache(pos); } else { - //printf("#1 VISIBLE SCALED CELL NOT FOUND in marked list pos [%s] markedCells.size() = %lu\n",pos.getString().c_str(),markedCells.size()); + //printf("#1 VISIBLE SCALED CELL NOT FOUND in marked list pos [%s] markedCells.size() = %zu\n",pos.getString().c_str(),markedCells.size()); } } } @@ -8818,13 +8818,13 @@ VisibleQuadContainerCache & Renderer::getQuadCache( bool updateOnDirtyFrame, if(markedCells.empty() == false) { if(markedCells.find(pos) != markedCells.end()) { - //printf("#2 ******** VISIBLE SCALED CELL FOUND in marked list pos [%s] markedCells.size() = %lu\n",pos.getString().c_str(),markedCells.size()); + //printf("#2 ******** VISIBLE SCALED CELL FOUND in marked list pos [%s] markedCells.size() = %zu\n",pos.getString().c_str(),markedCells.size()); //if(markedCells.empty() == false) { //quadCache.visibleScaledCellToScreenPosList[pos]=computeScreenPosition(sc->getVertex()); updateMarkedCellScreenPosQuadCache(pos); } else { - //printf("#2 VISIBLE SCALED CELL NOT FOUND in marked list pos [%s] markedCells.size() = %lu\n",pos.getString().c_str(),markedCells.size()); + //printf("#2 VISIBLE SCALED CELL NOT FOUND in marked list pos [%s] markedCells.size() = %zu\n",pos.getString().c_str(),markedCells.size()); } } } diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index 21663ff8..6f2a9207 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -173,13 +173,13 @@ static void cleanupProcessObjects() { SystemFlags::Close(); SystemFlags::SHUTDOWN_PROGRAM_MODE=true; - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("start running threads = %lu\n",Thread::getThreadList().size()); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("start running threads = %zu\n",Thread::getThreadList().size()); time_t elapsed = time(NULL); for(;Thread::getThreadList().size() > 0 && difftime((long int)time(NULL),elapsed) <= 10;) { //sleep(0); } - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("end running threads = %lu\n",Thread::getThreadList().size()); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("end running threads = %zu\n",Thread::getThreadList().size()); std::map &crcPlayerTextureCache = CacheManager::getCachedItem< std::map >(GameConstants::playerTextureCacheLookupKey); //deleteMapValues(crcPlayerTextureCache.begin(),crcPlayerTextureCache.end()); @@ -190,10 +190,10 @@ static void cleanupProcessObjects() { crcFactionPreviewTextureCache.clear(); std::map const * >* > &list2d = FileReader::getFileReadersMap(); - //printf("list2d = %lu\n",list2d.size()); + //printf("list2d = %zu\n",list2d.size()); deleteMapValues(list2d.begin(),list2d.end()); std::map const * >* > &list3d = FileReader::getFileReadersMap(); - //printf("list3d = %lu\n",list3d.size()); + //printf("list3d = %zu\n",list3d.size()); deleteMapValues(list3d.begin(),list3d.end()); XmlIo::getInstance().cleanup(); @@ -1356,7 +1356,7 @@ void runTilesetValidationForPath(string tilesetPath, string tilesetName, } } - printf("Found tileset filecount = %lu, used = %lu\n",(unsigned long)foundFileList.size(),(unsigned long)loadedFileList.size()); + printf("Found tileset filecount = %zu, used = %zu\n",(unsigned long)foundFileList.size(),(unsigned long)loadedFileList.size()); int purgeCount = 0; bool foundUnusedFile = false; @@ -1578,7 +1578,7 @@ void runTilesetValidationForPath(string tilesetPath, string tilesetName, } } - //printf("\nPurge Duplicate Files #2 DISABLED [%lu] - START:\n=====================\n",fileList.size()); + //printf("\nPurge Duplicate Files #2 DISABLED [%zu] - START:\n=====================\n",fileList.size()); for(unsigned int idx = 0; idx < fileList.size(); ++idx) { string duplicateFile = fileList[idx]; @@ -1787,7 +1787,7 @@ void runTechValidationForPath(string techPath, string techName, } } - printf("Found techtree filecount = %lu, used = %lu\n",(unsigned long)foundFileList.size(),(unsigned long)loadedFileList.size()); + printf("Found techtree filecount = %zu, used = %zu\n",(unsigned long)foundFileList.size(),(unsigned long)loadedFileList.size()); // for( std::map >::iterator iterMap = loadedFileList.begin(); // iterMap != loadedFileList.end(); ++iterMap) { @@ -1881,7 +1881,7 @@ void runTechValidationForPath(string techPath, string techName, printf("\nWarning, duplicate files were detected - START:\n=====================\n"); } - printf("----- START duplicate files for CRC [%u] count [%lu] first file is [%s]\n",iterMap->first,fileList.size(),fileList[0].c_str()); + printf("----- START duplicate files for CRC [%u] count [%zu] first file is [%s]\n",iterMap->first,fileList.size(),fileList[0].c_str()); map parentList; for(unsigned int idx = 0; idx < fileList.size(); ++idx) { @@ -1921,7 +1921,7 @@ void runTechValidationForPath(string techPath, string techName, //} } - printf("----- Finding parents for duplicate files [%lu] first file is [%s]\n",fileList.size(),fileList[0].c_str()); + printf("----- Finding parents for duplicate files [%zu] first file is [%s]\n",fileList.size(),fileList[0].c_str()); for(map::iterator iterMap1 = parentList.begin(); iterMap1 != parentList.end(); ++iterMap1) { @@ -1935,7 +1935,7 @@ void runTechValidationForPath(string techPath, string techName, if(purgeDuplicateFiles == true) { //printf("\nPurge Duplicate Files detected - START:\n=====================\n"); - printf("----- move / remove duplicate files [%lu] first file is [%s]\n",fileList.size(),fileList[0].c_str()); + printf("----- move / remove duplicate files [%zu] first file is [%s]\n",fileList.size(),fileList[0].c_str()); // First move first duplicate to commondata and delete all other copies string newCommonFileName = ""; for(unsigned int idx = 0; idx < fileList.size(); ++idx) { @@ -1944,7 +1944,7 @@ void runTechValidationForPath(string techPath, string techName, if(fileExt == "wav" || fileExt == "ogg") { off_t fileSize = getFileSize(duplicateFile); - printf("#1 [%u / %lu] removing duplicate [%s]\n",idx,fileList.size(),duplicateFile.c_str()); + printf("#1 [%u / %zu] removing duplicate [%s]\n",idx,fileList.size(),duplicateFile.c_str()); if(idx == 0) { newCommonFileName = "$COMMONDATAPATH/sounds/" + extractFileFromDirectoryPath(duplicateFile); @@ -2012,7 +2012,7 @@ void runTechValidationForPath(string techPath, string techName, } } - printf("----- update XML files for duplicate files [%lu] first file is [%s]\n",fileList.size(),fileList[0].c_str()); + printf("----- update XML files for duplicate files [%zu] first file is [%s]\n",fileList.size(),fileList[0].c_str()); std::map mapUniqueParentList; // Update the XML files to point to the new single copy in commondata @@ -2082,7 +2082,7 @@ void runTechValidationForPath(string techPath, string techName, } } - //printf("\nPurge Duplicate Files #2 DISABLED [%lu] - START:\n=====================\n",fileList.size()); + //printf("\nPurge Duplicate Files #2 DISABLED [%zu] - START:\n=====================\n",fileList.size()); for(unsigned int idx = 0; idx < fileList.size(); ++idx) { string duplicateFile = fileList[idx]; @@ -2134,7 +2134,7 @@ void runTechValidationForPath(string techPath, string techName, } - printf("----- END duplicate files [%lu] first file is [%s]\n",fileList.size(),fileList[0].c_str()); + printf("----- END duplicate files [%zu] first file is [%s]\n",fileList.size(),fileList[0].c_str()); } } if(foundDuplicates == true) { @@ -3951,7 +3951,7 @@ int glestMain(int argc, char** argv) { string mapName = maps[i]; printf("%s\n",mapName.c_str()); } - printf("===========================================\nTotal: %lu\n",maps.size()); + printf("===========================================\nTotal: %zu\n",maps.size()); return 0; } @@ -4012,13 +4012,13 @@ int glestMain(int argc, char** argv) { string name2 = results2[k]; printf("--> %s\n",name2.c_str()); } - printf("--> Total Factions: %lu\n",results2.size()); + printf("--> Total Factions: %zu\n",results2.size()); break; } } } } - printf("===========================================\nTotal Techtrees: %lu\n",results.size()); + printf("===========================================\nTotal Techtrees: %zu\n",results.size()); return 0; } @@ -4061,7 +4061,7 @@ int glestMain(int argc, char** argv) { string name = results[i]; printf("%s\n",name.c_str()); } - printf("===========================================\nTotal: %lu\n",results.size()); + printf("===========================================\nTotal: %zu\n",results.size()); return 0; } @@ -4125,7 +4125,7 @@ int glestMain(int argc, char** argv) { } } } - printf("===========================================\nTotal: %lu\n",results.size()); + printf("===========================================\nTotal: %zu\n",results.size()); return 0; } @@ -4189,7 +4189,7 @@ int glestMain(int argc, char** argv) { } } } - printf("===========================================\nTotal: %lu\n",results.size()); + printf("===========================================\nTotal: %zu\n",results.size()); return 0; } @@ -4544,7 +4544,7 @@ int glestMain(int argc, char** argv) { renderer.clearBuffers(); renderer.clearZBuffer(); renderer.reset2d(); - snprintf(szTextBuf,8096,"Please wait, converting models [%u of %lu] ...",i,(long int)models.size()); + snprintf(szTextBuf,8096,"Please wait, converting models [%u of %zu] ...",i,(long int)models.size()); if(CoreData::getInstance().getMenuFontBig3D() != NULL) { renderer.renderText3D( @@ -4568,7 +4568,7 @@ int glestMain(int argc, char** argv) { Model *model = renderer.newModel(rsGlobal); try { - printf("About to load model [%s] [%u of %lu]\n",file.c_str(),i,(long int)models.size()); + printf("About to load model [%s] [%u of %zu]\n",file.c_str(),i,(long int)models.size()); model->load(file); modelLoadedOk = true; } diff --git a/source/glest_game/menu/menu_state_connected_game.cpp b/source/glest_game/menu/menu_state_connected_game.cpp index 6f2c14cd..d4bb1947 100644 --- a/source/glest_game/menu/menu_state_connected_game.cpp +++ b/source/glest_game/menu/menu_state_connected_game.cpp @@ -1517,7 +1517,7 @@ void MenuStateConnectedGame::broadCastGameSettingsToHeadlessServer(bool forceNow if(forceNow == true || ((needToBroadcastServerSettings == true ) && ( difftime((long int)time(NULL),broadcastServerSettingsDelayTimer) >= HEADLESSSERVER_BROADCAST_SETTINGS_SECONDS))) { - //printf("In [%s:%s] Line: %d forceNow = %d broadcastServerSettingsDelayTimer = %lu, now =%lu\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,forceNow,broadcastServerSettingsDelayTimer,time(NULL)); + //printf("In [%s:%s] Line: %d forceNow = %d broadcastServerSettingsDelayTimer = %zu, now =%zu\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,forceNow,broadcastServerSettingsDelayTimer,time(NULL)); needToBroadcastServerSettings = false; broadcastServerSettingsDelayTimer = time(NULL); @@ -1845,7 +1845,7 @@ void MenuStateConnectedGame::loadGameSettings(GameSettings *gameSettings) { gameSettings->setScenarioDir(""); } - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] listBoxMap.getSelectedItemIndex() = %d, mapFiles.size() = %lu, getCurrentMapFile() [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,listBoxMap.getSelectedItemIndex(),mapFiles.size(),getCurrentMapFile().c_str()); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] listBoxMap.getSelectedItemIndex() = %d, mapFiles.size() = %zu, getCurrentMapFile() [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,listBoxMap.getSelectedItemIndex(),mapFiles.size(),getCurrentMapFile().c_str()); if(listBoxMap.getSelectedItemIndex() >= 0 && listBoxMap.getSelectedItemIndex() < mapFiles.size()) { gameSettings->setDescription(formatString(getCurrentMapFile())); @@ -4143,7 +4143,7 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings, mapFile = ITEM_MISSING; } - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] listBoxMap.getSelectedItemIndex() = %d, mapFiles.size() = %lu, maps.size() = %lu, getCurrentMapFile() [%s] mapFile [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,listBoxMap.getSelectedItemIndex(),mapFiles.size(),maps.size(),getCurrentMapFile().c_str(),mapFile.c_str()); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] listBoxMap.getSelectedItemIndex() = %d, mapFiles.size() = %zu, maps.size() = %zu, getCurrentMapFile() [%s] mapFile [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,listBoxMap.getSelectedItemIndex(),mapFiles.size(),maps.size(),getCurrentMapFile().c_str(),mapFile.c_str()); listBoxMap.setItems(maps); @@ -4509,7 +4509,7 @@ int MenuStateConnectedGame::setupMapList(string scenario) { loadMapInfo(Map::getMapPath(scenarioInfo.mapName, scenarioDir, true), &mapInfo, false); //printf("#6.2\n"); - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] listBoxMap.getSelectedItemIndex() = %d, mapFiles.size() = %lu, mapInfo.players = %d, formattedPlayerSortedMaps[mapInfo.players].size() = %lu, scenarioInfo.mapName [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,listBoxMap.getSelectedItemIndex(),mapFiles.size(),mapInfo.players,formattedPlayerSortedMaps[mapInfo.players].size(),scenarioInfo.mapName.c_str()); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] listBoxMap.getSelectedItemIndex() = %d, mapFiles.size() = %zu, mapInfo.players = %d, formattedPlayerSortedMaps[mapInfo.players].size() = %zu, scenarioInfo.mapName [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,listBoxMap.getSelectedItemIndex(),mapFiles.size(),mapInfo.players,formattedPlayerSortedMaps[mapInfo.players].size(),scenarioInfo.mapName.c_str()); listBoxMap.setItems(formattedPlayerSortedMaps[mapInfo.players]); } //printf("#7\n"); diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index 8eb6e33d..31bc9598 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -3390,7 +3390,7 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force gameSettings->setMasterserver_admin(serverInterface->getSlot(i)->getSessionKey()); gameSettings->setMasterserver_admin_faction_index(serverInterface->getSlot(i)->getPlayerIndex()); labelGameName.setText(serverInterface->getSlot(i)->getName()+" controls"); - //printf("slot = %d, admin key [%d] slot connected time[%lu] clientConnectedTime [%lu]\n",i,gameSettings->getMasterserver_admin(),serverInterface->getSlot(i)->getConnectedTime(),clientConnectedTime); + //printf("slot = %d, admin key [%d] slot connected time[%zu] clientConnectedTime [%zu]\n",i,gameSettings->getMasterserver_admin(),serverInterface->getSlot(i)->getConnectedTime(),clientConnectedTime); } if(serverInterface->getSlot(i)->getSessionKey() == gameSettings->getMasterserver_admin()){ masterserver_admin_found=true; @@ -3414,7 +3414,7 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force gameSettings->setMasterserver_admin(serverInterface->getSlot(i)->getSessionKey()); gameSettings->setMasterserver_admin_faction_index(serverInterface->getSlot(i)->getPlayerIndex()); labelGameName.setText(serverInterface->getSlot(i)->getName()+" controls"); - //printf("slot = %d, admin key [%d] slot connected time[%lu] clientConnectedTime [%lu]\n",i,gameSettings->getMasterserver_admin(),serverInterface->getSlot(i)->getConnectedTime(),clientConnectedTime); + //printf("slot = %d, admin key [%d] slot connected time[%zu] clientConnectedTime [%zu]\n",i,gameSettings->getMasterserver_admin(),serverInterface->getSlot(i)->getConnectedTime(),clientConnectedTime); } if(serverInterface->getSlot(i)->getSessionKey() == gameSettings->getMasterserver_admin()){ masterserver_admin_found=true; diff --git a/source/glest_game/menu/menu_state_keysetup.cpp b/source/glest_game/menu/menu_state_keysetup.cpp index 459b43a1..f08b4b15 100644 --- a/source/glest_game/menu/menu_state_keysetup.cpp +++ b/source/glest_game/menu/menu_state_keysetup.cpp @@ -274,8 +274,8 @@ void MenuStateKeysetup::mouseClick(int x, int y, MouseButton mouseButton){ if(userProperties.empty() == false) { Config &configKeys = Config::getInstance(std::pair(cfgMainKeys,cfgUserKeys)); string userKeysFile = configKeys.getFileName(true); - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] save file [%s] userProperties.size() = %lu\n",__FILE__,__FUNCTION__,__LINE__,userKeysFile.c_str(),userProperties.size()); - if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] save file [%s] userProperties.size() = %lu\n",__FILE__,__FUNCTION__,__LINE__,userKeysFile.c_str(),userProperties.size()); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] save file [%s] userProperties.size() = %zu\n",__FILE__,__FUNCTION__,__LINE__,userKeysFile.c_str(),userProperties.size()); + if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] save file [%s] userProperties.size() = %zu\n",__FILE__,__FUNCTION__,__LINE__,userKeysFile.c_str(),userProperties.size()); configKeys.setUserProperties(userProperties); configKeys.save(); diff --git a/source/glest_game/menu/menu_state_masterserver.cpp b/source/glest_game/menu/menu_state_masterserver.cpp index 34b648b8..21271b27 100644 --- a/source/glest_game/menu/menu_state_masterserver.cpp +++ b/source/glest_game/menu/menu_state_masterserver.cpp @@ -966,7 +966,7 @@ void MenuStateMasterserver::rebuildServerLines(const string &serverInfo) { Tokenize(server,serverEntities,"|"); const int MIN_FIELDS_EXPECTED = 14; - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("--------------> server [%s] serverEntities.size() = %lu MIN_FIELDS_EXPECTED = %d\n",server.c_str(),serverEntities.size(),MIN_FIELDS_EXPECTED); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("--------------> server [%s] serverEntities.size() = %zu MIN_FIELDS_EXPECTED = %d\n",server.c_str(),serverEntities.size(),MIN_FIELDS_EXPECTED); if(serverEntities.size() >= MIN_FIELDS_EXPECTED) { labelTitle.setText(lang.get("AvailableServers")); diff --git a/source/glest_game/menu/menu_state_options.cpp b/source/glest_game/menu/menu_state_options.cpp index 5f694162..ebb43f25 100644 --- a/source/glest_game/menu/menu_state_options.cpp +++ b/source/glest_game/menu/menu_state_options.cpp @@ -1165,7 +1165,7 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){ vector languageFileMappings; Tokenize(txnURLFileListMapping,languageFileMappings,"|"); - printf("URL5 file count = %lu, %lu [%s]\n",languageFiles.size(),languageFileMappings.size(),(languageFiles.empty() == false ? languageFiles[0].c_str() : "")); + printf("URL5 file count = %zu, %zu [%s]\n",languageFiles.size(),languageFileMappings.size(),(languageFiles.empty() == false ? languageFiles[0].c_str() : "")); if(languageFiles.empty() == false) { diff --git a/source/glest_game/types/faction_type.cpp b/source/glest_game/types/faction_type.cpp index 6e4e91d8..69bab31e 100644 --- a/source/glest_game/types/faction_type.cpp +++ b/source/glest_game/types/faction_type.cpp @@ -592,7 +592,7 @@ std::vector FactionType::validateFactionType() { } if(foundUnit == false) { - //printf("Problem for unit [%s] unitTypes.size() = %lu\n",unitType.getName().c_str(),unitTypes.size()); + //printf("Problem for unit [%s] unitTypes.size() = %zu\n",unitType.getName().c_str(),unitTypes.size()); char szBuf[8096]=""; snprintf(szBuf,8096,"The Unit [%s] in Faction [%s] has no other units that can produce, build or morph into it in this faction!",unitType.getName().c_str(),this->getName().c_str()); @@ -778,7 +778,7 @@ const UnitType *FactionType::getUnitType(const string &name) const{ } } - printf("In [%s::%s Line: %d] scanning [%s] size = %lu\n",__FILE__,__FUNCTION__,__LINE__,name.c_str(),unitTypes.size()); + printf("In [%s::%s Line: %d] scanning [%s] size = %zu\n",__FILE__,__FUNCTION__,__LINE__,name.c_str(),unitTypes.size()); for(int i=0; i= commandTypes.size()) { char szBuf[8096]=""; - snprintf(szBuf,8096,"In [%s::%s Line: %d] i >= commandTypes.size(), i = %d, commandTypes.size() = %lu",__FILE__,__FUNCTION__,__LINE__,i,(unsigned long)commandTypes.size()); + snprintf(szBuf,8096,"In [%s::%s Line: %d] i >= commandTypes.size(), i = %d, commandTypes.size() = %zu",__FILE__,__FUNCTION__,__LINE__,i,(unsigned long)commandTypes.size()); throw megaglest_runtime_error(szBuf); } return commandTypes[i]; diff --git a/source/glest_game/world/map.cpp b/source/glest_game/world/map.cpp index a0d7c39e..b2bfcfa8 100644 --- a/source/glest_game/world/map.cpp +++ b/source/glest_game/world/map.cpp @@ -405,14 +405,14 @@ Checksum Map::load(const string &path, TechTree *techTree, Tileset *tileset) { readBytes = fread(&x, sizeof(int32), 1, f); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } readBytes = fread(&y, sizeof(int32), 1, f); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -430,7 +430,7 @@ Checksum Map::load(const string &path, TechTree *techTree, Tileset *tileset) { readBytes = fread(&alt, sizeof(float32), 1, f); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -446,7 +446,7 @@ Checksum Map::load(const string &path, TechTree *techTree, Tileset *tileset) { readBytes = fread(&surf, sizeof(int8), 1, f); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -462,7 +462,7 @@ Checksum Map::load(const string &path, TechTree *techTree, Tileset *tileset) { readBytes = fread(&objNumber, sizeof(int8), 1, f); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } diff --git a/source/glest_game/world/world.cpp b/source/glest_game/world/world.cpp index d652884d..cc55d317 100644 --- a/source/glest_game/world/world.cpp +++ b/source/glest_game/world/world.cpp @@ -2313,7 +2313,7 @@ string World::getAllFactionsCacheStats() { } char szBuf[8096]=""; - snprintf(szBuf,8096,"totalCache1Size [%lu] totalCache1Size [%lu] total KB: %s",totalCache1Size,totalCache2Size,formatNumber(totalBytes).c_str()); + snprintf(szBuf,8096,"totalCache1Size [%zu] totalCache1Size [%zu] total KB: %s",totalCache1Size,totalCache2Size,formatNumber(totalBytes).c_str()); result = szBuf; return result; } diff --git a/source/shared_lib/include/util/leak_dumper.h b/source/shared_lib/include/util/leak_dumper.h index 979ce75b..af636ea5 100644 --- a/source/shared_lib/include/util/leak_dumper.h +++ b/source/shared_lib/include/util/leak_dumper.h @@ -324,7 +324,7 @@ public: //if(info.line == 0) return; MutexSafeWrapper safeMutexMasterList(mutex); - //printf("ALLOCATE.\tfile: %s, line: %d, bytes: %lu, array: %d inuse: %d\n", info.file, info.line, info.bytes, info.array, info.inuse); + //printf("ALLOCATE.\tfile: %s, line: %d, bytes: %zu, array: %d inuse: %d\n", info.file, info.line, info.bytes, info.array, info.inuse); if(info.line > 0) { ++allocCount; @@ -339,7 +339,7 @@ public: } } - printf("ALLOCATE NOT MONITORED.\tfile: %s, line: %d, ptr [%p], bytes: %lu, array: %d inuse: %d, \n%s\n", info.file, info.line, info.ptr, info.bytes, info.array, info.inuse, info.stack.c_str()); + printf("ALLOCATE NOT MONITORED.\tfile: %s, line: %d, ptr [%p], bytes: %zu, array: %d inuse: %d, \n%s\n", info.file, info.line, info.ptr, info.bytes, info.array, info.inuse, info.stack.c_str()); ++nonMonitoredCount; nonMonitoredBytes+= info.bytes; diff --git a/source/shared_lib/sources/graphics/model.cpp b/source/shared_lib/sources/graphics/model.cpp index bc9ed496..b1e25922 100644 --- a/source/shared_lib/sources/graphics/model.cpp +++ b/source/shared_lib/sources/graphics/model.cpp @@ -253,7 +253,7 @@ void Mesh::loadV2(int meshIndex, const string &dir, FILE *f, TextureManager *tex size_t readBytes = fread(&meshHeader, sizeof(MeshHeaderV2), 1, f); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -331,14 +331,14 @@ void Mesh::loadV2(int meshIndex, const string &dir, FILE *f, TextureManager *tex readBytes = fread(vertices, sizeof(Vec3f)*frameCount*vertexCount, 1, f); if(readBytes != 1 && (frameCount * vertexCount) != 0) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu [%u][%u] on line: %d.",readBytes,frameCount,vertexCount,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu [%u][%u] on line: %d.",readBytes,frameCount,vertexCount,__LINE__); throw megaglest_runtime_error(szBuf); } readBytes = fread(normals, sizeof(Vec3f)*frameCount*vertexCount, 1, f); if(readBytes != 1 && (frameCount * vertexCount) != 0) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu [%u][%u] on line: %d.",readBytes,frameCount,vertexCount,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu [%u][%u] on line: %d.",readBytes,frameCount,vertexCount,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -346,21 +346,21 @@ void Mesh::loadV2(int meshIndex, const string &dir, FILE *f, TextureManager *tex readBytes = fread(texCoords, sizeof(Vec2f)*vertexCount, 1, f); if(readBytes != 1 && vertexCount != 0) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu [%u][%u] on line: %d.",readBytes,frameCount,vertexCount,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu [%u][%u] on line: %d.",readBytes,frameCount,vertexCount,__LINE__); throw megaglest_runtime_error(szBuf); } } readBytes = fread(&diffuseColor, sizeof(Vec3f), 1, f); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } readBytes = fread(&opacity, sizeof(float32), 1, f); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -368,7 +368,7 @@ void Mesh::loadV2(int meshIndex, const string &dir, FILE *f, TextureManager *tex readBytes = fread(indices, sizeof(uint32)*indexCount, 1, f); if(readBytes != 1 && indexCount != 0) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu [%u] on line: %d.",readBytes,indexCount,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu [%u] on line: %d.",readBytes,indexCount,__LINE__); throw megaglest_runtime_error(szBuf); } } @@ -384,7 +384,7 @@ void Mesh::loadV3(int meshIndex, const string &dir, FILE *f, size_t readBytes = fread(&meshHeader, sizeof(MeshHeaderV3), 1, f); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -459,14 +459,14 @@ void Mesh::loadV3(int meshIndex, const string &dir, FILE *f, readBytes = fread(vertices, sizeof(Vec3f)*frameCount*vertexCount, 1, f); if(readBytes != 1 && (frameCount * vertexCount) != 0) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu [%u][%u] on line: %d.",readBytes,frameCount,vertexCount,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu [%u][%u] on line: %d.",readBytes,frameCount,vertexCount,__LINE__); throw megaglest_runtime_error(szBuf); } readBytes = fread(normals, sizeof(Vec3f)*frameCount*vertexCount, 1, f); if(readBytes != 1 && (frameCount * vertexCount) != 0) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu [%u][%u] on line: %d.",readBytes,frameCount,vertexCount,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu [%u][%u] on line: %d.",readBytes,frameCount,vertexCount,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -475,7 +475,7 @@ void Mesh::loadV3(int meshIndex, const string &dir, FILE *f, readBytes = fread(texCoords, sizeof(Vec2f)*vertexCount, 1, f); if(readBytes != 1 && vertexCount != 0) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu [%u][%u] on line: %d.",readBytes,frameCount,vertexCount,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu [%u][%u] on line: %d.",readBytes,frameCount,vertexCount,__LINE__); throw megaglest_runtime_error(szBuf); } } @@ -483,14 +483,14 @@ void Mesh::loadV3(int meshIndex, const string &dir, FILE *f, readBytes = fread(&diffuseColor, sizeof(Vec3f), 1, f); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } readBytes = fread(&opacity, sizeof(float32), 1, f); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -498,7 +498,7 @@ void Mesh::loadV3(int meshIndex, const string &dir, FILE *f, readBytes = fread(indices, sizeof(uint32)*indexCount, 1, f); if(readBytes != 1 && indexCount != 0) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu [%u] on line: %d.",readBytes,indexCount,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu [%u] on line: %d.",readBytes,indexCount,__LINE__); throw megaglest_runtime_error(szBuf); } } @@ -565,7 +565,7 @@ void Mesh::load(int meshIndex, const string &dir, FILE *f, TextureManager *textu size_t readBytes = fread(&meshHeader, sizeof(MeshHeader), 1, f); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -603,7 +603,7 @@ void Mesh::load(int meshIndex, const string &dir, FILE *f, TextureManager *textu readBytes = fread(cMapPath, mapPathSize, 1, f); if(readBytes != 1 && mapPathSize != 0) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu [%u] on line: %d.",readBytes,mapPathSize,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu [%u] on line: %d.",readBytes,mapPathSize,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -628,14 +628,14 @@ void Mesh::load(int meshIndex, const string &dir, FILE *f, TextureManager *textu readBytes = fread(vertices, sizeof(Vec3f)*frameCount*vertexCount, 1, f); if(readBytes != 1 && (frameCount * vertexCount) != 0) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu [%u][%u] on line: %d.",readBytes,frameCount,vertexCount,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu [%u][%u] on line: %d.",readBytes,frameCount,vertexCount,__LINE__); throw megaglest_runtime_error(szBuf); } readBytes = fread(normals, sizeof(Vec3f)*frameCount*vertexCount, 1, f); if(readBytes != 1 && (frameCount * vertexCount) != 0) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu [%u][%u] on line: %d.",readBytes,frameCount,vertexCount,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu [%u][%u] on line: %d.",readBytes,frameCount,vertexCount,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -643,7 +643,7 @@ void Mesh::load(int meshIndex, const string &dir, FILE *f, TextureManager *textu readBytes = fread(texCoords, sizeof(Vec2f)*vertexCount, 1, f); if(readBytes != 1 && vertexCount != 0) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu [%u][%u] on line: %d.",readBytes,frameCount,vertexCount,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu [%u][%u] on line: %d.",readBytes,frameCount,vertexCount,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -651,7 +651,7 @@ void Mesh::load(int meshIndex, const string &dir, FILE *f, TextureManager *textu readBytes = fread(indices, sizeof(uint32)*indexCount, 1, f); if(readBytes != 1 && indexCount != 0) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu [%u] on line: %d.",readBytes,indexCount,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu [%u] on line: %d.",readBytes,indexCount,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -994,7 +994,7 @@ void Model::loadG3d(const string &path, bool deletePixMapAfterLoad, if(readBytes != 1) { fclose(f); char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -1015,7 +1015,7 @@ void Model::loadG3d(const string &path, bool deletePixMapAfterLoad, readBytes = fread(&modelHeader, sizeof(ModelHeader), 1, f); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -1048,7 +1048,7 @@ void Model::loadG3d(const string &path, bool deletePixMapAfterLoad, readBytes = fread(&meshCount, sizeof(meshCount), 1, f); if(readBytes != 1 && meshCount != 0) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu [%u] on line: %d.",readBytes,meshCount,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu [%u] on line: %d.",readBytes,meshCount,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -1075,7 +1075,7 @@ void Model::loadG3d(const string &path, bool deletePixMapAfterLoad, readBytes = fread(&meshCount, sizeof(meshCount), 1, f); if(readBytes != 1 && meshCount != 0) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu [%u] on line: %d.",readBytes,meshCount,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu [%u] on line: %d.",readBytes,meshCount,__LINE__); throw megaglest_runtime_error(szBuf); } diff --git a/source/shared_lib/sources/graphics/pixmap.cpp b/source/shared_lib/sources/graphics/pixmap.cpp index 9b30be05..e74ff9de 100644 --- a/source/shared_lib/sources/graphics/pixmap.cpp +++ b/source/shared_lib/sources/graphics/pixmap.cpp @@ -122,7 +122,7 @@ void PixmapIoTga::openRead(const string &path) { size_t readBytes = fread(&fileHeader, sizeof(TargaFileHeader), 1, file); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -157,7 +157,7 @@ void PixmapIoTga::read(uint8 *pixels, int components) { size_t readBytes = fread(&l, 1, 1, file); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -170,21 +170,21 @@ void PixmapIoTga::read(uint8 *pixels, int components) { size_t readBytes = fread(&b, 1, 1, file); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } readBytes = fread(&g, 1, 1, file); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } readBytes = fread(&r, 1, 1, file); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -192,7 +192,7 @@ void PixmapIoTga::read(uint8 *pixels, int components) { readBytes = fread(&a, 1, 1, file); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -293,7 +293,7 @@ void PixmapIoBmp::openRead(const string &path){ size_t readBytes = fread(&fileHeader, sizeof(BitmapFileHeader), 1, file); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -306,7 +306,7 @@ void PixmapIoBmp::openRead(const string &path){ readBytes = fread(&infoHeader, sizeof(BitmapInfoHeader), 1, file); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -329,21 +329,21 @@ void PixmapIoBmp::read(uint8 *pixels, int components) { size_t readBytes = fread(&b, 1, 1, file); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } readBytes = fread(&g, 1, 1, file); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } readBytes = fread(&r, 1, 1, file); if(readBytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",readBytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",readBytes,__LINE__); throw megaglest_runtime_error(szBuf); } diff --git a/source/shared_lib/sources/map/map_preview.cpp b/source/shared_lib/sources/map/map_preview.cpp index 411ae509..f097de1e 100644 --- a/source/shared_lib/sources/map/map_preview.cpp +++ b/source/shared_lib/sources/map/map_preview.cpp @@ -765,7 +765,7 @@ void MapPreview::loadFromFile(const string &path) { size_t bytes = fread(&header, sizeof(MapFileHeader), 1, f1); if(bytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",bytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",bytes,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -789,14 +789,14 @@ void MapPreview::loadFromFile(const string &path) { bytes = fread(&startLocations[i].x, sizeof(int32), 1, f1); if(bytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",bytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",bytes,__LINE__); throw megaglest_runtime_error(szBuf); } bytes = fread(&startLocations[i].y, sizeof(int32), 1, f1); if(bytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",bytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",bytes,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -809,7 +809,7 @@ void MapPreview::loadFromFile(const string &path) { bytes = fread(&cells[i][j].height, sizeof(float), 1, f1); if(bytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",bytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",bytes,__LINE__); throw megaglest_runtime_error(szBuf); } } @@ -821,7 +821,7 @@ void MapPreview::loadFromFile(const string &path) { bytes = fread(&cells[i][j].surface, sizeof(int8), 1, f1); if(bytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",bytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",bytes,__LINE__); throw megaglest_runtime_error(szBuf); } } @@ -834,7 +834,7 @@ void MapPreview::loadFromFile(const string &path) { bytes = fread(&obj, sizeof(int8), 1, f1); if(bytes != 1) { char szBuf[8096]=""; - snprintf(szBuf,8096,"fread returned wrong size = %lu on line: %d.",bytes,__LINE__); + snprintf(szBuf,8096,"fread returned wrong size = %zu on line: %d.",bytes,__LINE__); throw megaglest_runtime_error(szBuf); } @@ -1021,7 +1021,7 @@ bool MapPreview::loadMapInfo(string file, MapInfo *mapInfo, string i18nMaxMapPla if(errorOnInvalidMap == true) { char szBuf[8096]=""; - snprintf(szBuf,8096,"In [%s::%s Line: %d]\nfile [%s]\nreadBytes != sizeof(MapFileHeader) [%lu] [%lu]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,file.c_str(),readBytes,sizeof(MapFileHeader)); + snprintf(szBuf,8096,"In [%s::%s Line: %d]\nfile [%s]\nreadBytes != sizeof(MapFileHeader) [%zu] [%zu]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,file.c_str(),readBytes,sizeof(MapFileHeader)); SystemFlags::OutputDebug(SystemFlags::debugError,"%s",szBuf); throw megaglest_runtime_error(szBuf); diff --git a/source/shared_lib/sources/platform/posix/ircclient.cpp b/source/shared_lib/sources/platform/posix/ircclient.cpp index d6ac342d..ca52bc8e 100644 --- a/source/shared_lib/sources/platform/posix/ircclient.cpp +++ b/source/shared_lib/sources/platform/posix/ircclient.cpp @@ -315,7 +315,7 @@ void irc_event_dcc_chat(irc_session_t * session, const char * nick, const char * void irc_event_dcc_send(irc_session_t * session, const char * nick, const char * addr, const char * filename, unsigned long size, irc_dcc_t dccid) { FILE * fp; - if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("DCC send [%d] requested from '%s' (%s): %s (%lu bytes)\n", dccid, nick, addr, filename, size); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("DCC send [%d] requested from '%s' (%s): %s (%zu bytes)\n", dccid, nick, addr, filename, size); if ( (fp = fopen ("file", "wb")) == 0 ) { abort(); diff --git a/source/shared_lib/sources/platform/posix/miniftpclient.cpp b/source/shared_lib/sources/platform/posix/miniftpclient.cpp index a0e243f1..fba0b73b 100644 --- a/source/shared_lib/sources/platform/posix/miniftpclient.cpp +++ b/source/shared_lib/sources/platform/posix/miniftpclient.cpp @@ -108,9 +108,9 @@ static size_t my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream) { size_t result = fwrite(buffer, size, nmemb, out->stream); if(result != nmemb) { - if(SystemFlags::VERBOSE_MODE_ENABLED) printf("===> FTP Client thread FAILED to write data chunk to file [%s] nmemb = %lu, result = %lu\n",fullFilePath.c_str(),nmemb,result); - if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"===> FTP Client thread FAILED to write data chunk to file [%s] nmemb = %lu, result = %lu\n",fullFilePath.c_str(),nmemb,result); - SystemFlags::OutputDebug(SystemFlags::debugError,"===> FTP Client thread FAILED to write data chunk to file [%s] nmemb = %lu, result = %lu\n",fullFilePath.c_str(),nmemb,result); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("===> FTP Client thread FAILED to write data chunk to file [%s] nmemb = %zu, result = %zu\n",fullFilePath.c_str(),nmemb,result); + if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"===> FTP Client thread FAILED to write data chunk to file [%s] nmemb = %zu, result = %zu\n",fullFilePath.c_str(),nmemb,result); + SystemFlags::OutputDebug(SystemFlags::debugError,"===> FTP Client thread FAILED to write data chunk to file [%s] nmemb = %zu, result = %zu\n",fullFilePath.c_str(),nmemb,result); //return -1; /* failure, can't open file to write */ } return result; diff --git a/source/shared_lib/sources/platform/posix/socket.cpp b/source/shared_lib/sources/platform/posix/socket.cpp index 7c7af7de..ab9b9536 100644 --- a/source/shared_lib/sources/platform/posix/socket.cpp +++ b/source/shared_lib/sources/platform/posix/socket.cpp @@ -1170,12 +1170,12 @@ int Socket::getDataToRead(bool wantImmediateReply) { break; } else if(hasDataToRead() == true) { - //if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] WARNING PEEKING SOCKET DATA, (hasDataToRead() == true) err = %d, sock = %d, size = %lu, loopCount = %d\n",__FILE__,__FUNCTION__,__LINE__,err,sock,size,loopCount); - if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] WARNING PEEKING SOCKET DATA, (hasDataToRead() == true) err = %d, sock = %d, size = %lu\n",__FILE__,__FUNCTION__,__LINE__,err,sock,size); + //if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] WARNING PEEKING SOCKET DATA, (hasDataToRead() == true) err = %d, sock = %d, size = %zu, loopCount = %d\n",__FILE__,__FUNCTION__,__LINE__,err,sock,size,loopCount); + if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] WARNING PEEKING SOCKET DATA, (hasDataToRead() == true) err = %d, sock = %d, size = %zu\n",__FILE__,__FUNCTION__,__LINE__,err,sock,size); } else { - //if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] WARNING PEEKING SOCKET DATA, err = %d, sock = %d, size = %lu, loopCount = %d\n",__FILE__,__FUNCTION__,__LINE__,err,sock,size,loopCount); - if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] WARNING PEEKING SOCKET DATA, err = %d, sock = %d, size = %lu\n",__FILE__,__FUNCTION__,__LINE__,err,sock,size); + //if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] WARNING PEEKING SOCKET DATA, err = %d, sock = %d, size = %zu, loopCount = %d\n",__FILE__,__FUNCTION__,__LINE__,err,sock,size,loopCount); + if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] WARNING PEEKING SOCKET DATA, err = %d, sock = %d, size = %zu\n",__FILE__,__FUNCTION__,__LINE__,err,sock,size); break; } diff --git a/source/shared_lib/sources/sound/openal/sound_player_openal.cpp b/source/shared_lib/sources/sound/openal/sound_player_openal.cpp index 17c6a2d8..1a30befb 100644 --- a/source/shared_lib/sources/sound/openal/sound_player_openal.cpp +++ b/source/shared_lib/sources/sound/openal/sound_player_openal.cpp @@ -575,7 +575,7 @@ StaticSoundSource* SoundPlayerOpenAL::findStaticSoundSource() { } } - if(SystemFlags::getSystemSettingType(SystemFlags::debugSound).enabled) SystemFlags::OutputDebug(SystemFlags::debugSound,"In [%s::%s %d] playingCount = %d, staticSources.size() = %lu, params.staticBufferCount = %u\n",__FILE__,__FUNCTION__,__LINE__,playingCount,(unsigned long)staticSources.size(),params.staticBufferCount); + if(SystemFlags::getSystemSettingType(SystemFlags::debugSound).enabled) SystemFlags::OutputDebug(SystemFlags::debugSound,"In [%s::%s %d] playingCount = %d, staticSources.size() = %zu, params.staticBufferCount = %u\n",__FILE__,__FUNCTION__,__LINE__,playingCount,(unsigned long)staticSources.size(),params.staticBufferCount); // create a new source if(staticSources.size() >= params.staticBufferCount) { diff --git a/source/shared_lib/sources/sound/sound_file_loader.cpp b/source/shared_lib/sources/sound/sound_file_loader.cpp index a7faf52e..027ec0d6 100644 --- a/source/shared_lib/sources/sound/sound_file_loader.cpp +++ b/source/shared_lib/sources/sound/sound_file_loader.cpp @@ -168,7 +168,7 @@ void OggSoundFileLoader::open(const string &path, SoundInfo *soundInfo){ uint32 samples = static_cast(ov_pcm_total(vf, -1)); - if(SystemFlags::getSystemSettingType(SystemFlags::debugSound).enabled) SystemFlags::OutputDebug(SystemFlags::debugSound,"In [%s::%s Line: %d] path = [%s] vi->version = %d, vi->channels = %d, vi->rate = %ld, vi->bitrate_upper = %ld, vi->bitrate_nominal = %ld, vi->bitrate_lower = %ld, vi->bitrate_window = %ld, samples = %lu\n",__FILE__,__FUNCTION__,__LINE__,path.c_str(),vi->version,vi->channels,vi->rate,vi->bitrate_upper,vi->bitrate_nominal,vi->bitrate_lower,vi->bitrate_window,samples); + if(SystemFlags::getSystemSettingType(SystemFlags::debugSound).enabled) SystemFlags::OutputDebug(SystemFlags::debugSound,"In [%s::%s Line: %d] path = [%s] vi->version = %d, vi->channels = %d, vi->rate = %ld, vi->bitrate_upper = %ld, vi->bitrate_nominal = %ld, vi->bitrate_lower = %ld, vi->bitrate_window = %ld, samples = %zu\n",__FILE__,__FUNCTION__,__LINE__,path.c_str(),vi->version,vi->channels,vi->rate,vi->bitrate_upper,vi->bitrate_nominal,vi->bitrate_lower,vi->bitrate_window,samples); soundInfo->setChannels(vi->channels); soundInfo->setsamplesPerSecond(vi->rate); diff --git a/source/shared_lib/sources/util/leak_dumper.cpp b/source/shared_lib/sources/util/leak_dumper.cpp index c6801972..73dc513b 100644 --- a/source/shared_lib/sources/util/leak_dumper.cpp +++ b/source/shared_lib/sources/util/leak_dumper.cpp @@ -54,21 +54,21 @@ void AllocRegistry::dump(const char *path) { leakBytes += info.bytes; //allocs[i].stack = AllocInfo::getStackTrace(); - fprintf(f, "Leak #%d.\tfile: %s, line: %d, ptr [%p], bytes: %lu, array: %d, inuse: %d\n%s\n", ++leakCount, info.file, info.line, info.ptr, info.bytes, info.array,info.inuse,info.stack.c_str()); + fprintf(f, "Leak #%d.\tfile: %s, line: %d, ptr [%p], bytes: %zu, array: %d, inuse: %d\n%s\n", ++leakCount, info.file, info.line, info.ptr, info.bytes, info.array,info.inuse,info.stack.c_str()); } } } - fprintf(f, "\nTotal leaks: %d, %lu bytes\n", leakCount, leakBytes); - fprintf(f, "Total allocations: %d, %lu bytes\n", allocCount, allocBytes); - fprintf(f, "Not monitored allocations: %d, %lu bytes\n", nonMonitoredCount, nonMonitoredBytes); + fprintf(f, "\nTotal leaks: %d, %zu bytes\n", leakCount, leakBytes); + fprintf(f, "Total allocations: %d, %zu bytes\n", allocCount, allocBytes); + fprintf(f, "Not monitored allocations: %d, %zu bytes\n", nonMonitoredCount, nonMonitoredBytes); fclose(f); printf("Memory leak dump summary at: %s\n",szBuf2); - printf("Total leaks: %d, %lu bytes\n", leakCount, leakBytes); - printf("Total allocations: %d, %lu bytes\n", allocCount, allocBytes); - printf("Not monitored allocations: %d, %lu bytes\n", nonMonitoredCount, nonMonitoredBytes); + printf("Total leaks: %d, %zu bytes\n", leakCount, leakBytes); + printf("Total allocations: %d, %zu bytes\n", allocCount, allocBytes); + printf("Not monitored allocations: %d, %zu bytes\n", nonMonitoredCount, nonMonitoredBytes); } #endif