SCI: Fixed code bugs from bug #3087872 - "SCI: Code analysis warnings"

svn-id: r53482
This commit is contained in:
Filippos Karapetis 2010-10-15 12:40:24 +00:00
parent 34cc54eaa9
commit 7cdddd5ffb
3 changed files with 4 additions and 3 deletions

View File

@ -351,7 +351,8 @@ reg_t kTextSize(EngineState *s, int argc, reg_t *argv) {
dest[0] = dest[1] = NULL_REG;
if (text.empty() || !dest) { // Empty text
dest[2] = dest[3] = make_reg(0, 0);
if (dest)
dest[2] = dest[3] = make_reg(0, 0);
debugC(2, kDebugLevelStrings, "GetTextSize: Empty string");
return s->r_acc;
}

View File

@ -1312,7 +1312,7 @@ static void AStar(PathfindingState *s) {
}
// Check if we are done
if (vertex_min == s->vertex_end)
if (vertex_min == s->vertex_end || !vertex_min)
break;
// Move vertex from set open to set closed

View File

@ -88,7 +88,7 @@ void GfxFontFromResource::draw(uint16 chr, int16 top, int16 left, byte color, bo
byte *pIn = getCharData(chr);
for (int i = 0; i < charHeight; i++, y++) {
if (greyedOutput)
mask = greyedTop++ % 2 ? 0xAA : 0x55;
mask = ((greyedTop++) % 2) ? 0xAA : 0x55;
for (int done = 0; done < charWidth; done++) {
if ((done & 7) == 0) // fetching next data byte
b = *(pIn++) & mask;