- proper way to handle size_t objects (cleanup warning on other platforms)

This commit is contained in:
Mark Vejvoda 2012-10-26 02:42:10 +00:00
parent 90263ffae8
commit 3419127632
27 changed files with 146 additions and 146 deletions

View File

@ -314,7 +314,7 @@ MainWindow::MainWindow( std::pair<string,vector<string> > unitToLoad,
if(modelPath != "") { if(modelPath != "") {
this->modelPathList.push_back(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 != "") { if(particlePath != "") {
this->particlePathList.push_back(particlePath); this->particlePathList.push_back(particlePath);
@ -1232,14 +1232,14 @@ void MainWindow::loadModel(string path) {
try { try {
if(path != "" && fileExists(path) == true) { if(path != "" && fileExists(path) == true) {
this->modelPathList.push_back(path); 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; string titlestring=winHeader;
for(unsigned int idx =0; idx < this->modelPathList.size(); idx++) { for(unsigned int idx =0; idx < this->modelPathList.size(); idx++) {
string modelPath = this->modelPathList[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(); if(timer) timer->Stop();
delete model; delete model;
@ -1369,7 +1369,7 @@ void MainWindow::loadParticle(string path) {
} }
void MainWindow::loadProjectileParticle(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(timer) timer->Stop();
if(path != "" && fileExists(path) == true) { if(path != "" && fileExists(path) == true) {
@ -1390,7 +1390,7 @@ void MainWindow::loadProjectileParticle(string path) {
try { try {
if(this->particleProjectilePathList.empty() == false) { 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; string titlestring=winHeader;
for(unsigned int idx = 0; idx < this->particleProjectilePathList.size(); idx++) { 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...) 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(timer) timer->Stop();
if(path != "" && fileExists(path) == true) { 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(); 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(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){ void MainWindow::onMenuModeNormals(wxCommandEvent &event){

View File

@ -921,8 +921,8 @@ void AiRuleProduce::produceSpecific(const ProduceTask *pt){
int currentProducerIndex = producers[i]; int currentProducerIndex = producers[i];
if(currentProducerIndex >= aiInterface->getMyUnitCount()) { if(currentProducerIndex >= aiInterface->getMyUnitCount()) {
char szBuf[8096]=""; 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()); 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() = %lu",__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); throw megaglest_runtime_error(szBuf);
} }
@ -953,14 +953,14 @@ void AiRuleProduce::produceSpecific(const ProduceTask *pt){
if(currentProducerIndex >= aiInterface->getMyUnitCount()) { if(currentProducerIndex >= aiInterface->getMyUnitCount()) {
char szBuf[8096]=""; 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()); 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() = %lu",__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); throw megaglest_runtime_error(szBuf);
} }
if(prIndex >= producers.size()) { if(prIndex >= producers.size()) {
char szBuf[8096]=""; 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()); 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() = %lu",__FILE__,__FUNCTION__,__LINE__,currentProducerIndex,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); throw megaglest_runtime_error(szBuf);
} }
@ -1019,14 +1019,14 @@ void AiRuleProduce::produceSpecific(const ProduceTask *pt){
if(currentProducerIndex >= aiInterface->getMyUnitCount()) { if(currentProducerIndex >= aiInterface->getMyUnitCount()) {
char szBuf[8096]=""; 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()); 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() = %lu",__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); throw megaglest_runtime_error(szBuf);
} }
if(prIndex >= backupProducers.size()) { if(prIndex >= backupProducers.size()) {
char szBuf[8096]=""; 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()); 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() = %lu",__FILE__,__FUNCTION__,__LINE__,currentProducerIndex,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); throw megaglest_runtime_error(szBuf);
} }

View File

@ -132,7 +132,7 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu
// if(frameIndex != factions[unit->getFactionIndex()].lastFromToNodeListFrame) { // if(frameIndex != factions[unit->getFactionIndex()].lastFromToNodeListFrame) {
// if(factions[unit->getFactionIndex()].mapFromToNodeList.size() > 0) { // 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()].mapFromToNodeList.clear();
// } // }
// factions[unit->getFactionIndex()].lastFromToNodeListFrame = frameIndex; // 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) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
char szBuf[8096]=""; 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); factions[unitFactionIndex].openNodesList.size(),factions[unitFactionIndex].openPosList.size(),finalPos.getString().c_str(),targetPos.getString().c_str(),inBailout,ts);
unit->logSynchData(__FILE__,__LINE__,szBuf); 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) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
char szBuf[8096]=""; 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); factions[unitFactionIndex].openNodesList.size(),factions[unitFactionIndex].openPosList.size(),finalPos.getString().c_str(),targetPos.getString().c_str(),inBailout,ts);
unit->logSynchData(__FILE__,__LINE__,szBuf); 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) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
char szBuf[8096]=""; 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); factions[unitFactionIndex].openNodesList.size(),factions[unitFactionIndex].openPosList.size(),finalPos.getString().c_str(),targetPos.getString().c_str(),inBailout,ts);
unit->logSynchData(__FILE__,__LINE__,szBuf); 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) { if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
char szBuf[8096]=""; 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); factions[unitFactionIndex].openNodesList.size(),factions[unitFactionIndex].openPosList.size(),finalPos.getString().c_str(),targetPos.getString().c_str(),inBailout,ts);
unit->logSynchData(__FILE__,__LINE__,szBuf); unit->logSynchData(__FILE__,__LINE__,szBuf);

View File

@ -556,7 +556,7 @@ bool Commander::getReplayCommandListForFrame(int worldFrameCount) {
bool haveReplyCommands = false; bool haveReplyCommands = false;
if(replayCommandList.empty() == false) { if(replayCommandList.empty() == false) {
//int worldFrameCount = world->getFrameCount(); //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<NetworkCommand> replayList; std::vector<NetworkCommand> replayList;
for(unsigned int i = 0; i < replayCommandList.size(); ++i) { for(unsigned int i = 0; i < replayCommandList.size(); ++i) {
@ -569,7 +569,7 @@ bool Commander::getReplayCommandListForFrame(int worldFrameCount) {
if(haveReplyCommands == true) { if(haveReplyCommands == true) {
replayCommandList.erase(replayCommandList.begin(),replayCommandList.begin() + replayList.size()); 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){ for(int i= 0; i < replayList.size(); ++i){
giveNetworkCommand(&replayList[i]); giveNetworkCommand(&replayList[i]);
//pushNetworkCommand(&replayList[i]); //pushNetworkCommand(&replayList[i]);

View File

@ -1648,7 +1648,7 @@ void Game::update() {
try { try {
gameStarted = false; 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__); //printf("[%s:%s] Line: %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
ScenarioInfo scenarioInfo; ScenarioInfo scenarioInfo;
Scenario::loadScenarioInfo(scenarioFile, &scenarioInfo); Scenario::loadScenarioInfo(scenarioFile, &scenarioInfo);
@ -2443,7 +2443,7 @@ void Game::removeCellMarker(Vec2i surfaceCellPos, const Faction *faction) {
gameNetworkInterface->sendUnMarkCellMessage(mc.getTargetPos(),factionIndex); 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; //isUnMarkCellEnabled = false;
@ -2818,7 +2818,7 @@ void Game::mouseDownLeft(int x, int y) {
//GameNetworkInterface *gameNetworkInterface= NetworkManager::getInstance().getGameNetworkInterface(); //GameNetworkInterface *gameNetworkInterface= NetworkManager::getInstance().getGameNetworkInterface();
//gameNetworkInterface->sendMarkCellMessage(mc.getTargetPos(),mc.getFaction()->getIndex(),mc.getNote()); //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; isMarkCellEnabled = false;
cellMarkedData = mc; cellMarkedData = mc;
@ -2848,7 +2848,7 @@ void Game::mouseDownLeft(int x, int y) {
isUnMarkCellEnabled = false; isUnMarkCellEnabled = false;
removeCellMarker(surfaceCellPos, world.getThisFaction()); 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 &renderer= Renderer::getInstance();
//renderer.updateMarkedCellScreenPosQuadCache(surfaceCellPos); //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()); 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; isMarkCellEnabled = false;
cellMarkedData = mc; cellMarkedData = mc;
@ -2925,7 +2925,7 @@ void Game::mouseDownLeft(int x, int y) {
isUnMarkCellEnabled = false; isUnMarkCellEnabled = false;
removeCellMarker(surfaceCellPos, world.getThisFaction()); 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 &renderer= Renderer::getInstance();
//renderer.updateMarkedCellScreenPosQuadCache(surfaceCellPos); //renderer.updateMarkedCellScreenPosQuadCache(surfaceCellPos);
@ -5106,7 +5106,7 @@ void Game::loadGame(string name,Program *programPtr,bool isMasterserverMode) {
newGame->lastworldFrameCountForReplay = gameNode->getAttribute("LastWorldFrameCount")->getIntValue(); newGame->lastworldFrameCountForReplay = gameNode->getAttribute("LastWorldFrameCount")->getIntValue();
vector<XmlNode *> networkCommandNodeList = gameNode->getChildList("NetworkCommand"); vector<XmlNode *> 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) { for(unsigned int i = 0; i < networkCommandNodeList.size(); ++i) {
XmlNode *node = networkCommandNodeList[i]; XmlNode *node = networkCommandNodeList[i];
int worldFrameCount = node->getAttribute("worldFrameCount")->getIntValue(); int worldFrameCount = node->getAttribute("worldFrameCount")->getIntValue();

View File

@ -781,7 +781,7 @@ string Config::findValidLocalFileFromPath(string fileName) {
vector<string> dirList = config.getPathListForType(ptMaps); vector<string> dirList = config.getPathListForType(ptMaps);
replaceFileWithLocalFile(dirList, fileNamePart, result); 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 ) { else if(fileName.find("tilesets/") != fileName.npos ) {
size_t pos = fileName.find("tilesets/"); size_t pos = fileName.find("tilesets/");
@ -790,7 +790,7 @@ string Config::findValidLocalFileFromPath(string fileName) {
vector<string> dirList = config.getPathListForType(ptTilesets); vector<string> dirList = config.getPathListForType(ptTilesets);
replaceFileWithLocalFile(dirList, fileNamePart, result); 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 ) { else if(fileName.find("techs/") != fileName.npos ) {
size_t pos = fileName.find("techs/"); size_t pos = fileName.find("techs/");
@ -799,7 +799,7 @@ string Config::findValidLocalFileFromPath(string fileName) {
vector<string> dirList = config.getPathListForType(ptTechs); vector<string> dirList = config.getPathListForType(ptTechs);
replaceFileWithLocalFile(dirList, fileNamePart, result); 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) { else if(fileName.find("scenarios/") != fileName.npos) {
size_t pos = fileName.find("scenarios/"); size_t pos = fileName.find("scenarios/");
@ -808,7 +808,7 @@ string Config::findValidLocalFileFromPath(string fileName) {
vector<string> dirList = config.getPathListForType(ptScenarios); vector<string> dirList = config.getPathListForType(ptScenarios);
replaceFileWithLocalFile(dirList, fileNamePart, result); 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) { else if(fileName.find("tutorials/") != fileName.npos) {
size_t pos = fileName.find("tutorials/"); size_t pos = fileName.find("tutorials/");
@ -817,7 +817,7 @@ string Config::findValidLocalFileFromPath(string fileName) {
vector<string> dirList = config.getPathListForType(ptTutorials); vector<string> dirList = config.getPathListForType(ptTutorials);
replaceFileWithLocalFile(dirList, fileNamePart, result); 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; return result;

View File

@ -1521,7 +1521,7 @@ void Renderer::computeVisibleQuad() {
visibleQuad.p[3].x,visibleQuad.p[3].y); visibleQuad.p[3].x,visibleQuad.p[3].y);
for(unsigned int i = 0; i < quadCache.frustumData.size(); ++i) { 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<float> &frustumDataInner = quadCache.frustumData[i]; vector<float> &frustumDataInner = quadCache.frustumData[i];
for(unsigned int j = 0; j < frustumDataInner.size(); ++j) { for(unsigned int j = 0; j < frustumDataInner.size(); ++j) {
printf("[%f]",quadCache.frustumData[i][j]); printf("[%f]",quadCache.frustumData[i][j]);
@ -4468,7 +4468,7 @@ void Renderer::renderSurface(const int renderFps) {
std::pair<Chrono, std::vector<SurfaceData> > &surfaceCacheEntity = mapSurfaceData[snapshotOfvisibleQuad.getString()]; std::pair<Chrono, std::vector<SurfaceData> > &surfaceCacheEntity = mapSurfaceData[snapshotOfvisibleQuad.getString()];
surface = &surfaceCacheEntity.second; 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); glEnableClientState(GL_VERTEX_ARRAY);
@ -8796,14 +8796,14 @@ VisibleQuadContainerCache & Renderer::getQuadCache( bool updateOnDirtyFrame,
if(markedCells.empty() == false) { if(markedCells.empty() == false) {
if(markedCells.find(pos) != markedCells.end()) { 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) { //if(markedCells.empty() == false) {
//SurfaceCell *sc = map->getSurfaceCell(pos); //SurfaceCell *sc = map->getSurfaceCell(pos);
//quadCache.visibleScaledCellToScreenPosList[pos]=computeScreenPosition(sc->getVertex()); //quadCache.visibleScaledCellToScreenPosList[pos]=computeScreenPosition(sc->getVertex());
updateMarkedCellScreenPosQuadCache(pos); updateMarkedCellScreenPosQuadCache(pos);
} }
else { 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.empty() == false) {
if(markedCells.find(pos) != markedCells.end()) { 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) { //if(markedCells.empty() == false) {
//quadCache.visibleScaledCellToScreenPosList[pos]=computeScreenPosition(sc->getVertex()); //quadCache.visibleScaledCellToScreenPosList[pos]=computeScreenPosition(sc->getVertex());
updateMarkedCellScreenPosQuadCache(pos); updateMarkedCellScreenPosQuadCache(pos);
} }
else { 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());
} }
} }
} }

View File

@ -173,13 +173,13 @@ static void cleanupProcessObjects() {
SystemFlags::Close(); SystemFlags::Close();
SystemFlags::SHUTDOWN_PROGRAM_MODE=true; 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); time_t elapsed = time(NULL);
for(;Thread::getThreadList().size() > 0 && for(;Thread::getThreadList().size() > 0 &&
difftime((long int)time(NULL),elapsed) <= 10;) { difftime((long int)time(NULL),elapsed) <= 10;) {
//sleep(0); //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<int,Texture2D *> &crcPlayerTextureCache = CacheManager::getCachedItem< std::map<int,Texture2D *> >(GameConstants::playerTextureCacheLookupKey); std::map<int,Texture2D *> &crcPlayerTextureCache = CacheManager::getCachedItem< std::map<int,Texture2D *> >(GameConstants::playerTextureCacheLookupKey);
//deleteMapValues(crcPlayerTextureCache.begin(),crcPlayerTextureCache.end()); //deleteMapValues(crcPlayerTextureCache.begin(),crcPlayerTextureCache.end());
@ -190,10 +190,10 @@ static void cleanupProcessObjects() {
crcFactionPreviewTextureCache.clear(); crcFactionPreviewTextureCache.clear();
std::map<string, vector<FileReader<Pixmap2D> const * >* > &list2d = FileReader<Pixmap2D>::getFileReadersMap(); std::map<string, vector<FileReader<Pixmap2D> const * >* > &list2d = FileReader<Pixmap2D>::getFileReadersMap();
//printf("list2d = %lu\n",list2d.size()); //printf("list2d = %zu\n",list2d.size());
deleteMapValues(list2d.begin(),list2d.end()); deleteMapValues(list2d.begin(),list2d.end());
std::map<string, vector<FileReader<Pixmap3D> const * >* > &list3d = FileReader<Pixmap3D>::getFileReadersMap(); std::map<string, vector<FileReader<Pixmap3D> const * >* > &list3d = FileReader<Pixmap3D>::getFileReadersMap();
//printf("list3d = %lu\n",list3d.size()); //printf("list3d = %zu\n",list3d.size());
deleteMapValues(list3d.begin(),list3d.end()); deleteMapValues(list3d.begin(),list3d.end());
XmlIo::getInstance().cleanup(); 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; int purgeCount = 0;
bool foundUnusedFile = false; 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) { for(unsigned int idx = 0; idx < fileList.size(); ++idx) {
string duplicateFile = fileList[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<string,vector<string> >::iterator iterMap = loadedFileList.begin(); // for( std::map<string,vector<string> >::iterator iterMap = loadedFileList.begin();
// iterMap != loadedFileList.end(); ++iterMap) { // iterMap != loadedFileList.end(); ++iterMap) {
@ -1881,7 +1881,7 @@ void runTechValidationForPath(string techPath, string techName,
printf("\nWarning, duplicate files were detected - START:\n=====================\n"); 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<string,int> parentList; map<string,int> parentList;
for(unsigned int idx = 0; idx < fileList.size(); ++idx) { 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<string,int>::iterator iterMap1 = parentList.begin(); for(map<string,int>::iterator iterMap1 = parentList.begin();
iterMap1 != parentList.end(); ++iterMap1) { iterMap1 != parentList.end(); ++iterMap1) {
@ -1935,7 +1935,7 @@ void runTechValidationForPath(string techPath, string techName,
if(purgeDuplicateFiles == true) { if(purgeDuplicateFiles == true) {
//printf("\nPurge Duplicate Files detected - START:\n=====================\n"); //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 // First move first duplicate to commondata and delete all other copies
string newCommonFileName = ""; string newCommonFileName = "";
for(unsigned int idx = 0; idx < fileList.size(); ++idx) { for(unsigned int idx = 0; idx < fileList.size(); ++idx) {
@ -1944,7 +1944,7 @@ void runTechValidationForPath(string techPath, string techName,
if(fileExt == "wav" || fileExt == "ogg") { if(fileExt == "wav" || fileExt == "ogg") {
off_t fileSize = getFileSize(duplicateFile); 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) { if(idx == 0) {
newCommonFileName = "$COMMONDATAPATH/sounds/" + extractFileFromDirectoryPath(duplicateFile); 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<string,int> mapUniqueParentList; std::map<string,int> mapUniqueParentList;
// Update the XML files to point to the new single copy in commondata // 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) { for(unsigned int idx = 0; idx < fileList.size(); ++idx) {
string duplicateFile = fileList[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) { if(foundDuplicates == true) {
@ -3951,7 +3951,7 @@ int glestMain(int argc, char** argv) {
string mapName = maps[i]; string mapName = maps[i];
printf("%s\n",mapName.c_str()); printf("%s\n",mapName.c_str());
} }
printf("===========================================\nTotal: %lu\n",maps.size()); printf("===========================================\nTotal: %zu\n",maps.size());
return 0; return 0;
} }
@ -4012,13 +4012,13 @@ int glestMain(int argc, char** argv) {
string name2 = results2[k]; string name2 = results2[k];
printf("--> %s\n",name2.c_str()); printf("--> %s\n",name2.c_str());
} }
printf("--> Total Factions: %lu\n",results2.size()); printf("--> Total Factions: %zu\n",results2.size());
break; break;
} }
} }
} }
} }
printf("===========================================\nTotal Techtrees: %lu\n",results.size()); printf("===========================================\nTotal Techtrees: %zu\n",results.size());
return 0; return 0;
} }
@ -4061,7 +4061,7 @@ int glestMain(int argc, char** argv) {
string name = results[i]; string name = results[i];
printf("%s\n",name.c_str()); printf("%s\n",name.c_str());
} }
printf("===========================================\nTotal: %lu\n",results.size()); printf("===========================================\nTotal: %zu\n",results.size());
return 0; 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; 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; return 0;
} }
@ -4544,7 +4544,7 @@ int glestMain(int argc, char** argv) {
renderer.clearBuffers(); renderer.clearBuffers();
renderer.clearZBuffer(); renderer.clearZBuffer();
renderer.reset2d(); 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) { if(CoreData::getInstance().getMenuFontBig3D() != NULL) {
renderer.renderText3D( renderer.renderText3D(
@ -4568,7 +4568,7 @@ int glestMain(int argc, char** argv) {
Model *model = renderer.newModel(rsGlobal); Model *model = renderer.newModel(rsGlobal);
try { 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); model->load(file);
modelLoadedOk = true; modelLoadedOk = true;
} }

View File

@ -1517,7 +1517,7 @@ void MenuStateConnectedGame::broadCastGameSettingsToHeadlessServer(bool forceNow
if(forceNow == true || if(forceNow == true ||
((needToBroadcastServerSettings == true ) && ( difftime((long int)time(NULL),broadcastServerSettingsDelayTimer) >= HEADLESSSERVER_BROADCAST_SETTINGS_SECONDS))) { ((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; needToBroadcastServerSettings = false;
broadcastServerSettingsDelayTimer = time(NULL); broadcastServerSettingsDelayTimer = time(NULL);
@ -1845,7 +1845,7 @@ void MenuStateConnectedGame::loadGameSettings(GameSettings *gameSettings) {
gameSettings->setScenarioDir(""); 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()) { if(listBoxMap.getSelectedItemIndex() >= 0 && listBoxMap.getSelectedItemIndex() < mapFiles.size()) {
gameSettings->setDescription(formatString(getCurrentMapFile())); gameSettings->setDescription(formatString(getCurrentMapFile()));
@ -4143,7 +4143,7 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
mapFile = ITEM_MISSING; 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); listBoxMap.setItems(maps);
@ -4509,7 +4509,7 @@ int MenuStateConnectedGame::setupMapList(string scenario) {
loadMapInfo(Map::getMapPath(scenarioInfo.mapName, scenarioDir, true), &mapInfo, false); loadMapInfo(Map::getMapPath(scenarioInfo.mapName, scenarioDir, true), &mapInfo, false);
//printf("#6.2\n"); //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]); listBoxMap.setItems(formattedPlayerSortedMaps[mapInfo.players]);
} }
//printf("#7\n"); //printf("#7\n");

View File

@ -3390,7 +3390,7 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force
gameSettings->setMasterserver_admin(serverInterface->getSlot(i)->getSessionKey()); gameSettings->setMasterserver_admin(serverInterface->getSlot(i)->getSessionKey());
gameSettings->setMasterserver_admin_faction_index(serverInterface->getSlot(i)->getPlayerIndex()); gameSettings->setMasterserver_admin_faction_index(serverInterface->getSlot(i)->getPlayerIndex());
labelGameName.setText(serverInterface->getSlot(i)->getName()+" controls"); 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()){ if(serverInterface->getSlot(i)->getSessionKey() == gameSettings->getMasterserver_admin()){
masterserver_admin_found=true; 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(serverInterface->getSlot(i)->getSessionKey());
gameSettings->setMasterserver_admin_faction_index(serverInterface->getSlot(i)->getPlayerIndex()); gameSettings->setMasterserver_admin_faction_index(serverInterface->getSlot(i)->getPlayerIndex());
labelGameName.setText(serverInterface->getSlot(i)->getName()+" controls"); 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()){ if(serverInterface->getSlot(i)->getSessionKey() == gameSettings->getMasterserver_admin()){
masterserver_admin_found=true; masterserver_admin_found=true;

View File

@ -274,8 +274,8 @@ void MenuStateKeysetup::mouseClick(int x, int y, MouseButton mouseButton){
if(userProperties.empty() == false) { if(userProperties.empty() == false) {
Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys)); Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
string userKeysFile = configKeys.getFileName(true); 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::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() = %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() = %zu\n",__FILE__,__FUNCTION__,__LINE__,userKeysFile.c_str(),userProperties.size());
configKeys.setUserProperties(userProperties); configKeys.setUserProperties(userProperties);
configKeys.save(); configKeys.save();

View File

@ -966,7 +966,7 @@ void MenuStateMasterserver::rebuildServerLines(const string &serverInfo) {
Tokenize(server,serverEntities,"|"); Tokenize(server,serverEntities,"|");
const int MIN_FIELDS_EXPECTED = 14; 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) { if(serverEntities.size() >= MIN_FIELDS_EXPECTED) {
labelTitle.setText(lang.get("AvailableServers")); labelTitle.setText(lang.get("AvailableServers"));

View File

@ -1165,7 +1165,7 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){
vector<string> languageFileMappings; vector<string> languageFileMappings;
Tokenize(txnURLFileListMapping,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) { if(languageFiles.empty() == false) {

View File

@ -592,7 +592,7 @@ std::vector<std::string> FactionType::validateFactionType() {
} }
if(foundUnit == false) { 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]=""; 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()); 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<unitTypes.size();i++){ for(int i=0; i<unitTypes.size();i++){
printf("In [%s::%s Line: %d] scanning [%s] idx = %d [%s]\n",__FILE__,__FUNCTION__,__LINE__,name.c_str(),i,unitTypes[i].getName().c_str()); printf("In [%s::%s Line: %d] scanning [%s] idx = %d [%s]\n",__FILE__,__FUNCTION__,__LINE__,name.c_str(),i,unitTypes[i].getName().c_str());
} }
@ -798,7 +798,7 @@ const UnitType *FactionType::getUnitTypeById(int id) const{
} }
} }
printf("In [%s::%s Line: %d] scanning [%d] size = %lu\n",__FILE__,__FUNCTION__,__LINE__,id,unitTypes.size()); printf("In [%s::%s Line: %d] scanning [%d] size = %zu\n",__FILE__,__FUNCTION__,__LINE__,id,unitTypes.size());
for(int i=0; i<unitTypes.size();i++){ for(int i=0; i<unitTypes.size();i++){
printf("In [%s::%s Line: %d] scanning [%s] idx = %d [%s][%d]\n",__FILE__,__FUNCTION__,__LINE__,name.c_str(),i,unitTypes[i].getName().c_str(),unitTypes[i].getId()); printf("In [%s::%s Line: %d] scanning [%s] idx = %d [%s][%d]\n",__FILE__,__FUNCTION__,__LINE__,name.c_str(),i,unitTypes[i].getName().c_str(),unitTypes[i].getId());
} }
@ -818,7 +818,7 @@ const UpgradeType *FactionType::getUpgradeType(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<upgradeTypes.size();i++){ for(int i=0; i<upgradeTypes.size();i++){
printf("In [%s::%s Line: %d] scanning [%s] idx = %d [%s]\n",__FILE__,__FUNCTION__,__LINE__,name.c_str(),i,upgradeTypes[i].getName().c_str()); printf("In [%s::%s Line: %d] scanning [%s] idx = %d [%s]\n",__FILE__,__FUNCTION__,__LINE__,name.c_str(),i,upgradeTypes[i].getName().c_str());
} }

View File

@ -979,7 +979,7 @@ const CommandType* UnitType::findCommandTypeById(int id) const{
const CommandType *UnitType::getCommandType(int i) const { const CommandType *UnitType::getCommandType(int i) const {
if(i >= commandTypes.size()) { if(i >= commandTypes.size()) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
return commandTypes[i]; return commandTypes[i];

View File

@ -405,14 +405,14 @@ Checksum Map::load(const string &path, TechTree *techTree, Tileset *tileset) {
readBytes = fread(&x, sizeof(int32), 1, f); readBytes = fread(&x, sizeof(int32), 1, f);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
readBytes = fread(&y, sizeof(int32), 1, f); readBytes = fread(&y, sizeof(int32), 1, f);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); 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); readBytes = fread(&alt, sizeof(float32), 1, f);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); 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); readBytes = fread(&surf, sizeof(int8), 1, f);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); 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); readBytes = fread(&objNumber, sizeof(int8), 1, f);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }

View File

@ -2313,7 +2313,7 @@ string World::getAllFactionsCacheStats() {
} }
char szBuf[8096]=""; 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; result = szBuf;
return result; return result;
} }

View File

@ -324,7 +324,7 @@ public:
//if(info.line == 0) return; //if(info.line == 0) return;
MutexSafeWrapper safeMutexMasterList(mutex); 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) { if(info.line > 0) {
++allocCount; ++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; ++nonMonitoredCount;
nonMonitoredBytes+= info.bytes; nonMonitoredBytes+= info.bytes;

View File

@ -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); size_t readBytes = fread(&meshHeader, sizeof(MeshHeaderV2), 1, f);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); 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); readBytes = fread(vertices, sizeof(Vec3f)*frameCount*vertexCount, 1, f);
if(readBytes != 1 && (frameCount * vertexCount) != 0) { if(readBytes != 1 && (frameCount * vertexCount) != 0) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
readBytes = fread(normals, sizeof(Vec3f)*frameCount*vertexCount, 1, f); readBytes = fread(normals, sizeof(Vec3f)*frameCount*vertexCount, 1, f);
if(readBytes != 1 && (frameCount * vertexCount) != 0) { if(readBytes != 1 && (frameCount * vertexCount) != 0) {
char szBuf[8096]=""; 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); 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); readBytes = fread(texCoords, sizeof(Vec2f)*vertexCount, 1, f);
if(readBytes != 1 && vertexCount != 0) { if(readBytes != 1 && vertexCount != 0) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
} }
readBytes = fread(&diffuseColor, sizeof(Vec3f), 1, f); readBytes = fread(&diffuseColor, sizeof(Vec3f), 1, f);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
readBytes = fread(&opacity, sizeof(float32), 1, f); readBytes = fread(&opacity, sizeof(float32), 1, f);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); 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); readBytes = fread(indices, sizeof(uint32)*indexCount, 1, f);
if(readBytes != 1 && indexCount != 0) { if(readBytes != 1 && indexCount != 0) {
char szBuf[8096]=""; 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); 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); size_t readBytes = fread(&meshHeader, sizeof(MeshHeaderV3), 1, f);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); 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); readBytes = fread(vertices, sizeof(Vec3f)*frameCount*vertexCount, 1, f);
if(readBytes != 1 && (frameCount * vertexCount) != 0) { if(readBytes != 1 && (frameCount * vertexCount) != 0) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
readBytes = fread(normals, sizeof(Vec3f)*frameCount*vertexCount, 1, f); readBytes = fread(normals, sizeof(Vec3f)*frameCount*vertexCount, 1, f);
if(readBytes != 1 && (frameCount * vertexCount) != 0) { if(readBytes != 1 && (frameCount * vertexCount) != 0) {
char szBuf[8096]=""; 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); 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); readBytes = fread(texCoords, sizeof(Vec2f)*vertexCount, 1, f);
if(readBytes != 1 && vertexCount != 0) { if(readBytes != 1 && vertexCount != 0) {
char szBuf[8096]=""; 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); 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); readBytes = fread(&diffuseColor, sizeof(Vec3f), 1, f);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
readBytes = fread(&opacity, sizeof(float32), 1, f); readBytes = fread(&opacity, sizeof(float32), 1, f);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); 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); readBytes = fread(indices, sizeof(uint32)*indexCount, 1, f);
if(readBytes != 1 && indexCount != 0) { if(readBytes != 1 && indexCount != 0) {
char szBuf[8096]=""; 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); 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); size_t readBytes = fread(&meshHeader, sizeof(MeshHeader), 1, f);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); 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); readBytes = fread(cMapPath, mapPathSize, 1, f);
if(readBytes != 1 && mapPathSize != 0) { if(readBytes != 1 && mapPathSize != 0) {
char szBuf[8096]=""; 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); 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); readBytes = fread(vertices, sizeof(Vec3f)*frameCount*vertexCount, 1, f);
if(readBytes != 1 && (frameCount * vertexCount) != 0) { if(readBytes != 1 && (frameCount * vertexCount) != 0) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
readBytes = fread(normals, sizeof(Vec3f)*frameCount*vertexCount, 1, f); readBytes = fread(normals, sizeof(Vec3f)*frameCount*vertexCount, 1, f);
if(readBytes != 1 && (frameCount * vertexCount) != 0) { if(readBytes != 1 && (frameCount * vertexCount) != 0) {
char szBuf[8096]=""; 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); 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); readBytes = fread(texCoords, sizeof(Vec2f)*vertexCount, 1, f);
if(readBytes != 1 && vertexCount != 0) { if(readBytes != 1 && vertexCount != 0) {
char szBuf[8096]=""; 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); 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); readBytes = fread(indices, sizeof(uint32)*indexCount, 1, f);
if(readBytes != 1 && indexCount != 0) { if(readBytes != 1 && indexCount != 0) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
@ -994,7 +994,7 @@ void Model::loadG3d(const string &path, bool deletePixMapAfterLoad,
if(readBytes != 1) { if(readBytes != 1) {
fclose(f); fclose(f);
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
@ -1015,7 +1015,7 @@ void Model::loadG3d(const string &path, bool deletePixMapAfterLoad,
readBytes = fread(&modelHeader, sizeof(ModelHeader), 1, f); readBytes = fread(&modelHeader, sizeof(ModelHeader), 1, f);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
@ -1048,7 +1048,7 @@ void Model::loadG3d(const string &path, bool deletePixMapAfterLoad,
readBytes = fread(&meshCount, sizeof(meshCount), 1, f); readBytes = fread(&meshCount, sizeof(meshCount), 1, f);
if(readBytes != 1 && meshCount != 0) { if(readBytes != 1 && meshCount != 0) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
@ -1075,7 +1075,7 @@ void Model::loadG3d(const string &path, bool deletePixMapAfterLoad,
readBytes = fread(&meshCount, sizeof(meshCount), 1, f); readBytes = fread(&meshCount, sizeof(meshCount), 1, f);
if(readBytes != 1 && meshCount != 0) { if(readBytes != 1 && meshCount != 0) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }

View File

@ -122,7 +122,7 @@ void PixmapIoTga::openRead(const string &path) {
size_t readBytes = fread(&fileHeader, sizeof(TargaFileHeader), 1, file); size_t readBytes = fread(&fileHeader, sizeof(TargaFileHeader), 1, file);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
@ -157,7 +157,7 @@ void PixmapIoTga::read(uint8 *pixels, int components) {
size_t readBytes = fread(&l, 1, 1, file); size_t readBytes = fread(&l, 1, 1, file);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
@ -170,21 +170,21 @@ void PixmapIoTga::read(uint8 *pixels, int components) {
size_t readBytes = fread(&b, 1, 1, file); size_t readBytes = fread(&b, 1, 1, file);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
readBytes = fread(&g, 1, 1, file); readBytes = fread(&g, 1, 1, file);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
readBytes = fread(&r, 1, 1, file); readBytes = fread(&r, 1, 1, file);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
@ -192,7 +192,7 @@ void PixmapIoTga::read(uint8 *pixels, int components) {
readBytes = fread(&a, 1, 1, file); readBytes = fread(&a, 1, 1, file);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
@ -293,7 +293,7 @@ void PixmapIoBmp::openRead(const string &path){
size_t readBytes = fread(&fileHeader, sizeof(BitmapFileHeader), 1, file); size_t readBytes = fread(&fileHeader, sizeof(BitmapFileHeader), 1, file);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
@ -306,7 +306,7 @@ void PixmapIoBmp::openRead(const string &path){
readBytes = fread(&infoHeader, sizeof(BitmapInfoHeader), 1, file); readBytes = fread(&infoHeader, sizeof(BitmapInfoHeader), 1, file);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
@ -329,21 +329,21 @@ void PixmapIoBmp::read(uint8 *pixels, int components) {
size_t readBytes = fread(&b, 1, 1, file); size_t readBytes = fread(&b, 1, 1, file);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
readBytes = fread(&g, 1, 1, file); readBytes = fread(&g, 1, 1, file);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
readBytes = fread(&r, 1, 1, file); readBytes = fread(&r, 1, 1, file);
if(readBytes != 1) { if(readBytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }

View File

@ -765,7 +765,7 @@ void MapPreview::loadFromFile(const string &path) {
size_t bytes = fread(&header, sizeof(MapFileHeader), 1, f1); size_t bytes = fread(&header, sizeof(MapFileHeader), 1, f1);
if(bytes != 1) { if(bytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
@ -789,14 +789,14 @@ void MapPreview::loadFromFile(const string &path) {
bytes = fread(&startLocations[i].x, sizeof(int32), 1, f1); bytes = fread(&startLocations[i].x, sizeof(int32), 1, f1);
if(bytes != 1) { if(bytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
bytes = fread(&startLocations[i].y, sizeof(int32), 1, f1); bytes = fread(&startLocations[i].y, sizeof(int32), 1, f1);
if(bytes != 1) { if(bytes != 1) {
char szBuf[8096]=""; 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); 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); bytes = fread(&cells[i][j].height, sizeof(float), 1, f1);
if(bytes != 1) { if(bytes != 1) {
char szBuf[8096]=""; 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); 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); bytes = fread(&cells[i][j].surface, sizeof(int8), 1, f1);
if(bytes != 1) { if(bytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
} }
@ -834,7 +834,7 @@ void MapPreview::loadFromFile(const string &path) {
bytes = fread(&obj, sizeof(int8), 1, f1); bytes = fread(&obj, sizeof(int8), 1, f1);
if(bytes != 1) { if(bytes != 1) {
char szBuf[8096]=""; 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); throw megaglest_runtime_error(szBuf);
} }
@ -1021,7 +1021,7 @@ bool MapPreview::loadMapInfo(string file, MapInfo *mapInfo, string i18nMaxMapPla
if(errorOnInvalidMap == true) { if(errorOnInvalidMap == true) {
char szBuf[8096]=""; 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); SystemFlags::OutputDebug(SystemFlags::debugError,"%s",szBuf);
throw megaglest_runtime_error(szBuf); throw megaglest_runtime_error(szBuf);

View File

@ -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) { 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; 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 ) { if ( (fp = fopen ("file", "wb")) == 0 ) {
abort(); abort();

View File

@ -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); size_t result = fwrite(buffer, size, nmemb, out->stream);
if(result != nmemb) { 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::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 = %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 = %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 = %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 = %zu, result = %zu\n",fullFilePath.c_str(),nmemb,result);
//return -1; /* failure, can't open file to write */ //return -1; /* failure, can't open file to write */
} }
return result; return result;

View File

@ -1170,12 +1170,12 @@ int Socket::getDataToRead(bool wantImmediateReply) {
break; break;
} }
else if(hasDataToRead() == true) { 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 = %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 = %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\n",__FILE__,__FUNCTION__,__LINE__,err,sock,size);
} }
else { 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 = %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 = %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\n",__FILE__,__FUNCTION__,__LINE__,err,sock,size);
break; break;
} }

View File

@ -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 // create a new source
if(staticSources.size() >= params.staticBufferCount) { if(staticSources.size() >= params.staticBufferCount) {

View File

@ -168,7 +168,7 @@ void OggSoundFileLoader::open(const string &path, SoundInfo *soundInfo){
uint32 samples = static_cast<uint32>(ov_pcm_total(vf, -1)); uint32 samples = static_cast<uint32>(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->setChannels(vi->channels);
soundInfo->setsamplesPerSecond(vi->rate); soundInfo->setsamplesPerSecond(vi->rate);

View File

@ -54,21 +54,21 @@ void AllocRegistry::dump(const char *path) {
leakBytes += info.bytes; leakBytes += info.bytes;
//allocs[i].stack = AllocInfo::getStackTrace(); //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, "\nTotal leaks: %d, %zu bytes\n", leakCount, leakBytes);
fprintf(f, "Total allocations: %d, %lu bytes\n", allocCount, allocBytes); fprintf(f, "Total allocations: %d, %zu bytes\n", allocCount, allocBytes);
fprintf(f, "Not monitored allocations: %d, %lu bytes\n", nonMonitoredCount, nonMonitoredBytes); fprintf(f, "Not monitored allocations: %d, %zu bytes\n", nonMonitoredCount, nonMonitoredBytes);
fclose(f); fclose(f);
printf("Memory leak dump summary at: %s\n",szBuf2); printf("Memory leak dump summary at: %s\n",szBuf2);
printf("Total leaks: %d, %lu bytes\n", leakCount, leakBytes); printf("Total leaks: %d, %zu bytes\n", leakCount, leakBytes);
printf("Total allocations: %d, %lu bytes\n", allocCount, allocBytes); printf("Total allocations: %d, %zu bytes\n", allocCount, allocBytes);
printf("Not monitored allocations: %d, %lu bytes\n", nonMonitoredCount, nonMonitoredBytes); printf("Not monitored allocations: %d, %zu bytes\n", nonMonitoredCount, nonMonitoredBytes);
} }
#endif #endif