Merge "Remove unused variables" am: fe0c000f40

Original change: https://android-review.googlesource.com/c/platform/packages/inputmethods/LatinIME/+/2445925

Change-Id: I996fc354112500e41977b93521e9050bdccce81b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2023-03-20 08:13:57 +00:00 committed by Automerger Merge Worker
commit 752ef94cfc
6 changed files with 3 additions and 11 deletions

View File

@ -82,14 +82,12 @@ bool TerminalPositionLookupTable::flushToFile(const char *const dictPath) const
}
bool TerminalPositionLookupTable::runGCTerminalIds(TerminalIdMap *const terminalIdMap) {
int removedEntryCount = 0;
int nextNewTerminalId = 0;
for (int i = 0; i < mSize; ++i) {
const int terminalPos = getBuffer()->readUint(
Ver4DictConstants::TERMINAL_ADDRESS_TABLE_ADDRESS_SIZE, getEntryPos(i));
if (terminalPos == Ver4DictConstants::NOT_A_TERMINAL_ADDRESS) {
// This entry is a garbage.
removedEntryCount++;
} else {
// Give a new terminal id to the entry.
if (!getWritableBuffer()->writeUint(terminalPos,

View File

@ -71,14 +71,12 @@ bool TerminalPositionLookupTable::flushToFile(FILE *const file) const {
}
bool TerminalPositionLookupTable::runGCTerminalIds(TerminalIdMap *const terminalIdMap) {
int removedEntryCount = 0;
int nextNewTerminalId = 0;
for (int i = 0; i < mSize; ++i) {
const int terminalPos = getBuffer()->readUint(
Ver4DictConstants::TERMINAL_ADDRESS_TABLE_ADDRESS_SIZE, getEntryPos(i));
if (terminalPos == Ver4DictConstants::NOT_A_TERMINAL_ADDRESS) {
// This entry is a garbage.
removedEntryCount++;
} else {
// Give a new terminal id to the entry.
if (!getWritableBuffer()->writeUint(terminalPos,

View File

@ -53,7 +53,7 @@ void TrieMap::dump(const int from, const int to) const {
for (int i = from; i < to; ++i) {
AKLOGI("Entry[%d]: %x, %x", i, readField0(i), readField1(i));
}
int unusedRegionSize = 0;
[[maybe_unused]] int unusedRegionSize = 0;
for (int i = 1; i <= MAX_NUM_OF_ENTRIES_IN_ONE_LEVEL; ++i) {
int index = readEmptyTableLink(i);
while (index != ROOT_BITMAP_ENTRY_INDEX) {

View File

@ -490,12 +490,10 @@ namespace latinime {
const int x0 = (*sampledInputXs)[id];
const int y0 = (*sampledInputYs)[id];
const int actualInputIndex = (*sampledInputIndices)[id];
int tempTime = 0;
int tempBeelineDistance = 0;
int start = actualInputIndex;
// lookup forward
while (start > 0 && tempBeelineDistance < lookupRadius) {
tempTime += times[start] - times[start - 1];
--start;
tempBeelineDistance = GeometryUtils::getDistanceInt(x0, y0, xCoordinates[start],
yCoordinates[start]);
@ -504,12 +502,10 @@ namespace latinime {
if (start > 0 && start < actualInputIndex) {
++start;
}
tempTime= 0;
tempBeelineDistance = 0;
int end = actualInputIndex;
// lookup backward
while (end < (inputSize - 1) && tempBeelineDistance < lookupRadius) {
tempTime += times[end + 1] - times[end];
++end;
tempBeelineDistance = GeometryUtils::getDistanceInt(x0, y0, xCoordinates[end],
yCoordinates[end]);

View File

@ -72,7 +72,7 @@ class ProximityInfoUtils {
for (int i = 0; i < inputSize; ++i) {
AKLOGI("---");
for (int j = 0; j < MAX_PROXIMITY_CHARS_SIZE; ++j) {
int proximityChar =
[[maybe_unused]] int proximityChar =
inputProximities[i * MAX_PROXIMITY_CHARS_SIZE + j];
proximityChar += 0;
AKLOGI("--- (%d)%c", i, proximityChar);

View File

@ -97,7 +97,7 @@ void SuggestionResults::dumpSuggestions() const {
suggestedWords.push_back(copyOfSuggestedWords.top());
copyOfSuggestedWords.pop();
}
int index = 0;
[[maybe_unused]] int index = 0;
for (auto it = suggestedWords.rbegin(); it != suggestedWords.rend(); ++it) {
DUMP_SUGGESTION(it->getCodePoint(), it->getCodePointCount(), index, it->getScore());
index++;