From 0e97148f6d8d2cdf79cfe69b14277e4943a6e014 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Fri, 28 Oct 2011 17:02:09 +0900 Subject: [PATCH] Remove NULL from native/src Change-Id: I5299af7773d28fd12faebbfe644829a401ae5644 --- native/src/correction.cpp | 2 +- native/src/proximity_info.cpp | 2 +- native/src/proximity_info.h | 6 +----- native/src/unigram_dictionary.h | 4 ---- 4 files changed, 3 insertions(+), 11 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 19b84cc11..832db1062 100644 --- a/native/src/proximity_info.h +++ b/native/src/proximity_info.h @@ -21,10 +21,6 @@ #include "defines.h" -#ifndef NULL -#define NULL 0 -#endif - namespace latinime { class Correction; @@ -60,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.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 {