SLUDGE: Fix MSVC warnings

- Fix invalid check with empty()
- Change float suffixes to uppercase
- Fix potentially uninitialized variables
This commit is contained in:
Filippos Karapetis 2019-05-27 14:45:13 +03:00
parent 174721e911
commit f4e8eed13d
4 changed files with 7 additions and 7 deletions

View file

@ -175,7 +175,7 @@ bool TextManager::loadFont(int filenum, const Common::String &charOrder, int h)
// load & save
void TextManager::saveFont(Common::WriteStream *stream) {
stream->writeByte(!_fontTable.empty());
if (!_fontTable.empty() > 0) {
if (!_fontTable.empty()) {
stream->writeUint16BE(_loadedFontNum);
stream->writeUint16BE(_fontHeight);
writeString(_fontOrder.getUTF8String(), stream);

View file

@ -38,7 +38,7 @@ MovieStates movieIsPlaying = nothing;
int movieIsEnding = 0;
float movieAspect = 1.6;
float movieAspect = 1.6F;
#if 0
typedef struct audioBuffers {
char *buffer;

View file

@ -66,7 +66,7 @@ PersonaAnimation::PersonaAnimation(int num, VariableStack *&stacky) {
theSprites = nullptr;
numFrames = num;
frames = new AnimFrame[num];
int a = num, frameNum, howMany;
int a = num, frameNum = 0, howMany = 0;
while (a) {
a--;

View file

@ -384,11 +384,11 @@ Graphics::Surface *GraphicsManager::applyLightmapToSprite(Graphics::Surface *&bl
// calculate light map color
float fr, fg, fb;
fr = fg = fb = 0.f;
fr = fg = fb = 0.0F;
if (thisPerson->colourmix) {
fr = curLight[0]*thisPerson->r * thisPerson->colourmix / 65025 / 255.f;
fg = curLight[1]*thisPerson->g * thisPerson->colourmix / 65025 / 255.f;
fb = curLight[2]*thisPerson->b * thisPerson->colourmix / 65025 / 255.f;
fr = curLight[0]*thisPerson->r * thisPerson->colourmix / 65025 / 255.0F;
fg = curLight[1]*thisPerson->g * thisPerson->colourmix / 65025 / 255.0F;
fb = curLight[2]*thisPerson->b * thisPerson->colourmix / 65025 / 255.0F;
}
uint32 primaryColor = TS_ARGB((uint8)(255 - thisPerson->transparency),