- fix win32 build

- cleanup a lot of win32 compiler warnings
This commit is contained in:
Mark Vejvoda
2012-04-16 20:15:57 +00:00
parent 3b8dd289ac
commit c8fdc9269f
24 changed files with 86 additions and 85 deletions

View File

@@ -421,9 +421,9 @@ void ParticleSystem::loadGame(const XmlNode *rootNode) {
// State state;
state = static_cast<State>(particleSystemNode->getAttribute("state")->getIntValue());
// bool active;
active = particleSystemNode->getAttribute("active")->getIntValue();
active = particleSystemNode->getAttribute("active")->getIntValue() != 0;
// bool visible;
visible = particleSystemNode->getAttribute("visible")->getIntValue();
visible = particleSystemNode->getAttribute("visible")->getIntValue() != 0;
// int aliveParticleCount;
aliveParticleCount = particleSystemNode->getAttribute("aliveParticleCount")->getIntValue();
// int particleCount;
@@ -461,9 +461,9 @@ void ParticleSystem::loadGame(const XmlNode *rootNode) {
// Vec3f factionColor;
factionColor = Vec3f::strToVec3(particleSystemNode->getAttribute("factionColor")->getValue());
// bool teamcolorNoEnergy;
teamcolorNoEnergy = particleSystemNode->getAttribute("teamcolorNoEnergy")->getIntValue();
teamcolorNoEnergy = particleSystemNode->getAttribute("teamcolorNoEnergy")->getIntValue() != 0;
// bool teamcolorEnergy;
teamcolorEnergy = particleSystemNode->getAttribute("teamcolorEnergy")->getIntValue();
teamcolorEnergy = particleSystemNode->getAttribute("teamcolorEnergy")->getIntValue() != 0;
// int alternations;
alternations = particleSystemNode->getAttribute("alternations")->getIntValue();
// int particleSystemStartDelay;
@@ -1091,7 +1091,7 @@ void UnitParticleSystem::updateParticle(Particle *p){
float energyRatio;
if(alternations > 0){
int interval= (maxParticleEnergy / alternations);
float moduloValue= static_cast<int> (static_cast<float> (p->energy)) % interval;
float moduloValue= (float)((int)(static_cast<float> (p->energy)) % interval);
if(moduloValue < interval / 2){
energyRatio= (interval - moduloValue) / interval;
@@ -1237,17 +1237,17 @@ void UnitParticleSystem::loadGame(const XmlNode *rootNode) {
// Vec3f oldPosition;
oldPosition = Vec3f::strToVec3(unitParticleSystemNode->getAttribute("oldPosition")->getValue());
// bool energyUp;
energyUp = unitParticleSystemNode->getAttribute("energyUp")->getIntValue();
energyUp = unitParticleSystemNode->getAttribute("energyUp")->getIntValue() != 0;
// float startTime;
startTime = unitParticleSystemNode->getAttribute("startTime")->getFloatValue();
// float endTime;
endTime = unitParticleSystemNode->getAttribute("endTime")->getFloatValue();
// bool relative;
relative = unitParticleSystemNode->getAttribute("relative")->getIntValue();
relative = unitParticleSystemNode->getAttribute("relative")->getIntValue() != 0;
// bool relativeDirection;
relativeDirection = unitParticleSystemNode->getAttribute("relativeDirection")->getIntValue();
relativeDirection = unitParticleSystemNode->getAttribute("relativeDirection")->getIntValue() != 0;
// bool fixed;
fixed = unitParticleSystemNode->getAttribute("fixed")->getIntValue();
fixed = unitParticleSystemNode->getAttribute("fixed")->getIntValue() != 0;
// Shape shape;
shape = static_cast<Shape>(unitParticleSystemNode->getAttribute("shape")->getIntValue());
// float angle;
@@ -1259,13 +1259,13 @@ void UnitParticleSystem::loadGame(const XmlNode *rootNode) {
// float rotation;
rotation = unitParticleSystemNode->getAttribute("rotation")->getFloatValue();
// bool isVisibleAtNight;
isVisibleAtNight = unitParticleSystemNode->getAttribute("isVisibleAtNight")->getIntValue();
isVisibleAtNight = unitParticleSystemNode->getAttribute("isVisibleAtNight")->getIntValue() != 0;
// bool isVisibleAtDay;
isVisibleAtDay = unitParticleSystemNode->getAttribute("isVisibleAtDay")->getIntValue();
isVisibleAtDay = unitParticleSystemNode->getAttribute("isVisibleAtDay")->getIntValue() != 0;
// bool isDaylightAffected;
isDaylightAffected = unitParticleSystemNode->getAttribute("isDaylightAffected")->getIntValue();
isDaylightAffected = unitParticleSystemNode->getAttribute("isDaylightAffected")->getIntValue() != 0;
// bool radiusBasedStartenergy;
radiusBasedStartenergy = unitParticleSystemNode->getAttribute("radiusBasedStartenergy")->getIntValue();
radiusBasedStartenergy = unitParticleSystemNode->getAttribute("radiusBasedStartenergy")->getIntValue() != 0;
// int staticParticleCount;
staticParticleCount = unitParticleSystemNode->getAttribute("staticParticleCount")->getIntValue();
// int delay;

View File

@@ -1002,7 +1002,7 @@ bool MapPreview::loadMapInfo(string file, MapInfo *mapInfo, string i18nMaxMapPla
// static
string MapPreview::getMapPath(const vector<string> &pathList, const string &mapName,
string scenarioDir, bool errorOnNotFound) {
for(int idx = 0; idx < pathList.size(); idx++) {
for(unsigned int idx = 0; idx < pathList.size(); idx++) {
string map_path = pathList[idx];
endPathWithSlash(map_path);
@@ -1071,7 +1071,7 @@ vector<string> MapPreview::findAllValidMaps(const vector<string> &pathList,
results.clear();
MapInfo mapInfo;
for(int i= 0; i < mapFiles.size(); i++){// fetch info and put map in right list
for(unsigned int i= 0; i < mapFiles.size(); i++){// fetch info and put map in right list
//loadMapInfo(string file, MapInfo *mapInfo, string i18nMaxMapPlayersTitle,string i18nMapSizeTitle,bool errorOnInvalidMap=true);
//printf("getMapPath [%s]\nmapFiles.at(i) [%s]\nscenarioDir [%s] getUserDataOnly = %d cutExtension = %d\n",getMapPath(pathList,mapFiles.at(i), scenarioDir, false).c_str(),mapFiles.at(i).c_str(),scenarioDir.c_str(), getUserDataOnly, cutExtension);

View File

@@ -70,6 +70,7 @@ getHTTPResponse(int s, int * size)
int header_buf_len = 2048;
int header_buf_used = 0;
char * content_buf;
char *content_buf_new;
int content_buf_len = 2048;
int content_buf_used = 0;
char chunksize_buf[32];
@@ -234,7 +235,7 @@ getHTTPResponse(int s, int * size)
else {
content_buf_len = content_buf_used + (int)bytestocopy;
}
char *content_buf_new = (char *)realloc((void *)content_buf,
content_buf_new = (char *)realloc((void *)content_buf,
content_buf_len);
if(content_buf_new) {
content_buf = content_buf_new;
@@ -261,7 +262,7 @@ getHTTPResponse(int s, int * size)
} else {
content_buf_len = content_buf_used + n;
}
char *content_buf_new = (char *)realloc((void *)content_buf,
content_buf_new = (char *)realloc((void *)content_buf,
content_buf_len);
if(content_buf_new) {
content_buf = content_buf_new;