summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias Larsson <matias.larsson@matthews.se>2022-11-24 18:08:06 +0100
committerPeng Wu <alexepico@gmail.com>2022-11-29 16:16:21 +0800
commit521340f02907dae96f6f13dbf7997a34ebe864f2 (patch)
tree9248dba79d594c0d27e838699562bca2f777a1c7
parent21cc7efc2b9eb954395a0efc7841d37c4cee3d71 (diff)
downloadlibpinyin-521340f02907dae96f6f13dbf7997a34ebe864f2.tar.gz
Fix segmentation fault on ARMv7
-rw-r--r--src/include/memory_chunk.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/memory_chunk.h b/src/include/memory_chunk.h
index a9b9525..c106dba 100644
--- a/src/include/memory_chunk.h
+++ b/src/include/memory_chunk.h
@@ -134,7 +134,7 @@ private:
/* checksum for aligned parts. */
guint32 index = 0;
for (; index < aligns; index += sizeof(guint32)) {
- const char * p = data + index;
+ const unsigned char * p = (const unsigned char *)data + index;
/* use little endian here. */
guint32 item = *p | *(p + 1) << 8 |
@@ -146,7 +146,7 @@ private:
/* checksum for remained parts. */
guint32 shift = 0;
for (; index < length; index++) {
- const char * p = data + index;
+ const unsigned char * p = (const unsigned char *)data + index;
guint32 item = *p << shift;
shift += 8;