WINTERMUTE: Silence most warnings

This commit is contained in:
Einar Johan Trøan Sømåen
2012-07-09 02:50:15 +02:00
parent 0273e495e1
commit 5224ebef2c
34 changed files with 87 additions and 92 deletions
+1 -1
View File
@@ -796,7 +796,7 @@ void CAdActor::getNextStep() {
maxStepX--;
}
if (((CAdGame *)Game)->_scene->isBlockedAt(_pFX, _pFY, true, this)) {
if (((CAdGame *)Game)->_scene->isBlockedAt((int)_pFX,(int) _pFY, true, this)) {
if (_pFCount == 0) {
_state = _nextState;
_nextState = STATE_READY;
+6 -6
View File
@@ -1672,9 +1672,9 @@ HRESULT CAdGame::resetResponse(int ID) {
//////////////////////////////////////////////////////////////////////////
HRESULT CAdGame::displayContent(bool update, bool displayAll) {
HRESULT CAdGame::displayContent(bool doUpdate, bool displayAll) {
// init
if (update) initLoop();
if (doUpdate) initLoop();
// fill black
_renderer->fill(0, 0, 0);
@@ -1682,11 +1682,11 @@ HRESULT CAdGame::displayContent(bool update, bool displayAll) {
// playing exclusive video?
if (_videoPlayer->isPlaying()) {
if (update) _videoPlayer->update();
if (doUpdate) _videoPlayer->update();
_videoPlayer->display();
} else if (_theoraPlayer) {
if (_theoraPlayer->isPlaying()) {
if (update) _theoraPlayer->update();
if (doUpdate) _theoraPlayer->update();
_theoraPlayer->display();
}
if (_theoraPlayer->isFinished()) {
@@ -1696,7 +1696,7 @@ HRESULT CAdGame::displayContent(bool update, bool displayAll) {
} else {
// process scripts
if (update) _scEngine->tick();
if (doUpdate) _scEngine->tick();
POINT p;
getMousePos(&p);
@@ -1712,7 +1712,7 @@ HRESULT CAdGame::displayContent(bool update, bool displayAll) {
if (_indicatorDisplay) displayIndicator();
if (update || displayAll) {
if (doUpdate || displayAll) {
// display normal windows
displayWindows(false);
+7 -7
View File
@@ -856,7 +856,7 @@ HRESULT CAdScene::loadBuffer(byte *buffer, bool complete) {
}
//////////////////////////////////////////////////////////////////////////
HRESULT CAdScene::traverseNodes(bool update) {
HRESULT CAdScene::traverseNodes(bool doUpdate) {
if (!_initialized) return S_OK;
int j, k;
@@ -877,7 +877,7 @@ HRESULT CAdScene::traverseNodes(bool update) {
//////////////////////////////////////////////////////////////////////////
// *** adjust scroll offset
if (update) {
if (doUpdate) {
/*
if (_autoScroll && Game->_mainObject != NULL)
{
@@ -947,7 +947,7 @@ HRESULT CAdScene::traverseNodes(bool update) {
if (!_layers[j]->_active) continue;
// make layer exclusive
if (!update) {
if (!doUpdate) {
if (_layers[j]->_closeUp && !Game->_editorMode) {
if (!_shieldWindow) _shieldWindow = new CUIWindow(Game);
if (_shieldWindow) {
@@ -984,7 +984,7 @@ HRESULT CAdScene::traverseNodes(bool update) {
if (node->_entity->_active && (Game->_editorMode || !node->_entity->_editorOnly)) {
Game->_renderer->setup2D();
if (update) node->_entity->update();
if (doUpdate) node->_entity->update();
else node->_entity->display();
}
break;
@@ -993,7 +993,7 @@ HRESULT CAdScene::traverseNodes(bool update) {
if (node->_region->_blocked) break;
if (node->_region->_decoration) break;
if (!update) displayRegionContent(node->_region);
if (!doUpdate) displayRegionContent(node->_region);
}
break;
default:
@@ -1004,7 +1004,7 @@ HRESULT CAdScene::traverseNodes(bool update) {
// display/update all objects which are off-regions
if (_layers[j]->_main) {
if (update) {
if (doUpdate) {
updateFreeObjects();
} else {
displayRegionContent(NULL);
@@ -1019,7 +1019,7 @@ HRESULT CAdScene::traverseNodes(bool update) {
// display/update fader
if (_fader) {
if (update) _fader->update();
if (doUpdate) _fader->update();
else _fader->display();
}
+1 -1
View File
@@ -237,7 +237,7 @@ CBSprite *CAdSpriteSet::getSprite(TDirection direction) {
// find nearest set sprite
int numSteps = 0;
for (int i = dir, NumSteps = 0; i >= 0; i--) {
for (int i = dir; i >= 0; i--) {
if (_sprites[i] != NULL) {
ret = _sprites[i];
numSteps = dir - i;
+2 -2
View File
@@ -140,7 +140,7 @@ byte *CBFileManager::readWholeFile(const Common::String &filename, uint32 *size,
return NULL;
}
if (file->read(buffer, file->size()) != file->size()) {
if (file->read(buffer, (uint32)file->size()) != (uint32)file->size()) {
Game->LOG(0, "Error reading file '%s'", filename.c_str());
closeFile(file);
delete [] buffer;
@@ -224,7 +224,7 @@ HRESULT CBFileManager::saveFile(const Common::String &filename, byte *Buffer, ui
//////////////////////////////////////////////////////////////////////////
HRESULT CBFileManager::requestCD(int cd, char *packageFile, char *filename) {
HRESULT CBFileManager::requestCD(int cd, char *packageFile, const char *filename) {
// unmount all non-local packages
for (int i = 0; i < _packages.GetSize(); i++) {
if (_packages[i]->_cD > 0) _packages[i]->close();
+1 -1
View File
@@ -62,7 +62,7 @@ public:
PATH_PACKAGE, PATH_SINGLE
} TPathType;
HRESULT addPath(TPathType type, const Common::String &path);
HRESULT requestCD(int cd, char *packageFile, char *filename);
HRESULT requestCD(int cd, char *packageFile, const char *filename);
Common::SeekableReadStream *loadSaveGame(const Common::String &filename);
HRESULT saveFile(const Common::String &filename, byte *buffer, uint32 bufferSize, bool compressed = false, byte *prefixBuffer = NULL, uint32 prefixSize = 0);
byte *readWholeFile(const Common::String &filename, uint32 *size = NULL, bool mustExist = true);
+2 -4
View File
@@ -92,8 +92,8 @@ int CBFontBitmap::getTextWidth(byte *text, int maxLength) {
str = AnsiString((char *)text);
}
if (maxLength >= 0 && str.size() > maxLength)
str = Common::String(str.c_str(), maxLength);
if (maxLength >= 0 && str.size() > (uint32)maxLength)
str = Common::String(str.c_str(), (uint32)maxLength);
//str.substr(0, maxLength); // TODO: Remove
int textWidth = 0;
@@ -111,8 +111,6 @@ int CBFontBitmap::textHeightDraw(byte *text, int x, int y, int width, TTextAlign
if (text == NULL || text[0] == '\0') return _tileHeight;
AnsiString str;
if (Game->_textEncoding == TEXT_UTF8) {
+4 -4
View File
@@ -126,8 +126,8 @@ int CBFontTT::getTextWidth(byte *text, int maxLength) {
if (Game->_textEncoding == TEXT_UTF8) textStr = StringUtil::utf8ToWide((char *)text);
else textStr = StringUtil::ansiToWide((char *)text);
if (maxLength >= 0 && textStr.size() > maxLength)
textStr = Common::String(textStr.c_str(), maxLength);
if (maxLength >= 0 && textStr.size() > (uint32)maxLength)
textStr = Common::String(textStr.c_str(), (uint32)maxLength);
//text = text.substr(0, MaxLength); // TODO: Remove
int textWidth, textHeight;
@@ -161,8 +161,8 @@ void CBFontTT::drawText(byte *text, int x, int y, int width, TTextAlign align, i
/* if (Game->_textEncoding == TEXT_UTF8) text = StringUtil::Utf8ToWide((char *)Text);
else text = StringUtil::AnsiToWide((char *)Text);*/
if (maxLength >= 0 && textStr.size() > maxLength)
textStr = Common::String(textStr.c_str(), maxLength);
if (maxLength >= 0 && textStr.size() > (uint32)maxLength)
textStr = Common::String(textStr.c_str(), (uint32)maxLength);
//text = text.substr(0, MaxLength); // TODO: Remove
CBRenderSDL *_renderer = (CBRenderSDL *)Game->_renderer;
+4 -4
View File
@@ -1779,7 +1779,7 @@ HRESULT CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS
byte blue = stack->pop()->getInt(0);
byte alpha = stack->pop()->getInt(0xFF);
bool System = (strcmp(name, "SystemFadeIn") == 0 || strcmp(name, "SystemFadeInAsync") == 0);
bool system = (strcmp(name, "SystemFadeIn") == 0 || strcmp(name, "SystemFadeInAsync") == 0);
_fader->fadeIn(DRGBA(red, green, blue, alpha), duration, system);
if (strcmp(name, "FadeInAsync") != 0 && strcmp(name, "SystemFadeInAsync") != 0) script->waitFor(_fader);
@@ -4030,7 +4030,7 @@ void CBGame::resetMousePos() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::displayContent(bool update, bool displayAll) {
HRESULT CBGame::displayContent(bool doUpdate, bool displayAll) {
return S_OK;
}
@@ -4108,8 +4108,8 @@ HRESULT CBGame::updateMusicCrossfade() {
} else {
//_music[_musicCrossfadeChannel1]->setVolume(GlobMusicVol - (float)CurrentTime / (float)_musicCrossfadeLength * GlobMusicVol);
//_music[_musicCrossfadeChannel2]->setVolume((float)CurrentTime / (float)_musicCrossfadeLength * GlobMusicVol);
_music[_musicCrossfadeChannel1]->setVolume(100 - (float)currentTime / (float)_musicCrossfadeLength * 100);
_music[_musicCrossfadeChannel2]->setVolume((float)currentTime / (float)_musicCrossfadeLength * 100);
_music[_musicCrossfadeChannel1]->setVolume((int)(100.0f - (float)currentTime / (float)_musicCrossfadeLength * 100.0f));
_music[_musicCrossfadeChannel2]->setVolume((int)((float)currentTime / (float)_musicCrossfadeLength * 100.0f));
//Game->QuickMessageForm("%d %d", _music[_musicCrossfadeChannel1]->GetVolume(), _music[_musicCrossfadeChannel2]->GetVolume());
}
+1 -1
View File
@@ -152,7 +152,7 @@ void CBObject::setCaption(const char *caption, int caseVal) { // TODO: rename Ca
//////////////////////////////////////////////////////////////////////////
char *CBObject::getCaption(int caseVal) {
const char *CBObject::getCaption(int caseVal) {
if (caseVal == 0) caseVal = 1;
if (caseVal < 1 || caseVal > 7 || _caption[caseVal - 1] == NULL)
return "";
+1 -1
View File
@@ -86,7 +86,7 @@ public:
HRESULT setCursor(const char *filename);
HRESULT setActiveCursor(const char *filename);
HRESULT cleanup();
char *getCaption(int caseVal = 1);
const char *getCaption(int caseVal = 1);
void setCaption(const char *caption, int caseVal = 1);
bool _editorSelected;
bool _editorAlwaysRegister;
+2 -2
View File
@@ -62,7 +62,7 @@ char *CBParser::getLastOffender() {
//////////////////////////////////////////////////////////////////////
long CBParser::getObject(char **buf, TokenDesc *tokens, char **name, char **data) {
int32 CBParser::getObject(char **buf, TokenDesc *tokens, char **name, char **data) {
skipCharacters(buf, _whiteSpace);
// skip comment lines.
@@ -113,7 +113,7 @@ long CBParser::getObject(char **buf, TokenDesc *tokens, char **name, char **data
//////////////////////////////////////////////////////////////////////
long CBParser::getCommand(char **buf, TokenDesc *tokens, char **params) {
int32 CBParser::getCommand(char **buf, TokenDesc *tokens, char **params) {
if (!*buf) return PARSERR_TOKENNOTFOUND;
Game->miniUpdate();
char *name;
+4 -4
View File
@@ -60,13 +60,13 @@ namespace WinterMute {
class CBParser : public CBBase {
public:
struct TokenDesc {
long id;
const char *token;
int32 id;
const char *token;
};
public:
int scanStr(const char *in, const char *format, ...);
long getCommand(char **buf, TokenDesc *tokens, char **params);
int32 getCommand(char **buf, TokenDesc *tokens, char **params);
CBParser(CBGame *inGame = NULL);
virtual ~CBParser();
private:
@@ -78,7 +78,7 @@ private:
char *getAssignmentText(char **buf);
char *getSubText(char **buf, char open, char close);
void skipCharacters(char **buf, const char *toSkip);
long getObject(char **buf, TokenDesc *tokens, char **name, char **data);
int32 getObject(char **buf, TokenDesc *tokens, char **name, char **data);
int _parserLine;
char _lastOffender[255];
char *_whiteSpace;
+1 -1
View File
@@ -400,7 +400,7 @@ Common::String CBPersistMgr::getStringObj() {
Common::String retString = ret;
if (ret == "(null)") {
if (retString == "(null)") {
retString = "";
}
+1 -4
View File
@@ -46,7 +46,7 @@ RenderTicket::RenderTicket(CBSurfaceSDL *owner, const Graphics::Surface *surf, C
_colorMod = 0;
if (surf) {
_surface = new Graphics::Surface();
_surface->create(srcRect->width(), srcRect->height(), surf->format);
_surface->create((uint16)srcRect->width(), (uint16)srcRect->height(), surf->format);
assert(_surface->format.bytesPerPixel == 4);
// Get a clipped copy of the surface
for (int i = 0; i < _surface->h; i++) {
@@ -362,8 +362,6 @@ void CBRenderSDL::invalidateTicketsFromSurface(CBSurfaceSDL *surf) {
void CBRenderSDL::drawFromTicket(RenderTicket *renderTicket) {
renderTicket->_wantsDraw = true;
// New item
uint32 size = _renderQueue.size();
// A new item always has _drawNum == 0
if (renderTicket->_drawNum == 0) {
// In-order
@@ -425,7 +423,6 @@ void CBRenderSDL::drawTickets() {
if (!_dirtyRect)
return;
RenderQueueIterator it = _renderQueue.begin();
uint32 size = _renderQueue.size();
// Clean out the old tickets
while (it != _renderQueue.end()) {
if ((*it)->_wantsDraw == false) {
+1 -1
View File
@@ -349,7 +349,7 @@ void CBSoundBuffer::LoopSyncProc(HSYNC handle, uint32 channel, uint32 data, void
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundBuffer::setPan(float pan) {
if (_stream) {
g_system->getMixer()->setChannelBalance(*_handle, pan * 127);
g_system->getMixer()->setChannelBalance(*_handle, (int8)(pan * 127));
}
return S_OK;
}
+4 -4
View File
@@ -181,7 +181,7 @@ HRESULT CBStringTable::loadFile(const char *filename, bool clearOld) {
return E_FAIL;
}
int pos = 0;
uint32 pos = 0;
if (size > 3 && buffer[0] == 0xEF && buffer[1] == 0xBB && buffer[2] == 0xBF) {
pos += 3;
@@ -192,12 +192,12 @@ HRESULT CBStringTable::loadFile(const char *filename, bool clearOld) {
}
} else Game->_textEncoding = TEXT_ANSI;
int lineLength = 0;
uint32 lineLength = 0;
while (pos < size) {
lineLength = 0;
while (pos + lineLength < size && buffer[pos + lineLength] != '\n' && buffer[pos + lineLength] != '\0') lineLength++;
int realLength = lineLength - (pos + lineLength >= size ? 0 : 1);
uint32 realLength = lineLength - (pos + lineLength >= size ? 0 : 1);
char *line = new char[realLength + 1];
strncpy(line, (char *)&buffer[pos], realLength);
line[realLength] = '\0';
@@ -208,7 +208,7 @@ HRESULT CBStringTable::loadFile(const char *filename, bool clearOld) {
if (value != NULL) {
value[0] = '\0';
value++;
for (int i = 0; i < strlen(value); i++) {
for (uint32 i = 0; i < strlen(value); i++) {
if (value[i] == '|') value[i] = '\n';
}
addString(line, value, clearOld);
+2 -2
View File
@@ -505,8 +505,8 @@ HRESULT CBSurfaceSDL::drawSprite(int x, int y, RECT *rect, float zoomX, float zo
position.top = 0; // TODO: Something is wrong
}
position.setWidth((float)srcRect.width() * zoomX / 100.f);
position.setHeight((float)srcRect.height() * zoomX / 100.f);
position.setWidth((int16)((float)srcRect.width() * zoomX / 100.f));
position.setHeight((int16)((float)srcRect.height() * zoomX / 100.f));
renderer->modTargetRect(&position);
+2 -1
View File
@@ -70,7 +70,8 @@ HRESULT CBTransitionMgr::start(TTransitionType type, bool nonInteractive) {
_preserveInteractive = true;
_origInteractive = Game->_interactive;
Game->_interactive = false;
} else _preserveInteractive;
} /*else _preserveInteractive */;
_type = type;
_state = TRANS_MGR_RUNNING;
+2 -2
View File
@@ -245,7 +245,7 @@ HRESULT CPartEmitter::updateInternal(uint32 currentTime, uint32 timerDelta) {
// we're understaffed
if (numLive < _maxParticles) {
bool needsSort = false;
if (currentTime - _lastGenTime > _genInterval) {
if ((int)(currentTime - _lastGenTime) > _genInterval) {
_lastGenTime = currentTime;
_batchesGenerated++;
@@ -293,7 +293,7 @@ HRESULT CPartEmitter::display(CBRegion *region) {
for (int i = 0; i < _particles.GetSize(); i++) {
if (region != NULL && _useRegion) {
if (!region->pointInRegion(_particles[i]->_pos.x, _particles[i]->_pos.y)) continue;
if (!region->pointInRegion((int)_particles[i]->_pos.x, (int)_particles[i]->_pos.y)) continue;
}
_particles[i]->display(this);
+6 -6
View File
@@ -98,23 +98,23 @@ HRESULT CPartParticle::setSprite(const char *filename) {
//////////////////////////////////////////////////////////////////////////
HRESULT CPartParticle::update(CPartEmitter *emitter, uint32 currentTime, uint32 timerDelta) {
if (_state == PARTICLE_FADEIN) {
if (currentTime - _fadeStart >= _fadeTime) {
if (currentTime - _fadeStart >= (uint32)_fadeTime) {
_state = PARTICLE_NORMAL;
_currentAlpha = _alpha1;
} else _currentAlpha = ((float)currentTime - (float)_fadeStart) / (float)_fadeTime * _alpha1;
} else _currentAlpha = (int)(((float)currentTime - (float)_fadeStart) / (float)_fadeTime * _alpha1);
return S_OK;
} else if (_state == PARTICLE_FADEOUT) {
if (currentTime - _fadeStart >= _fadeTime) {
if (currentTime - _fadeStart >= (uint32)_fadeTime) {
_isDead = true;
return S_OK;
} else _currentAlpha = _fadeStartAlpha - ((float)currentTime - (float)_fadeStart) / (float)_fadeTime * _fadeStartAlpha;
} else _currentAlpha = _fadeStartAlpha - (int)(((float)currentTime - (float)_fadeStart) / (float)_fadeTime * _fadeStartAlpha);
return S_OK;
} else {
// time is up
if (_lifeTime > 0) {
if (currentTime - _creationTime >= _lifeTime) {
if (currentTime - _creationTime >= (uint32)_lifeTime) {
if (emitter->_fadeOutTime > 0)
fadeOut(currentTime, emitter->_fadeOutTime);
else
@@ -137,7 +137,7 @@ HRESULT CPartParticle::update(CPartEmitter *emitter, uint32 currentTime, uint32
int age = (int)(currentTime - _creationTime);
int alphaDelta = (int)(_alpha2 - _alpha1);
_currentAlpha = _alpha1 + ((float)alphaDelta / (float)_lifeTime * (float)age);
_currentAlpha = _alpha1 + (int)(((float)alphaDelta / (float)_lifeTime * (float)age));
}
// update position
@@ -58,7 +58,7 @@ HRESULT CBSaveThumbFile::open(const Common::String &filename) {
char *tempFilename = new char[strlen(filename.c_str()) - 8];
strcpy(tempFilename, filename.c_str() + 9);
for (int i = 0; i < strlen(tempFilename); i++) {
for (uint32 i = 0; i < strlen(tempFilename); i++) {
if (tempFilename[i] < '0' || tempFilename[i] > '9') {
tempFilename[i] = '\0';
break;
@@ -211,17 +211,17 @@ HRESULT CSXArray::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
bool CSXArray::validNumber(const char *origStr, char *outStr) {
bool IsNumber = true;
for (int i = 0; i < strlen(origStr); i++) {
bool isNumber = true;
for (uint32 i = 0; i < strlen(origStr); i++) {
if (!(origStr[i] >= '0' && origStr[i] <= '9')) {
IsNumber = false;
isNumber = false;
break;
}
}
if (IsNumber) {
int Index = atoi(origStr);
sprintf(outStr, "%d", Index);
if (isNumber) {
int index = atoi(origStr);
sprintf(outStr, "%d", index);
return true;
} else return false;
}
@@ -271,7 +271,7 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
byte b;
HRESULT ret = E_FAIL;
while (counter < textLen) {
while (counter < (uint32)textLen) {
ret = _readFile->read(&b, 1);
if (ret != 1) break;
@@ -139,8 +139,8 @@ HRESULT CSXStore::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
else if (strcmp(name, "GetInvalidProduct") == 0) {
stack->correctParams(1);
int index = stack->pop()->getInt();
if (index >= 0 && index < _invalidProducts.size())
stack->pushString(_invalidProducts[index].c_str());
if (index >= 0 && (uint32)index < _invalidProducts.size())
stack->pushString(_invalidProducts[(uint32)index].c_str());
else
stack->pushNULL();
@@ -262,7 +262,7 @@ CScValue *CSXStore::scGetProperty(const char *name) {
// NumInvalidProducts (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "NumInvalidProducts") == 0) {
_scValue->setInt(_invalidProducts.size());
_scValue->setInt((int)_invalidProducts.size());
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
@@ -357,8 +357,8 @@ HRESULT CSXString::scSetProperty(const char *name, CScValue *value) {
// Capacity
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Capacity") == 0) {
int newCap = value->getInt();
if (newCap < strlen(_string) + 1) Game->LOG(0, "Warning: cannot lower string capacity");
int32 newCap = (uint32)value->getInt();
if (newCap < (int32)(strlen(_string) + 1)) Game->LOG(0, "Warning: cannot lower string capacity");
else if (newCap != _capacity) {
char *newStr = new char[newCap];
if (newStr) {
@@ -289,9 +289,8 @@ byte *CScEngine::getCompiledScript(const char *filename, uint32 *outSize, bool i
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::tick() {
if (_scripts.GetSize() == 0) return S_OK;
if (_scripts.GetSize() == 0)
return S_OK;
// resolve waiting scripts
@@ -369,15 +368,15 @@ HRESULT CScEngine::tick() {
// normal script
else {
uint32 StartTime = 0;
uint32 startTime = 0;
bool isProfiling = _isProfiling;
if (isProfiling) StartTime = CBPlatform::getTime();
if (isProfiling) startTime = CBPlatform::getTime();
while (_scripts[i]->_state == SCRIPT_RUNNING) {
_currentScript = _scripts[i];
_scripts[i]->executeInstruction();
}
if (isProfiling && _scripts[i]->_filename) addScriptTime(_scripts[i]->_filename, CBPlatform::getTime() - StartTime);
if (isProfiling && _scripts[i]->_filename) addScriptTime(_scripts[i]->_filename, CBPlatform::getTime() - startTime);
}
_currentScript = NULL;
}
@@ -151,7 +151,7 @@ public:
void enableProfiling();
void disableProfiling();
bool isProfiling() {
bool getIsProfiling() {
return _isProfiling;
}
@@ -400,7 +400,7 @@ void CScScript::cleanup() {
if (_externals) {
for (int i = 0; i < _numExternals; i++) {
for (uint32 i = 0; i < _numExternals; i++) {
if (_externals[i].nu_params > 0) delete [] _externals[i].params;
}
delete [] _externals;
@@ -431,7 +431,7 @@ void CScScript::cleanup() {
//////////////////////////////////////////////////////////////////////////
uint32 CScScript::getDWORD() {
_scriptStream->seek(_iP);
_scriptStream->seek((int32)_iP);
uint32 ret = _scriptStream->readUint32LE();
_iP += sizeof(uint32);
// assert(oldRet == ret);
@@ -1060,7 +1060,7 @@ HRESULT CScScript::executeInstruction() {
//////////////////////////////////////////////////////////////////////////
uint32 CScScript::getFuncPos(const char *name) {
for (int i = 0; i < _numFunctions; i++) {
for (uint32 i = 0; i < _numFunctions; i++) {
if (strcmp(name, _functions[i].name) == 0)
return _functions[i].pos;
}
@@ -1070,7 +1070,7 @@ uint32 CScScript::getFuncPos(const char *name) {
//////////////////////////////////////////////////////////////////////////
uint32 CScScript::getMethodPos(const char *name) {
for (int i = 0; i < _numMethods; i++) {
for (uint32 i = 0; i < _numMethods; i++) {
if (strcmp(name, _methods[i].name) == 0)
return _methods[i].pos;
}
@@ -1328,7 +1328,7 @@ HRESULT CScScript::resume() {
//////////////////////////////////////////////////////////////////////////
CScScript::TExternalFunction *CScScript::getExternal(char *name) {
for (int i = 0; i < _numExternals; i++) {
for (uint32 i = 0; i < _numExternals; i++) {
if (strcmp(name, _externals[i].name) == 0)
return &_externals[i];
}
@@ -153,11 +153,11 @@ public:
virtual ~CScScript();
char *_filename;
char **_symbols;
int _numSymbols;
uint32 _numSymbols;
TFunctionPos *_functions;
TMethodPos *_methods;
TEventPos *_events;
int _numExternals;
uint32 _numExternals;
TExternalFunction *_externals;
uint32 _numFunctions;
uint32 _numMethods;
@@ -111,7 +111,7 @@ CScValue *CScStack::getAt(int index) {
//////////////////////////////////////////////////////////////////////////
void CScStack::correctParams(uint32 expectedParams) {
int nuParams = pop()->getInt();
uint32 nuParams = (uint32)pop()->getInt();
if (expectedParams < nuParams) { // too many params
while (expectedParams < nuParams) {
+2 -2
View File
@@ -244,7 +244,7 @@ HRESULT CSysClassRegistry::saveInstances(CBGame *Game, CBPersistMgr *persistMgr,
if (!quickSave) {
if (counter % 20 == 0) {
Game->_indicatorProgress = 50 + 50.0f / (float)((float)_classes.size() / (float)counter);
Game->_indicatorProgress = (int)(50.0f + 50.0f / (float)((float)_classes.size() / (float)counter));
Game->displayContent(false);
Game->_renderer->flip();
}
@@ -264,7 +264,7 @@ HRESULT CSysClassRegistry::loadInstances(CBGame *Game, CBPersistMgr *persistMgr)
for (int i = 0; i < numInstances; i++) {
if (i % 20 == 0) {
Game->_indicatorProgress = 50 + 50.0f / (float)((float)numInstances / (float)i);
Game->_indicatorProgress = (int)(50.0f + 50.0f / (float)((float)numInstances / (float)i));
Game->displayContentSimple();
Game->_renderer->flip();
}
+2 -2
View File
@@ -238,9 +238,9 @@ HRESULT CUIObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
}
// find by name
else {
const char *name = val->getString();
const char *findName = val->getString();
for (i = 0; i < win->_widgets.GetSize(); i++) {
if (scumm_stricmp(win->_widgets[i]->_name, name) == 0) {
if (scumm_stricmp(win->_widgets[i]->_name, findName) == 0) {
found = true;
break;
}
+1 -1
View File
@@ -269,7 +269,7 @@ int WinterMuteEngine::messageLoop() {
uint32 diff = 0;
const uint32 maxFPS = 25;
const uint32 frameTime = (1.0/maxFPS) * 1000;
const uint32 frameTime = (uint32)((1.0/maxFPS) * 1000);
while (!done) {
Common::Event event;
while (_system->getEventManager()->pollEvent(event)) {