aboutsummaryrefslogtreecommitdiffstats
path: root/native/jni/src/debug.h
diff options
context:
space:
mode:
authorKen Wakasa <kwakasa@google.com>2012-08-12 11:10:48 +0900
committerKen Wakasa <kwakasa@google.com>2012-08-13 10:48:37 +0900
commitbcec82de66f52655593dc233346f11468f5077a0 (patch)
tree2237aa0f754e3ab44ccfac034f5ef6e17ffda724 /native/jni/src/debug.h
parent814510305c21b3081414e75e040dec4b73f6cdf3 (diff)
downloadlatinime-bcec82de66f52655593dc233346f11468f5077a0.tar.gz
latinime-bcec82de66f52655593dc233346f11468f5077a0.tar.xz
latinime-bcec82de66f52655593dc233346f11468f5077a0.zip
Clean up constructors
And, use C++ style casts and use float math functions rather than double ones to save memory space. Also, stop using FloatMath and NativeUtils as standard Math methods are faster now. See http://code.google.com/p/android/issues/detail?id=36199 and https://android-review.googlesource.com/40700 multi-project commit with I4259fb5ab8a15ac5760a7f04fc8f4c860529f04a Change-Id: I0b81cff8c91769f7559a59b9528c75a5aabb4211
Diffstat (limited to 'native/jni/src/debug.h')
-rw-r--r--native/jni/src/debug.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/native/jni/src/debug.h b/native/jni/src/debug.h
index 2168d6672..2432b1f2e 100644
--- a/native/jni/src/debug.h
+++ b/native/jni/src/debug.h
@@ -58,11 +58,12 @@ static inline void LOGI_S16_PLUS(unsigned short *string, const unsigned int leng
}
static inline void printDebug(const char *tag, int *codes, int codesSize, int MAX_PROXIMITY_CHARS) {
- unsigned char *buf = (unsigned char*)malloc((1 + codesSize) * sizeof(*buf));
+ unsigned char *buf = reinterpret_cast<unsigned char *>(malloc((1 + codesSize) * sizeof(*buf)));
buf[codesSize] = 0;
- while (--codesSize >= 0)
- buf[codesSize] = (unsigned char)codes[codesSize * MAX_PROXIMITY_CHARS];
+ while (--codesSize >= 0) {
+ buf[codesSize] = static_cast<unsigned char>(codes[codesSize * MAX_PROXIMITY_CHARS]);
+ }
AKLOGI("%s, WORD = %s", tag, buf);
free(buf);