Fix a debug method

Change-Id: Icf78fb0d5f7caea78f053fffd1ecd4289629964a
main
Jean Chalard 2012-08-17 09:24:45 +09:00
parent 4bf2c07034
commit cc1062cfd0
2 changed files with 3 additions and 3 deletions

View File

@ -162,7 +162,7 @@ public class BinaryDictionary extends Dictionary {
if (composerSize > 0 && mOutputScores[j] < 1) break; if (composerSize > 0 && mOutputScores[j] < 1) break;
final int start = j * MAX_WORD_LENGTH; final int start = j * MAX_WORD_LENGTH;
int len = 0; int len = 0;
while (len < MAX_WORD_LENGTH && mOutputChars[start + len] != 0) { while (len < MAX_WORD_LENGTH && mOutputChars[start + len] != 0) {
++len; ++len;
} }
if (len > 0) { if (len > 0) {

View File

@ -22,7 +22,7 @@
static inline unsigned char *convertToUnibyteString(unsigned short *input, unsigned char *output, static inline unsigned char *convertToUnibyteString(unsigned short *input, unsigned char *output,
const unsigned int length) { const unsigned int length) {
unsigned int i = 0; unsigned int i = 0;
for (; i <= length && input[i] != 0; ++i) for (; i < length && input[i] != 0; ++i)
output[i] = input[i] & 0xFF; output[i] = input[i] & 0xFF;
output[i] = 0; output[i] = 0;
return output; return output;
@ -31,7 +31,7 @@ static inline unsigned char *convertToUnibyteString(unsigned short *input, unsig
static inline unsigned char *convertToUnibyteStringAndReplaceLastChar(unsigned short *input, static inline unsigned char *convertToUnibyteStringAndReplaceLastChar(unsigned short *input,
unsigned char *output, const unsigned int length, unsigned char c) { unsigned char *output, const unsigned int length, unsigned char c) {
unsigned int i = 0; unsigned int i = 0;
for (; i <= length && input[i] != 0; ++i) for (; i < length && input[i] != 0; ++i)
output[i] = input[i] & 0xFF; output[i] = input[i] & 0xFF;
if (i > 0) output[i-1] = c; if (i > 0) output[i-1] = c;
output[i] = 0; output[i] = 0;