aboutsummaryrefslogtreecommitdiffstats
path: root/native/src
diff options
context:
space:
mode:
Diffstat (limited to 'native/src')
-rw-r--r--native/src/correction.cpp2
-rw-r--r--native/src/proximity_info.cpp2
-rw-r--r--native/src/proximity_info.h2
-rw-r--r--native/src/unigram_dictionary.cpp6
-rw-r--r--native/src/unigram_dictionary.h4
5 files changed, 3 insertions, 13 deletions
diff --git a/native/src/correction.cpp b/native/src/correction.cpp
index 0c566802c..f6b7eb6ad 100644
--- a/native/src/correction.cpp
+++ b/native/src/correction.cpp
@@ -87,7 +87,7 @@ inline static void calcEditDistanceOneStep(int *editDistanceTable, const unsigne
int *const current = editDistanceTable + outputLength * (inputLength + 1);
const int *const prev = editDistanceTable + (outputLength - 1) * (inputLength + 1);
const int *const prevprev =
- outputLength >= 2 ? editDistanceTable + (outputLength - 2) * (inputLength + 1) : NULL;
+ outputLength >= 2 ? editDistanceTable + (outputLength - 2) * (inputLength + 1) : 0;
current[0] = outputLength;
const uint32_t co = Dictionary::toBaseLowerCase(output[outputLength - 1]);
const uint32_t prevCO =
diff --git a/native/src/proximity_info.cpp b/native/src/proximity_info.cpp
index 20fa18a44..2f989e355 100644
--- a/native/src/proximity_info.cpp
+++ b/native/src/proximity_info.cpp
@@ -47,7 +47,7 @@ ProximityInfo::ProximityInfo(const int maxProximityCharsSize, const int keyboard
HAS_TOUCH_POSITION_CORRECTION_DATA(keyCount > 0 && keyXCoordinates && keyYCoordinates
&& keyWidths && keyHeights && keyCharCodes && sweetSpotCenterXs
&& sweetSpotCenterYs && sweetSpotRadii),
- mInputXCoordinates(NULL), mInputYCoordinates(NULL),
+ mInputXCoordinates(0), mInputYCoordinates(0),
mTouchPositionCorrectionEnabled(false) {
const int len = GRID_WIDTH * GRID_HEIGHT * MAX_PROXIMITY_CHARS_SIZE;
mProximityCharsArray = new uint32_t[len];
diff --git a/native/src/proximity_info.h b/native/src/proximity_info.h
index 35e354c6e..832db1062 100644
--- a/native/src/proximity_info.h
+++ b/native/src/proximity_info.h
@@ -56,7 +56,7 @@ public:
bool existsCharInProximityAt(const int index, const int c) const;
bool existsAdjacentProximityChars(const int index) const;
ProximityType getMatchedProximityId(const int index, const unsigned short c,
- const bool checkProximityChars, int *proximityIndex = NULL) const;
+ const bool checkProximityChars, int *proximityIndex = 0) const;
int getNormalizedSquaredDistance(const int inputIndex, const int proximityIndex) const {
return mNormalizedSquaredDistances[inputIndex * MAX_PROXIMITY_CHARS_SIZE + proximityIndex];
}
diff --git a/native/src/unigram_dictionary.cpp b/native/src/unigram_dictionary.cpp
index 8eb5a9700..7ff2f4a2f 100644
--- a/native/src/unigram_dictionary.cpp
+++ b/native/src/unigram_dictionary.cpp
@@ -253,12 +253,6 @@ void UnigramDictionary::initSuggestions(ProximityInfo *proximityInfo, const int
mProximityInfo = proximityInfo;
}
-static inline void registerNextLetter(unsigned short c, int *nextLetters, int nextLettersSize) {
- if (c < nextLettersSize) {
- nextLetters[c]++;
- }
-}
-
// TODO: We need to optimize addWord by using STL or something
// TODO: This needs to take an const unsigned short* and not tinker with its contents
bool UnigramDictionary::addWord(unsigned short *word, int length, int frequency) {
diff --git a/native/src/unigram_dictionary.h b/native/src/unigram_dictionary.h
index ef9709a89..4f4fef267 100644
--- a/native/src/unigram_dictionary.h
+++ b/native/src/unigram_dictionary.h
@@ -23,10 +23,6 @@
#include "defines.h"
#include "proximity_info.h"
-#ifndef NULL
-#define NULL 0
-#endif
-
namespace latinime {
class UnigramDictionary {