aboutsummaryrefslogtreecommitdiffstats
path: root/native/jni/src/words_priority_queue.h
diff options
context:
space:
mode:
authorKen Wakasa <kwakasa@google.com>2012-08-12 19:07:44 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-08-12 19:07:44 -0700
commit7b4531a16f0d7f237822e94f3e962257ee9d0c16 (patch)
tree2237aa0f754e3ab44ccfac034f5ef6e17ffda724 /native/jni/src/words_priority_queue.h
parentf9b2841fb592778ad34b5181e1c0bcbf551e3632 (diff)
parentbcec82de66f52655593dc233346f11468f5077a0 (diff)
downloadlatinime-7b4531a16f0d7f237822e94f3e962257ee9d0c16.tar.gz
latinime-7b4531a16f0d7f237822e94f3e962257ee9d0c16.tar.xz
latinime-7b4531a16f0d7f237822e94f3e962257ee9d0c16.zip
am bcec82de: Clean up constructors
* commit 'bcec82de66f52655593dc233346f11468f5077a0': Clean up constructors
Diffstat (limited to 'native/jni/src/words_priority_queue.h')
-rw-r--r--native/jni/src/words_priority_queue.h9
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;
}