summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-11-18 22:01:31 +0000
committerJens Arnold <amiconn@rockbox.org>2007-11-18 22:01:31 +0000
commitc46de8ab734fa3a848056a7b69806859c4b582df (patch)
tree41df70419bbd9842c5019d284282a069ec38714e /tools
parent34e7fdbf37efbd24be11db9e53a99c738d96f755 (diff)
downloadrockbox-c46de8ab734fa3a848056a7b69806859c4b582df.tar.gz
rockbox-c46de8ab734fa3a848056a7b69806859c4b582df.tar.bz2
rockbox-c46de8ab734fa3a848056a7b69806859c4b582df.zip
Fix header size mismatch in voicefont.c. Fixes 'yes' clip.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15675 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rw-r--r--tools/voicefont.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/voicefont.c b/tools/voicefont.c
index 6fd443a63f..10f08f385c 100644
--- a/tools/voicefont.c
+++ b/tools/voicefont.c
@@ -25,6 +25,8 @@
#include <stdio.h>
#include <string.h>
+#define HEADER_SIZE 20
+
/* endian conversion macros */
#define SWAP2(x) ((((unsigned)(x)>>8) & 0x00ff) | (((unsigned)(x)<<8) & 0xff00))
#define SWAP4(x) ((((unsigned)(x)>>24) & 0x000000ff) |\
@@ -138,7 +140,7 @@ int main (int argc, char** argv)
printf("Error opening output file %s\n", argv[4]);
return -2;
}
- fseek(pFile, 16 + count*8, SEEK_SET); /* space for header */
+ fseek(pFile, HEADER_SIZE + count*8, SEEK_SET); /* space for header */
for (i=0; i<count; i++)
{
@@ -187,7 +189,7 @@ int main (int argc, char** argv)
fwrite(&value, sizeof(value), 1, pFile);
/* 3rd 32 bit value in the file is the header size (= 1st table position) */
- value = SWAP4(20); /* 20 bytes: for version, target id, header size, number1, number2 */
+ value = SWAP4(HEADER_SIZE); /* version, target id, header size, number1, number2 */
fwrite(&value, sizeof(value), 1, pFile);
/* 4th 32 bit value in the file is the number of clips in 1st table */