Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f5f79d7 authored by Ken Wakasa's avatar Ken Wakasa Committed by Android (Google) Code Review
Browse files

Merge "Replace assert() with ASSERT() & use -funwind-tables for debug builds"

parents dd4d938e ccebd5ce
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -66,11 +66,15 @@ LOCAL_SRC_FILES := \

ifeq ($(FLAG_DO_PROFILE), true)
    $(warning Making profiling version of native library)
    LOCAL_CFLAGS += -DFLAG_DO_PROFILE
    LOCAL_CFLAGS += -DFLAG_DO_PROFILE -funwind-tables
else # FLAG_DO_PROFILE
ifeq ($(FLAG_DBG), true)
    $(warning Making debug version of native library)
    LOCAL_CFLAGS += -DFLAG_DBG
    LOCAL_CFLAGS += -DFLAG_DBG -funwind-tables
ifeq ($(FLAG_FULL_DBG), true)
    $(warning Making full debug version of native library)
    LOCAL_CFLAGS += -DFLAG_FULL_DBG
endif # FLAG_FULL_DBG
endif # FLAG_DBG
endif # FLAG_DO_PROFILE

+1 −3
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

#define LOG_TAG "LatinIME: jni"

#include <cassert>

#include "com_android_inputmethod_keyboard_ProximityInfo.h"
#include "com_android_inputmethod_latin_BinaryDictionary.h"
#include "com_android_inputmethod_latin_DicTraverseSession.h"
@@ -35,7 +33,7 @@ jint JNI_OnLoad(JavaVM *vm, void *reserved) {
        AKLOGE("ERROR: GetEnv failed");
        return -1;
    }
    assert(env);
    ASSERT(env);
    if (!env) {
        AKLOGE("ERROR: JNIEnv is invalid");
        return -1;
+1 −1
Original line number Diff line number Diff line
@@ -247,7 +247,7 @@ Correction::CorrectionType Correction::processCharAndCalcState(const int c, cons
        if (mSkippedCount == 0 && mSkipPos < mOutputIndex) {
            if (DEBUG_DICT) {
                // TODO: Enable this assertion.
                //assert(mSkipPos == mOutputIndex - 1);
                //ASSERT(mSkipPos == mOutputIndex - 1);
            }
            mSkipPos = mOutputIndex;
        }
+1 −2
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
#ifndef LATINIME_CORRECTION_H
#define LATINIME_CORRECTION_H

#include <cassert>
#include <cstring> // for memset()

#include "correction_state.h"
@@ -150,7 +149,7 @@ class Correction {
            // Branch if multiplier == 2 for the optimization
            if (multiplier < 0) {
                if (DEBUG_DICT) {
                    assert(false);
                    ASSERT(false);
                }
                AKLOGI("--- Invalid multiplier: %d", multiplier);
            } else if (multiplier == 0) {
+5 −6
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@
 * limitations under the License.
 */

#include <cassert>
#include <cstring>

#define LOG_TAG "LatinIME: proximity_info.cpp"
@@ -75,7 +74,7 @@ ProximityInfo::ProximityInfo(JNIEnv *env, const jstring localeJStr, const int ma
    const jsize localeCStrUtf8Length = env->GetStringUTFLength(localeJStr);
    if (localeCStrUtf8Length >= MAX_LOCALE_STRING_LENGTH) {
        AKLOGI("Locale string length too long: length=%d", localeCStrUtf8Length);
        assert(false);
        ASSERT(false);
    }
    memset(mLocaleStr, 0, sizeof(mLocaleStr));
    env->GetStringUTFRegion(localeJStr, 0, env->GetStringLength(localeJStr), mLocaleStr);
@@ -105,7 +104,7 @@ bool ProximityInfo::hasSpaceProximity(const int x, const int y) const {
        if (DEBUG_DICT) {
            AKLOGI("HasSpaceProximity: Illegal coordinates (%d, %d)", x, y);
            // TODO: Enable this assertion.
            //assert(false);
            //ASSERT(false);
        }
        return false;
    }
@@ -180,7 +179,7 @@ void ProximityInfo::calculateNearbyKeyCodes(
                inputCodes[insertPos++] = c;
                if (insertPos >= MAX_PROXIMITY_CHARS_SIZE) {
                    if (DEBUG_DICT) {
                        assert(false);
                        ASSERT(false);
                    }
                    return;
                }
@@ -192,7 +191,7 @@ void ProximityInfo::calculateNearbyKeyCodes(
            inputCodes[insertPos++] = ADDITIONAL_PROXIMITY_CHAR_DELIMITER_CODE;
            if (insertPos >= MAX_PROXIMITY_CHARS_SIZE) {
                if (DEBUG_DICT) {
                    assert(false);
                    ASSERT(false);
                }
                return;
            }
@@ -213,7 +212,7 @@ void ProximityInfo::calculateNearbyKeyCodes(
                inputCodes[insertPos++] = ac;
                if (insertPos >= MAX_PROXIMITY_CHARS_SIZE) {
                    if (DEBUG_DICT) {
                        assert(false);
                        ASSERT(false);
                    }
                    return;
                }
Loading