diff options
author | 2012-02-03 21:24:53 +0900 | |
---|---|---|
committer | 2012-02-06 09:41:41 +0900 | |
commit | 09baa36f7d1298e54a291b0d486cf366a3c3257c (patch) | |
tree | afb4a50f61d222f522b8a065d33226f2989cc31d /native/src/words_priority_queue.h | |
parent | 9f491e34ac2c96c3d18f30f9710b1a3ecab173e7 (diff) | |
download | latinime-09baa36f7d1298e54a291b0d486cf366a3c3257c.tar.gz latinime-09baa36f7d1298e54a291b0d486cf366a3c3257c.tar.xz latinime-09baa36f7d1298e54a291b0d486cf366a3c3257c.zip |
Use C++ template for min/max
To be more friendly for off-device regression test.
Change-Id: I7edf4c9de73915aad9c1760ace7df3177ed3c4e9
Diffstat (limited to 'native/src/words_priority_queue.h')
-rw-r--r-- | native/src/words_priority_queue.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/native/src/words_priority_queue.h b/native/src/words_priority_queue.h index e8cd983b1..249962eec 100644 --- a/native/src/words_priority_queue.h +++ b/native/src/words_priority_queue.h @@ -17,6 +17,7 @@ #ifndef LATINIME_WORDS_PRIORITY_QUEUE_H #define LATINIME_WORDS_PRIORITY_QUEUE_H +#include <cstring> // for memcpy() #include <iostream> #include <queue> #include "defines.h" @@ -93,7 +94,8 @@ class WordsPriorityQueue { int outputSuggestions(int *frequencies, unsigned short *outputChars) { mHighestSuggestedWord = 0; - const unsigned int size = min(MAX_WORDS, mSuggestions.size()); + const unsigned int size = min( + MAX_WORDS, static_cast<unsigned int>(mSuggestions.size())); int index = size - 1; while (!mSuggestions.empty() && index >= 0) { SuggestedWord* sw = mSuggestions.top(); |