- more compiler warning cleanup

This commit is contained in:
Mark Vejvoda 2010-10-21 16:36:26 +00:00
parent 45a26a4597
commit cbe6860826
6 changed files with 15 additions and 15 deletions

View File

@ -853,7 +853,7 @@ int glestMain(int argc, char** argv){
} }
printf("\n----------------------------------------------------------------"); printf("\n----------------------------------------------------------------");
printf("\nChecking techPath [%s] techName [%s] total faction count = %d\n",techPath.c_str(), techName.c_str(),factionsList.size()); printf("\nChecking techPath [%s] techName [%s] total faction count = %d\n",techPath.c_str(), techName.c_str(),(int)factionsList.size());
for(int j = 0; j < factionsList.size(); ++j) { for(int j = 0; j < factionsList.size(); ++j) {
if( filteredFactionList.size() == 0 || if( filteredFactionList.size() == 0 ||
std::find(filteredFactionList.begin(),filteredFactionList.end(),factionsList[j]) != filteredFactionList.end()) { std::find(filteredFactionList.begin(),filteredFactionList.end(),factionsList[j]) != filteredFactionList.end()) {
@ -905,7 +905,7 @@ int glestMain(int argc, char** argv){
} }
if(techtree_errors == false) { if(techtree_errors == false) {
printf("\nValidation found NO ERRORS for techPath [%s] techName [%s] factions checked (count = %d):\n",techPath.c_str(), techName.c_str(),factions.size()); printf("\nValidation found NO ERRORS for techPath [%s] techName [%s] factions checked (count = %d):\n",techPath.c_str(), techName.c_str(),(int)factions.size());
for ( set<string>::iterator it = factions.begin(); it != factions.end(); ++it ) { for ( set<string>::iterator it = factions.begin(); it != factions.end(); ++it ) {
printf("Faction [%s]\n",(*it).c_str()); printf("Faction [%s]\n",(*it).c_str());
} }

View File

@ -137,7 +137,7 @@ void TechTree::load(const string &dir, set<string> &factions, Checksum* checksum
string factionName = *it; string factionName = *it;
char szBuf[1024]=""; char szBuf[1024]="";
sprintf(szBuf,"%s %s [%d / %d] - %s",Lang::getInstance().get("Loading").c_str(),Lang::getInstance().get("Faction").c_str(),i+1,factions.size(),factionName.c_str()); sprintf(szBuf,"%s %s [%d / %d] - %s",Lang::getInstance().get("Loading").c_str(),Lang::getInstance().get("Faction").c_str(),i+1,(int)factions.size(),factionName.c_str());
Logger &logger= Logger::getInstance(); Logger &logger= Logger::getInstance();
logger.setState(szBuf); logger.setState(szBuf);

View File

@ -591,7 +591,7 @@ void Map::loadFromFile(const string &path) {
//read header //read header
MapFileHeader header; MapFileHeader header;
fread(&header, sizeof(MapFileHeader), 1, f1); size_t bytes = fread(&header, sizeof(MapFileHeader), 1, f1);
altFactor = header.altFactor; altFactor = header.altFactor;
waterLevel = header.waterLevel; waterLevel = header.waterLevel;
@ -602,30 +602,30 @@ void Map::loadFromFile(const string &path) {
//read start locations //read start locations
resetFactions(header.maxFactions); resetFactions(header.maxFactions);
for (int i = 0; i < maxFactions; ++i) { for (int i = 0; i < maxFactions; ++i) {
fread(&startLocations[i].x, sizeof(int32), 1, f1); bytes = fread(&startLocations[i].x, sizeof(int32), 1, f1);
fread(&startLocations[i].y, sizeof(int32), 1, f1); bytes = fread(&startLocations[i].y, sizeof(int32), 1, f1);
} }
//read Heights //read Heights
reset(header.width, header.height, 10, 1); reset(header.width, header.height, 10, 1);
for (int j = 0; j < h; ++j) { for (int j = 0; j < h; ++j) {
for (int i = 0; i < w; ++i) { for (int i = 0; i < w; ++i) {
fread(&cells[i][j].height, sizeof(float), 1, f1); bytes = fread(&cells[i][j].height, sizeof(float), 1, f1);
} }
} }
//read surfaces //read surfaces
for (int j = 0; j < h; ++j) { for (int j = 0; j < h; ++j) {
for (int i = 0; i < w; ++i) { for (int i = 0; i < w; ++i) {
fread(&cells[i][j].surface, sizeof(int8), 1, f1); bytes = fread(&cells[i][j].surface, sizeof(int8), 1, f1);
} }
} }
//read objects //read objects
for (int j = 0; j < h; ++j) { for (int j = 0; j < h; ++j) {
for (int i = 0; i < w; ++i) { for (int i = 0; i < w; ++i) {
int8 obj; int8 obj=0;
fread(&obj, sizeof(int8), 1, f1); bytes = fread(&obj, sizeof(int8), 1, f1);
if (obj <= 10) { if (obj <= 10) {
cells[i][j].object = obj; cells[i][j].object = obj;
} else { } else {

View File

@ -204,7 +204,7 @@ void * LuaArguments::getGenericData(int argumentIndex) const{
//} //}
else if(lua_isnumber(luaState, argumentIndex)) { else if(lua_isnumber(luaState, argumentIndex)) {
lua_Integer result = luaL_checkinteger(luaState, argumentIndex); lua_Integer result = luaL_checkinteger(luaState, argumentIndex);
printf("\nGENERIC param %d is an int, %d!\n",argumentIndex,result); printf("\nGENERIC param %d is an int, %d!\n",argumentIndex,(int)result);
return (void *)result; return (void *)result;
} }
else { else {

View File

@ -42,12 +42,12 @@ void FileCRCPreCacheThread::execute() {
string techName = techPaths[idx]; string techName = techPaths[idx];
time_t elapsedTime = time(NULL); time_t elapsedTime = time(NULL);
printf("In [%s::%s Line: %d] caching CRC value for Tech [%s] [%d of %d]\n",__FILE__,__FUNCTION__,__LINE__,techName.c_str(),idx+1,techPaths.size()); printf("In [%s::%s Line: %d] caching CRC value for Tech [%s] [%d of %d]\n",__FILE__,__FUNCTION__,__LINE__,techName.c_str(),idx+1,(int)techPaths.size());
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] caching CRC value for Tech [%s] [%d of %d]\n",__FILE__,__FUNCTION__,__LINE__,techName.c_str(),idx+1,techPaths.size()); SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] caching CRC value for Tech [%s] [%d of %d]\n",__FILE__,__FUNCTION__,__LINE__,techName.c_str(),idx+1,techPaths.size());
int32 techCRC = getFolderTreeContentsCheckSumRecursively(techDataPaths, string("/") + techName + string("/*"), ".xml", NULL); int32 techCRC = getFolderTreeContentsCheckSumRecursively(techDataPaths, string("/") + techName + string("/*"), ".xml", NULL);
printf("In [%s::%s Line: %d] cached CRC value for Tech [%s] is [%d] [%d of %d] took %.3f seconds.\n",__FILE__,__FUNCTION__,__LINE__,techName.c_str(),techCRC,idx+1,techPaths.size(),difftime(time(NULL),elapsedTime)); printf("In [%s::%s Line: %d] cached CRC value for Tech [%s] is [%d] [%d of %d] took %.3f seconds.\n",__FILE__,__FUNCTION__,__LINE__,techName.c_str(),techCRC,idx+1,(int)techPaths.size(),difftime(time(NULL),elapsedTime));
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] cached CRC value for Tech [%s] is [%d] [%d of %d] took %.3f seconds.\n",__FILE__,__FUNCTION__,__LINE__,techName.c_str(),techCRC,idx+1,techPaths.size(),difftime(time(NULL),elapsedTime)); SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] cached CRC value for Tech [%s] is [%d] [%d of %d] took %.3f seconds.\n",__FILE__,__FUNCTION__,__LINE__,techName.c_str(),techCRC,idx+1,techPaths.size(),difftime(time(NULL),elapsedTime));
if(getQuitStatus() == true) { if(getQuitStatus() == true) {

View File

@ -104,9 +104,9 @@ string boolToStr(bool b){
} }
} }
string intToStr(int64 i){ string intToStr(int64 i) {
char str[strSize]=""; char str[strSize]="";
sprintf(str, "%d", i); sprintf(str, "%lld", i);
return str; return str;
} }