diff options
author | Max Horn | 2003-12-27 21:31:49 +0000 |
---|---|---|
committer | Max Horn | 2003-12-27 21:31:49 +0000 |
commit | d52280ab016ddf10ee2a88924a952423b5c0fce6 (patch) | |
tree | 43ab196e2be37ace43ef4ed830855440d9acdd85 /sound | |
parent | fabcb25a68fca9ec4444adafc008eccf226069a8 (diff) | |
download | scummvm-rg350-d52280ab016ddf10ee2a88924a952423b5c0fce6.tar.gz scummvm-rg350-d52280ab016ddf10ee2a88924a952423b5c0fce6.tar.bz2 scummvm-rg350-d52280ab016ddf10ee2a88924a952423b5c0fce6.zip |
cleanup
svn-id: r11981
Diffstat (limited to 'sound')
-rw-r--r-- | sound/voc.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sound/voc.cpp b/sound/voc.cpp index 25c15a9a2e..0209432f86 100644 --- a/sound/voc.cpp +++ b/sound/voc.cpp @@ -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 @@ byte *readVOCFromMemory(byte *ptr, int &size, int &rate, int &loops) { 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 @@ byte *readVOCFromMemory(byte *ptr, int &size, int &rate, int &loops) { 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 @@ byte *readVOCFromMemory(byte *ptr, int &size, int &rate, int &loops) { } 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 @@ byte *loadVOCFile(File *file, int &size, int &rate) { 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 { |