diff --git a/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp b/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp
index cf55580..2add7c9 100644
--- a/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp
+++ b/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp
@@ -230,8 +230,8 @@
     env->GetCharArrayRegion(before, 0, beforeLength, beforeChars);
     env->GetCharArrayRegion(after, 0, afterLength, afterChars);
     return Correction::RankingAlgorithm::calcNormalizedScore(
-            reinterpret_cast<unsigned short *>(beforeChars), beforeLength,
-            reinterpret_cast<unsigned short *>(afterChars), afterLength, score);
+            static_cast<unsigned short *>(beforeChars), beforeLength,
+            static_cast<unsigned short *>(afterChars), afterLength, score);
 }
 
 static jint latinime_BinaryDictionary_editDistance(JNIEnv *env, jobject object,
@@ -243,8 +243,8 @@
     env->GetCharArrayRegion(before, 0, beforeLength, beforeChars);
     env->GetCharArrayRegion(after, 0, afterLength, afterChars);
     return Correction::RankingAlgorithm::editDistance(
-            reinterpret_cast<unsigned short *>(beforeChars), beforeLength,
-            reinterpret_cast<unsigned short *>(afterChars), afterLength);
+            static_cast<unsigned short *>(beforeChars), beforeLength,
+            static_cast<unsigned short *>(afterChars), afterLength);
 }
 
 static void latinime_BinaryDictionary_close(JNIEnv *env, jobject object, jlong dict) {
diff --git a/native/jni/src/bigram_dictionary.cpp b/native/jni/src/bigram_dictionary.cpp
index df1ebc0..f1d5380 100644
--- a/native/jni/src/bigram_dictionary.cpp
+++ b/native/jni/src/bigram_dictionary.cpp
@@ -60,16 +60,15 @@
         AKLOGI("Bigram: InsertAt -> %d MAX_PREDICTIONS: %d", insertAt, MAX_PREDICTIONS);
     }
     if (insertAt < MAX_PREDICTIONS) {
-        memmove(reinterpret_cast<char *>(bigramFreq) + (insertAt + 1) * sizeof(bigramFreq[0]),
-                reinterpret_cast<char *>(bigramFreq) + insertAt * sizeof(bigramFreq[0]),
+        memmove(bigramFreq + (insertAt + 1),
+                bigramFreq + insertAt,
                 (MAX_PREDICTIONS - insertAt - 1) * sizeof(bigramFreq[0]));
         bigramFreq[insertAt] = frequency;
         outputTypes[insertAt] = Dictionary::KIND_PREDICTION;
-        memmove(reinterpret_cast<char *>(bigramChars)
-                + (insertAt + 1) * MAX_WORD_LENGTH * sizeof(short),
-                reinterpret_cast<char *>(bigramChars) + insertAt * MAX_WORD_LENGTH * sizeof(short),
-                (MAX_PREDICTIONS - insertAt - 1) * sizeof(short) * MAX_WORD_LENGTH);
-        unsigned short *dest = bigramChars + (insertAt    ) * MAX_WORD_LENGTH;
+        memmove(bigramChars + (insertAt + 1) * MAX_WORD_LENGTH,
+                bigramChars + insertAt * MAX_WORD_LENGTH,
+                (MAX_PREDICTIONS - insertAt - 1) * sizeof(bigramChars[0]) * MAX_WORD_LENGTH);
+        unsigned short *dest = bigramChars + insertAt * MAX_WORD_LENGTH;
         while (length--) {
             *dest++ = *word++;
         }
diff --git a/native/jni/src/char_utils.cpp b/native/jni/src/char_utils.cpp
index fc0a059..223291f 100644
--- a/native/jni/src/char_utils.cpp
+++ b/native/jni/src/char_utils.cpp
@@ -885,14 +885,13 @@
 };
 
 static int compare_pair_capital(const void *a, const void *b) {
-    return static_cast<int>(*reinterpret_cast<const unsigned short *>(a))
-            - static_cast<int>(
-                    (reinterpret_cast<const struct LatinCapitalSmallPair *>(b))->capital);
+    return static_cast<int>(*static_cast<const unsigned short *>(a))
+            - static_cast<int>((static_cast<const struct LatinCapitalSmallPair *>(b))->capital);
 }
 
 unsigned short latin_tolower(unsigned short c) {
     struct LatinCapitalSmallPair *p =
-            reinterpret_cast<struct LatinCapitalSmallPair *>(bsearch(&c, SORTED_CHAR_MAP,
+            static_cast<struct LatinCapitalSmallPair *>(bsearch(&c, SORTED_CHAR_MAP,
                     sizeof(SORTED_CHAR_MAP) / sizeof(SORTED_CHAR_MAP[0]),
                     sizeof(SORTED_CHAR_MAP[0]),
                     compare_pair_capital));
diff --git a/native/jni/src/debug.h b/native/jni/src/debug.h
index 2432b1f..4e21640 100644
--- a/native/jni/src/debug.h
+++ b/native/jni/src/debug.h
@@ -58,7 +58,7 @@
 }
 
 static inline void printDebug(const char *tag, int *codes, int codesSize, int MAX_PROXIMITY_CHARS) {
-    unsigned char *buf = reinterpret_cast<unsigned char *>(malloc((1 + codesSize) * sizeof(*buf)));
+    unsigned char *buf = static_cast<unsigned char *>(malloc((1 + codesSize) * sizeof(*buf)));
 
     buf[codesSize] = 0;
     while (--codesSize >= 0) {
diff --git a/native/jni/src/dictionary.cpp b/native/jni/src/dictionary.cpp
index 9e4bd15..158c3fb 100644
--- a/native/jni/src/dictionary.cpp
+++ b/native/jni/src/dictionary.cpp
@@ -32,8 +32,8 @@
 Dictionary::Dictionary(void *dict, int dictSize, int mmapFd, int dictBufAdjust,
         int typedLetterMultiplier, int fullWordMultiplier,
         int maxWordLength, int maxWords, int maxPredictions)
-    : mDict(reinterpret_cast<unsigned char *>(dict)),
-      mOffsetDict((reinterpret_cast<unsigned char *>(dict)) + BinaryFormat::getHeaderSize(mDict)),
+    : mDict(static_cast<unsigned char *>(dict)),
+      mOffsetDict((static_cast<unsigned char *>(dict)) + BinaryFormat::getHeaderSize(mDict)),
       mDictSize(dictSize), mMmapFd(mmapFd), mDictBufAdjust(dictBufAdjust) {
     if (DEBUG_DICT) {
         if (MAX_WORD_LENGTH_INTERNAL < maxWordLength) {
diff --git a/native/jni/src/words_priority_queue.h b/native/jni/src/words_priority_queue.h
index 2fad9bb..1e4e00a 100644
--- a/native/jni/src/words_priority_queue.h
+++ b/native/jni/src/words_priority_queue.h
@@ -140,13 +140,12 @@
                 continue;
             }
             const unsigned int wordLength = sw->mWordLength;
-            char *targetAddress = reinterpret_cast<char *>(outputChars)
-                    + i * MAX_WORD_LENGTH * sizeof(short);
+            unsigned short *targetAddress = outputChars + i * MAX_WORD_LENGTH;
             frequencies[i] = sw->mScore;
             outputTypes[i] = sw->mType;
-            memcpy(targetAddress, sw->mWord, (wordLength) * sizeof(short));
+            memcpy(targetAddress, sw->mWord, wordLength * sizeof(unsigned short));
             if (wordLength < MAX_WORD_LENGTH) {
-                reinterpret_cast<unsigned short *>(targetAddress)[wordLength] = 0;
+                targetAddress[wordLength] = 0;
             }
             sw->mUsed = false;
         }
