diff options
author | 2012-08-14 14:22:27 +0900 | |
---|---|---|
committer | 2012-08-14 18:07:32 +0900 | |
commit | 34710b03e6d890a61c8c570ff9e769493f6955f9 (patch) | |
tree | c044fa93a05f9735579d0d50140c9672ead66287 /native/jni/src | |
parent | d832bec40be958a55a422a5c3a69c2504ef78a4e (diff) | |
download | latinime-34710b03e6d890a61c8c570ff9e769493f6955f9.tar.gz latinime-34710b03e6d890a61c8c570ff9e769493f6955f9.tar.xz latinime-34710b03e6d890a61c8c570ff9e769493f6955f9.zip |
A couple of cleanups. Remove unnecessary casts.
Change-Id: Ice530aa83a9a688da35aec408be2a60242699157
Diffstat (limited to 'native/jni/src')
-rw-r--r-- | native/jni/src/dictionary.h | 12 | ||||
-rw-r--r-- | native/jni/src/words_priority_queue.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/native/jni/src/dictionary.h b/native/jni/src/dictionary.h index 3b55e5de9..fd9e77011 100644 --- a/native/jni/src/dictionary.h +++ b/native/jni/src/dictionary.h @@ -55,11 +55,11 @@ class Dictionary { int getFrequency(const int32_t *word, int length) const; bool isValidBigram(const int32_t *word1, int length1, const int32_t *word2, int length2) const; - void *getDict() const { // required to release dictionary buffer - return reinterpret_cast<void *>(const_cast<unsigned char *>(mDict)); + const uint8_t *getDict() const { // required to release dictionary buffer + return mDict; } - void *getOffsetDict() const { - return reinterpret_cast<void *>(const_cast<unsigned char *>(mOffsetDict)); + const uint8_t *getOffsetDict() const { + return mOffsetDict; } int getDictSize() const { return mDictSize; } int getMmapFd() const { return mMmapFd; } @@ -72,8 +72,8 @@ class Dictionary { private: DISALLOW_IMPLICIT_CONSTRUCTORS(Dictionary); - const unsigned char *mDict; - const unsigned char *mOffsetDict; + const uint8_t *mDict; + const uint8_t *mOffsetDict; // Used only for the mmap version of dictionary loading, but we use these as dummy variables // also for the malloc version. diff --git a/native/jni/src/words_priority_queue.h b/native/jni/src/words_priority_queue.h index e97e16a12..2fad9bb3d 100644 --- a/native/jni/src/words_priority_queue.h +++ b/native/jni/src/words_priority_queue.h @@ -223,7 +223,7 @@ class WordsPriorityQueue { before, beforeLength, word, wordLength, score); } - typedef std::priority_queue<SuggestedWord*, std::vector<SuggestedWord*>, + typedef std::priority_queue<SuggestedWord *, std::vector<SuggestedWord *>, wordComparator> Suggestions; Suggestions mSuggestions; const unsigned int MAX_WORDS; |