WINTERMUTE: Get rid of almost all LLVM GCC 4.2 warnings.
This commit is contained in:
parent
6262a2ac87
commit
f6ac34ab9a
15 changed files with 32 additions and 24 deletions
|
@ -128,7 +128,7 @@ void AdNodeState::setCaption(const char *caption, int caseVal) {
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
char *AdNodeState::getCaption(int caseVal) {
|
const char *AdNodeState::getCaption(int caseVal) {
|
||||||
if (caseVal == 0) {
|
if (caseVal == 0) {
|
||||||
caseVal = 1;
|
caseVal = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ private:
|
||||||
char *_name;
|
char *_name;
|
||||||
char *_caption[7];
|
char *_caption[7];
|
||||||
void setCaption(const char *caption, int caseVal);
|
void setCaption(const char *caption, int caseVal);
|
||||||
char *getCaption(int caseVal);
|
const char *getCaption(int caseVal);
|
||||||
uint32 _alphaColor;
|
uint32 _alphaColor;
|
||||||
char *_filename;
|
char *_filename;
|
||||||
char *_cursor;
|
char *_cursor;
|
||||||
|
|
|
@ -253,8 +253,8 @@ Common::SeekableReadStream *BaseFileManager::openPkgFile(const Common::String &f
|
||||||
strcpy(fileName, upcName.c_str());
|
strcpy(fileName, upcName.c_str());
|
||||||
|
|
||||||
// correct slashes
|
// correct slashes
|
||||||
for (int32 i = 0; i < upcName.size(); i++) {
|
for (uint32 i = 0; i < upcName.size(); i++) {
|
||||||
if (upcName[i] == '/') {
|
if (upcName[(int32)i] == '/') {
|
||||||
upcName.setChar('\\', (uint32)i);
|
upcName.setChar('\\', (uint32)i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -492,7 +492,7 @@ float BasePersistenceManager::getFloat() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BasePersistenceManager::putDouble(double val) {
|
void BasePersistenceManager::putDouble(double val) {
|
||||||
Common::String str = Common::String::format("F%f", val);
|
Common::String str = Common::String::format("D%f", val);
|
||||||
str.format("D%f", val);
|
str.format("D%f", val);
|
||||||
_saveStream->writeUint32LE(str.size());
|
_saveStream->writeUint32LE(str.size());
|
||||||
_saveStream->writeString(str);
|
_saveStream->writeString(str);
|
||||||
|
@ -500,10 +500,10 @@ void BasePersistenceManager::putDouble(double val) {
|
||||||
|
|
||||||
double BasePersistenceManager::getDouble() {
|
double BasePersistenceManager::getDouble() {
|
||||||
char *str = getString();
|
char *str = getString();
|
||||||
double value = 0.0f;
|
float value = 0.0f; // TODO: Do we ever really need to carry a full double-precision number?
|
||||||
int ret = sscanf(str, "F%f", &value);
|
int ret = sscanf(str, "D%f", &value);
|
||||||
if (ret != 1) {
|
if (ret != 1) {
|
||||||
warning("%s not parsed as float", str);
|
warning("%s not parsed as double", str);
|
||||||
}
|
}
|
||||||
delete[] str;
|
delete[] str;
|
||||||
return value;
|
return value;
|
||||||
|
|
|
@ -73,7 +73,7 @@ bool BaseSurfaceStorage::initLoop() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_surfaces[i]->_lifeTime > 0 && _surfaces[i]->_valid && _gameRef->_liveTimer - _surfaces[i]->_lastUsedTime >= _surfaces[i]->_lifeTime) {
|
if (_surfaces[i]->_lifeTime > 0 && (int)(_surfaces[i]->_valid && _gameRef->_liveTimer - _surfaces[i]->_lastUsedTime) >= _surfaces[i]->_lifeTime) {
|
||||||
//_gameRef->QuickMessageForm("Invalidating: %s", _surfaces[i]->_filename);
|
//_gameRef->QuickMessageForm("Invalidating: %s", _surfaces[i]->_filename);
|
||||||
_surfaces[i]->invalidate();
|
_surfaces[i]->invalidate();
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,7 +174,7 @@ int BaseFontBitmap::textHeightDraw(byte *text, int x, int y, int width, TTextAli
|
||||||
longLine = true;
|
longLine = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (str.size() == (index + 1) || (maxLength >= 0 && index == maxLength - 1)) {
|
if ((int)str.size() == (index + 1) || (maxLength >= 0 && index == maxLength - 1)) {
|
||||||
done = true;
|
done = true;
|
||||||
if (!newLine) {
|
if (!newLine) {
|
||||||
end = index;
|
end = index;
|
||||||
|
|
|
@ -111,7 +111,7 @@ BaseObject *BaseRenderer::getObjectAt(int x, int y) {
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void BaseRenderer::deleteRectList() {
|
void BaseRenderer::deleteRectList() {
|
||||||
for (int i = 0; i < _rectList.size(); i++) {
|
for (uint32 i = 0; i < _rectList.size(); i++) {
|
||||||
delete _rectList[i];
|
delete _rectList[i];
|
||||||
}
|
}
|
||||||
_rectList.clear();
|
_rectList.clear();
|
||||||
|
|
|
@ -199,7 +199,7 @@ bool PartParticle::display(PartEmitter *emitter) {
|
||||||
}
|
}
|
||||||
|
|
||||||
_sprite->getCurrentFrame();
|
_sprite->getCurrentFrame();
|
||||||
return _sprite->display(_pos.x, _pos.y,
|
return _sprite->display((int)_pos.x, (int)_pos.y,
|
||||||
NULL,
|
NULL,
|
||||||
_scale, _scale,
|
_scale, _scale,
|
||||||
BYTETORGBA(255, 255, 255, _currentAlpha),
|
BYTETORGBA(255, 255, 255, _currentAlpha),
|
||||||
|
|
|
@ -211,8 +211,8 @@ bool SXFile::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
else if (strcmp(name, "Copy") == 0) {
|
else if (strcmp(name, "Copy") == 0) {
|
||||||
stack->correctParams(2);
|
stack->correctParams(2);
|
||||||
const char *dest = stack->pop()->getString();
|
/* const char *dest = */ stack->pop()->getString();
|
||||||
bool overwrite = stack->pop()->getBool(true);
|
/* bool overwrite = */ stack->pop()->getBool(true);
|
||||||
|
|
||||||
close();
|
close();
|
||||||
error("SXFile-Method: Copy not supported");
|
error("SXFile-Method: Copy not supported");
|
||||||
|
@ -601,7 +601,7 @@ bool SXFile::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
|
||||||
else if (strcmp(name, "WriteDouble") == 0) {
|
else if (strcmp(name, "WriteDouble") == 0) {
|
||||||
error("SXFile::WriteDouble - Not endian safe yet");
|
error("SXFile::WriteDouble - Not endian safe yet");
|
||||||
stack->correctParams(1);
|
stack->correctParams(1);
|
||||||
double val = stack->pop()->getFloat();
|
/* double val = */ stack->pop()->getFloat();
|
||||||
|
|
||||||
if (_textMode || !_writeFile) {
|
if (_textMode || !_writeFile) {
|
||||||
script->runtimeError("File.%s: File must be open for writing in binary mode.", name);
|
script->runtimeError("File.%s: File must be open for writing in binary mode.", name);
|
||||||
|
|
|
@ -268,7 +268,8 @@ bool BaseSound::setPrivateVolume(int volume) {
|
||||||
if (!_sound) {
|
if (!_sound) {
|
||||||
return STATUS_FAILED;
|
return STATUS_FAILED;
|
||||||
} else {
|
} else {
|
||||||
return _sound->_privateVolume = volume;
|
_sound->_privateVolume = volume;
|
||||||
|
return STATUS_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,9 +116,9 @@ public:
|
||||||
if (allFiles.contains("data.dcp")) {
|
if (allFiles.contains("data.dcp")) {
|
||||||
Common::String name, caption;
|
Common::String name, caption;
|
||||||
if (WinterMuteEngine::getGameInfo(fslist, name, caption)) {
|
if (WinterMuteEngine::getGameInfo(fslist, name, caption)) {
|
||||||
for (int32 i = 0; i < name.size(); i++) {
|
for (uint32 i = 0; i < name.size(); i++) {
|
||||||
// Replace spaces (and other non-alphanumerics) with underscores
|
// Replace spaces (and other non-alphanumerics) with underscores
|
||||||
if (!Common::isAlnum(name[i])) {
|
if (!Common::isAlnum(name[(int32)i])) {
|
||||||
name.setChar('_', (uint32)i);
|
name.setChar('_', (uint32)i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@ void UIObject::setText(const char *text) {
|
||||||
_text = new char [strlen(text) + 1];
|
_text = new char [strlen(text) + 1];
|
||||||
if (_text) {
|
if (_text) {
|
||||||
strcpy(_text, text);
|
strcpy(_text, text);
|
||||||
for (int i = 0; i < strlen(_text); i++) {
|
for (uint32 i = 0; i < strlen(_text); i++) {
|
||||||
if (_text[i] == '|') {
|
if (_text[i] == '|') {
|
||||||
_text[i] = '\n';
|
_text[i] = '\n';
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
#include "engines/wintermute/utils/crc.h"
|
#include "engines/wintermute/utils/crc.h"
|
||||||
|
|
||||||
|
namespace WinterMute {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Derive parameters from the standard-specific parameters in crc.h.
|
* Derive parameters from the standard-specific parameters in crc.h.
|
||||||
|
@ -232,3 +233,5 @@ crc crc_process_byte(unsigned char byteVal, crc remainder) {
|
||||||
crc crc_finalize(crc remainder) {
|
crc crc_finalize(crc remainder) {
|
||||||
return (REFLECT_REMAINDER(remainder) ^ FINAL_XOR_VALUE);
|
return (REFLECT_REMAINDER(remainder) ^ FINAL_XOR_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // end of namespace WinterMute
|
||||||
|
|
|
@ -16,6 +16,10 @@
|
||||||
#ifndef _crc_h
|
#ifndef _crc_h
|
||||||
#define _crc_h
|
#define _crc_h
|
||||||
|
|
||||||
|
#include "common/system.h" // For types.
|
||||||
|
|
||||||
|
namespace WinterMute {
|
||||||
|
|
||||||
#ifndef TRUE
|
#ifndef TRUE
|
||||||
#define FALSE 0
|
#define FALSE 0
|
||||||
#define TRUE !FALSE
|
#define TRUE !FALSE
|
||||||
|
@ -26,10 +30,9 @@
|
||||||
*/
|
*/
|
||||||
#define CRC32
|
#define CRC32
|
||||||
|
|
||||||
|
|
||||||
#if defined(CRC_CCITT)
|
#if defined(CRC_CCITT)
|
||||||
|
|
||||||
typedef unsigned short crc;
|
typedef uint16 crc;
|
||||||
|
|
||||||
#define CRC_NAME "CRC-CCITT"
|
#define CRC_NAME "CRC-CCITT"
|
||||||
#define POLYNOMIAL 0x1021
|
#define POLYNOMIAL 0x1021
|
||||||
|
@ -41,7 +44,7 @@ typedef unsigned short crc;
|
||||||
|
|
||||||
#elif defined(CRC16)
|
#elif defined(CRC16)
|
||||||
|
|
||||||
typedef unsigned short crc;
|
typedef uint16 crc;
|
||||||
|
|
||||||
#define CRC_NAME "CRC-16"
|
#define CRC_NAME "CRC-16"
|
||||||
#define POLYNOMIAL 0x8005
|
#define POLYNOMIAL 0x8005
|
||||||
|
@ -53,7 +56,7 @@ typedef unsigned short crc;
|
||||||
|
|
||||||
#elif defined(CRC32)
|
#elif defined(CRC32)
|
||||||
|
|
||||||
typedef unsigned long crc;
|
typedef uint32 crc;
|
||||||
|
|
||||||
#define CRC_NAME "CRC-32"
|
#define CRC_NAME "CRC-32"
|
||||||
#define POLYNOMIAL 0x04C11DB7
|
#define POLYNOMIAL 0x04C11DB7
|
||||||
|
@ -77,5 +80,6 @@ extern "C" crc crc_initialize(void);
|
||||||
extern "C" crc crc_process_byte(unsigned char byteVal, crc remainder);
|
extern "C" crc crc_process_byte(unsigned char byteVal, crc remainder);
|
||||||
extern "C" crc crc_finalize(crc remainder);
|
extern "C" crc crc_finalize(crc remainder);
|
||||||
|
|
||||||
|
} // End of namespace WinterMute
|
||||||
|
|
||||||
#endif /* _crc_h */
|
#endif /* _crc_h */
|
||||||
|
|
|
@ -97,7 +97,7 @@ AnsiString PathUtil::getFileNameWithoutExtension(const AnsiString &path) {
|
||||||
//size_t pos = fileName.find_last_of('.'); //TODO REMOVE!
|
//size_t pos = fileName.find_last_of('.'); //TODO REMOVE!
|
||||||
// TODO: Prettify this.
|
// TODO: Prettify this.
|
||||||
AnsiString extension = Common::lastPathComponent(fileName, '.');
|
AnsiString extension = Common::lastPathComponent(fileName, '.');
|
||||||
for (int i = 0; i < extension.size() + 1; i++) {
|
for (uint32 i = 0; i < extension.size() + 1; i++) {
|
||||||
fileName.deleteLastChar();
|
fileName.deleteLastChar();
|
||||||
}
|
}
|
||||||
// Common::String filename = Common::String(fileName.c_str(), fileName.size() - extension.size() + 1);
|
// Common::String filename = Common::String(fileName.c_str(), fileName.size() - extension.size() + 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue