diff options
Diffstat (limited to 'native/jni/src/words_priority_queue.h')
-rw-r--r-- | native/jni/src/words_priority_queue.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/native/jni/src/words_priority_queue.h b/native/jni/src/words_priority_queue.h index 8a6da1c95..e97e16a12 100644 --- a/native/jni/src/words_priority_queue.h +++ b/native/jni/src/words_priority_queue.h @@ -129,7 +129,7 @@ class WordsPriorityQueue { } } if (maxIndex > 0 && nsMaxSw) { - memmove(&swBuffer[1], &swBuffer[0], maxIndex * sizeof(SuggestedWord*)); + memmove(&swBuffer[1], &swBuffer[0], maxIndex * sizeof(SuggestedWord *)); swBuffer[0] = nsMaxSw; } } @@ -140,12 +140,13 @@ class WordsPriorityQueue { continue; } const unsigned int wordLength = sw->mWordLength; - char *targetAdr = (char*) outputChars + i * MAX_WORD_LENGTH * sizeof(short); + char *targetAddress = reinterpret_cast<char *>(outputChars) + + i * MAX_WORD_LENGTH * sizeof(short); frequencies[i] = sw->mScore; outputTypes[i] = sw->mType; - memcpy(targetAdr, sw->mWord, (wordLength) * sizeof(short)); + memcpy(targetAddress, sw->mWord, (wordLength) * sizeof(short)); if (wordLength < MAX_WORD_LENGTH) { - ((unsigned short*) targetAdr)[wordLength] = 0; + reinterpret_cast<unsigned short *>(targetAddress)[wordLength] = 0; } sw->mUsed = false; } |