[Scummvm-cvs-logs] CVS: scummvm/sound voc.cpp,1.7,1.8
Max Horn
fingolfin at users.sourceforge.net
Sat Dec 27 21:19:06 CET 2003
Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1:/tmp/cvs-serv27047
Modified Files:
voc.cpp
Log Message:
cleanup
Index: voc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/voc.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- voc.cpp 27 Dec 2003 18:29:21 -0000 1.7
+++ voc.cpp 27 Dec 2003 21:31:49 -0000 1.8
@@ -28,14 +28,14 @@
byte *readVOCFromMemory(byte *ptr, int &size, int &rate, int &loops) {
- assert(strncmp((char *)ptr, "Creative Voice File\x1A", 20) == 0);
+ assert(memcmp(ptr, "Creative Voice File\x1A", 20) == 0);
int32 offset = READ_LE_UINT16(ptr + 20);
int16 version = READ_LE_UINT16(ptr + 22);
int16 code = READ_LE_UINT16(ptr + 24);
assert(version == 0x010A || version == 0x0114);
assert(code == ~version + 0x1234);
- bool quit = 0;
+ bool quit = false;
byte *ret_sound = 0;
size = 0;
@@ -45,7 +45,8 @@
code = len & 0xFF;
len >>= 8;
switch(code) {
- case 0: quit = 1;
+ case 0:
+ quit = true;
break;
case 1: {
int time_constant = ptr[offset++];
@@ -73,7 +74,7 @@
break;
default:
warning("Invalid code in VOC file : %d", code);
- quit = 1;
+ quit = true;
break;
}
// FIXME some FT samples (ex. 362) has bad length, 2 bytes too short
@@ -84,8 +85,7 @@
}
enum {
- SOUND_HEADER_SIZE = 26,
- SOUND_HEADER_BIG_SIZE = 26 + 8
+ SOUND_HEADER_SIZE = 26
};
// FIXME/TODO: loadVOCFile() essentially duplicates all the code from
@@ -99,7 +99,7 @@
goto invalid;
if (!memcmp(ident, "VTLK", 4)) {
- file->seek(SOUND_HEADER_BIG_SIZE - 8, SEEK_CUR);
+ file->seek(SOUND_HEADER_SIZE, SEEK_CUR);
} else if (!memcmp(ident, "Creative", 8)) {
file->seek(SOUND_HEADER_SIZE - 8, SEEK_CUR);
} else {
More information about the Scummvm-git-logs
mailing list