diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-06-03 16:47:16 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-06-03 22:10:44 +0200 |
commit | 4613ffae8a9e2d4281c169078c1d7847536f9f9c (patch) | |
tree | e4ad37b6e446ab505436e72f76e1d8d58e51dc30 | |
parent | d83ef9935cc55fbf5508efa40c35e1dded621157 (diff) |
Remove unnecessary variable and simplify voice-only counting.
Voice-only strings are identified when reading the strings, so there is no
reason to first store that information and then count them later.
Change-Id: Ie6bd2c4bbf5736630e58d06a20739ef527e3cd69
-rw-r--r-- | tools/voicefont.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/tools/voicefont.c b/tools/voicefont.c index 546d0052f4..3b67e97436 100644 --- a/tools/voicefont.c +++ b/tools/voicefont.c @@ -91,15 +91,13 @@ int voicefont(FILE* voicefontids,int targetnum,char* filedir, FILE* output) char mp3filename2[1024]; char* mp3filename; FILE* pMp3File; - int target_id; int do_bitswap_audio = 0; /* We bitswap the voice file only SH based archos players, target IDs - equal to or lower than 8. See the target_id line for each target in - configure */ - target_id = targetnum; - if (target_id <= 8) + equal to or lower than 8. See the "Target id:" line in rockbox-info.txt + or the target_id value in configure. */ + if (targetnum <= 8) do_bitswap_audio = 1; memset(voiceonly, 0, sizeof(voiceonly)); @@ -112,10 +110,13 @@ int voicefont(FILE* voicefontids,int targetnum,char* filedir, FILE* output) fields = sscanf(line, " id: %s", name); if (fields == 1) { - count++; /* next entry started */ - strcpy(names[count-1], name); + strcpy(names[count], name); if (strncmp("VOICE_", name, 6) == 0) /* voice-only id? */ - voiceonly[count-1] = 1; + { + count_voiceonly++; + voiceonly[count] = 1; + } + count++; /* next entry started */ continue; } } @@ -125,9 +126,6 @@ int voicefont(FILE* voicefontids,int targetnum,char* filedir, FILE* output) for (i=0; i<count; i++) { - if (voiceonly[i] == 1) - count_voiceonly++; - pos[i] = ftell(output); sprintf(mp3filename1, "%s%s.mp3", filedir, names[i]); sprintf(mp3filename2, "%s%s.wav.mp3", filedir, names[i]); |