aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Wakasa <kwakasa@google.com>2012-11-27 03:14:32 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-11-27 03:14:32 -0800
commit98fea60041b7a2958febcf4b69cd9edeca036719 (patch)
tree6609ca3bbddb891a6471313a71b30d6a25f63201
parent72fd0968e5227ffc383b1f9d096872ba39cfdce8 (diff)
parent2a6f58d90215859db899ed74fb7e27a1e69e73a0 (diff)
downloadlatinime-98fea60041b7a2958febcf4b69cd9edeca036719.tar.gz
latinime-98fea60041b7a2958febcf4b69cd9edeca036719.tar.xz
latinime-98fea60041b7a2958febcf4b69cd9edeca036719.zip
Merge "Prep for GCC 4.7"
-rw-r--r--native/jni/src/binary_format.h2
-rw-r--r--native/jni/src/defines.h8
-rw-r--r--tests/AndroidManifest.xml2
3 files changed, 6 insertions, 6 deletions
diff --git a/native/jni/src/binary_format.h b/native/jni/src/binary_format.h
index 9a8c315f7..6df92bf0d 100644
--- a/native/jni/src/binary_format.h
+++ b/native/jni/src/binary_format.h
@@ -246,7 +246,7 @@ static inline int childrenAddressSize(const uint8_t flags) {
/* See the note in attributeAddressSize. The same applies here */
}
-static inline int shortcutByteSize(const uint8_t *const dict, const int pos) {
+static AK_FORCE_INLINE int shortcutByteSize(const uint8_t *const dict, const int pos) {
return ((int)(dict[pos] << 8)) + (dict[pos + 1]);
}
diff --git a/native/jni/src/defines.h b/native/jni/src/defines.h
index 894e5f1c9..f32ebeca3 100644
--- a/native/jni/src/defines.h
+++ b/native/jni/src/defines.h
@@ -167,15 +167,15 @@ static inline void prof_out(void) {
}
AKLOGI("Total time is %6.3f ms.",
profile_buf[PROF_BUF_SIZE - 1] * 1000.0f / static_cast<float>(CLOCKS_PER_SEC));
- float all = 0;
+ float all = 0.0f;
for (int i = 0; i < PROF_BUF_SIZE - 1; ++i) {
all += profile_buf[i];
}
- if (all == 0) all = 1;
+ if (all < 1.0f) all = 1.0f;
for (int i = 0; i < PROF_BUF_SIZE - 1; ++i) {
- if (profile_buf[i]) {
+ if (profile_buf[i] > 0.0f) {
AKLOGI("(%d): Used %4.2f%%, %8.4f ms. Called %d times.",
- i, (profile_buf[i] * 100 / all),
+ i, (profile_buf[i] * 100.0f / all),
profile_buf[i] * 1000.0f / static_cast<float>(CLOCKS_PER_SEC),
profile_counter[i]);
}
diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml
index 6bd46ccfb..4b08d6acb 100644
--- a/tests/AndroidManifest.xml
+++ b/tests/AndroidManifest.xml
@@ -17,7 +17,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.inputmethod.latin.tests">
- <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="16" />
+ <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.READ_CONTACTS" />