Fixed some warnings. Patch by Torbjorn Andersson.

This commit is contained in:
Giulio Camuffo 2011-04-05 21:45:20 +02:00
parent e6421b17f6
commit 66bba94bcf
3 changed files with 10 additions and 6 deletions

View file

@ -57,13 +57,17 @@ LipSync::LipSync(const char *filename, const char *data, int len) :
readPhoneme = READ_LE_UINT16(data + 2); readPhoneme = READ_LE_UINT16(data + 2);
// Look for the animation corresponding to the phoneme // Look for the animation corresponding to the phoneme
for (j = 0; (j < _animTableSize) && (readPhoneme != _animTable[j].phoneme); j++) { ; } for (j = 0; j < _animTableSize; j++) {
if (readPhoneme == _animTable[j].phoneme) {
_entries[i].anim = _animTable[j].anim;
break;
}
}
if (readPhoneme != _animTable[j].phoneme) { if (j >= _animTableSize) {
warning("Unknown phoneme: 0x%X in file %s", readPhoneme, filename); warning("Unknown phoneme: 0x%X in file %s", readPhoneme, filename);
_entries[i].anim = 1; _entries[i].anim = 1;
} else }
_entries[i].anim = _animTable[j].anim;
data += 4; data += 4;
} }

View file

@ -66,7 +66,7 @@ void TextObject::setText(const char *text) {
// this should be good enough to still be unique // this should be good enough to still be unique
// but for debug purposes lets make this crash the program so we know about it // but for debug purposes lets make this crash the program so we know about it
strncpy(_textID, text, sizeof(_textID)); strncpy(_textID, text, sizeof(_textID));
_textID[sizeof(_textID)] = 0; _textID[sizeof(_textID) - 1] = 0;
} }
} }

View file

@ -406,7 +406,7 @@ void tglLightModeli(int pname, int param) {
p[0].op = TinyGL::OP_LightModel; p[0].op = TinyGL::OP_LightModel;
p[1].i = pname; p[1].i = pname;
p[2].f = (float)param; p[2].f = (float)param;
for (i = 0; i < 4; i++) for (i = 0; i < 3; i++)
p[3 + i].f = 0; p[3 + i].f = 0;
TinyGL::gl_add_op(p); TinyGL::gl_add_op(p);