aboutsummaryrefslogtreecommitdiff
path: root/chinese/pyzy
diff options
context:
space:
mode:
authorPiotr Kubaj <pkubaj@FreeBSD.org>2019-09-11 12:42:53 +0000
committerPiotr Kubaj <pkubaj@FreeBSD.org>2019-09-11 12:42:53 +0000
commitd6cfd3fdfb26bc96e94116e3ad59cd1dbc729244 (patch)
treecfd172f386a2e07e92f932453b660ac786790d40 /chinese/pyzy
parentdc7ce7609a26d072ce3262beec93444d2ab310b2 (diff)
downloadports-d6cfd3fdfb26bc96e94116e3ad59cd1dbc729244.tar.gz
ports-d6cfd3fdfb26bc96e94116e3ad59cd1dbc729244.zip
chinese/pyzy: Fix build on powerpc64, aarch64 and armv*
Add explicit signed to char to fix build where char is unsigned. ./DoublePinyinTable.h:166:5: error: constant expression evaluates to -1 which cannot be narrowed to type 'char' [-Wc++11-narrowing] PR: 240457 Approved by: linimon (mentor), henry.hu.sh@gmail.com (maintainer)
Notes
Notes: svn path=/head/; revision=511821
Diffstat (limited to 'chinese/pyzy')
-rw-r--r--chinese/pyzy/files/patch-src_DoublePinyinContext.cc22
-rw-r--r--chinese/pyzy/files/patch-src_DoublePinyinTable.h121
2 files changed, 143 insertions, 0 deletions
diff --git a/chinese/pyzy/files/patch-src_DoublePinyinContext.cc b/chinese/pyzy/files/patch-src_DoublePinyinContext.cc
new file mode 100644
index 000000000000..566ce454be6b
--- /dev/null
+++ b/chinese/pyzy/files/patch-src_DoublePinyinContext.cc
@@ -0,0 +1,22 @@
+--- src/DoublePinyinContext.cc.orig 2019-09-09 19:45:16 UTC
++++ src/DoublePinyinContext.cc
+@@ -352,7 +352,7 @@ DoublePinyinContext::isPinyin (int i)
+ return NULL;
+ }
+
+- char sheng = ID_TO_SHENG (i);
++ signed char sheng = ID_TO_SHENG (i);
+
+ if (sheng == PINYIN_ID_VOID) {
+ return NULL;
+@@ -365,8 +365,8 @@ inline const Pinyin *
+ DoublePinyinContext::isPinyin (int i, int j)
+ {
+ const Pinyin *pinyin = NULL;
+- char sheng = ID_TO_SHENG (i);
+- const char *yun = ID_TO_YUNS (j);
++ signed char sheng = ID_TO_SHENG (i);
++ const signed char *yun = ID_TO_YUNS (j);
+
+ do {
+ if (sheng == PINYIN_ID_VOID || yun[0] == PINYIN_ID_VOID)
diff --git a/chinese/pyzy/files/patch-src_DoublePinyinTable.h b/chinese/pyzy/files/patch-src_DoublePinyinTable.h
new file mode 100644
index 000000000000..205e4c1201c0
--- /dev/null
+++ b/chinese/pyzy/files/patch-src_DoublePinyinTable.h
@@ -0,0 +1,121 @@
+--- src/DoublePinyinTable.h.orig 2019-09-09 19:30:30 UTC
++++ src/DoublePinyinTable.h
+@@ -26,7 +26,7 @@
+
+ #define PINYIN_ID_AEO PINYIN_ID_ZERO
+
+-static const char double_pinyin_mspy_sheng[] = {
++static const signed char double_pinyin_mspy_sheng[] = {
+ PINYIN_ID_AEO, // A
+ PINYIN_ID_B, // B
+ PINYIN_ID_C, // C
+@@ -55,7 +55,7 @@ static const char double_pinyin_mspy_sheng[] = {
+ PINYIN_ID_Z, // Z
+ PINYIN_ID_VOID, // ;
+ };
+-static const char double_pinyin_mspy_yun[][2] = {
++static const signed char double_pinyin_mspy_yun[][2] = {
+ { PINYIN_ID_A, PINYIN_ID_VOID }, // A
+ { PINYIN_ID_OU, PINYIN_ID_VOID }, // B
+ { PINYIN_ID_IAO, PINYIN_ID_VOID }, // C
+@@ -84,7 +84,7 @@ static const char double_pinyin_mspy_yun[][2] = {
+ { PINYIN_ID_EI, PINYIN_ID_VOID }, // Z
+ { PINYIN_ID_ING, PINYIN_ID_VOID }, // ;
+ };
+-static const char double_pinyin_zrm_sheng[] = {
++static const signed char double_pinyin_zrm_sheng[] = {
+ PINYIN_ID_AEO, // A
+ PINYIN_ID_B, // B
+ PINYIN_ID_C, // C
+@@ -113,7 +113,7 @@ static const char double_pinyin_zrm_sheng[] = {
+ PINYIN_ID_Z, // Z
+ PINYIN_ID_VOID, // ;
+ };
+-static const char double_pinyin_zrm_yun[][2] = {
++static const signed char double_pinyin_zrm_yun[][2] = {
+ { PINYIN_ID_A, PINYIN_ID_VOID }, // A
+ { PINYIN_ID_OU, PINYIN_ID_VOID }, // B
+ { PINYIN_ID_IAO, PINYIN_ID_VOID }, // C
+@@ -142,7 +142,7 @@ static const char double_pinyin_zrm_yun[][2] = {
+ { PINYIN_ID_EI, PINYIN_ID_VOID }, // Z
+ { PINYIN_ID_VOID, PINYIN_ID_VOID }, // ;
+ };
+-static const char double_pinyin_abc_sheng[] = {
++static const signed char double_pinyin_abc_sheng[] = {
+ PINYIN_ID_ZH, // A
+ PINYIN_ID_B, // B
+ PINYIN_ID_C, // C
+@@ -171,7 +171,7 @@ static const char double_pinyin_abc_sheng[] = {
+ PINYIN_ID_Z, // Z
+ PINYIN_ID_VOID, // ;
+ };
+-static const char double_pinyin_abc_yun[][2] = {
++static const signed char double_pinyin_abc_yun[][2] = {
+ { PINYIN_ID_A, PINYIN_ID_VOID }, // A
+ { PINYIN_ID_OU, PINYIN_ID_VOID }, // B
+ { PINYIN_ID_IN, PINYIN_ID_UAI }, // C
+@@ -200,7 +200,7 @@ static const char double_pinyin_abc_yun[][2] = {
+ { PINYIN_ID_IAO, PINYIN_ID_VOID }, // Z
+ { PINYIN_ID_VOID, PINYIN_ID_VOID }, // ;
+ };
+-static const char double_pinyin_zgpy_sheng[] = {
++static const signed char double_pinyin_zgpy_sheng[] = {
+ PINYIN_ID_CH, // A
+ PINYIN_ID_B, // B
+ PINYIN_ID_C, // C
+@@ -229,7 +229,7 @@ static const char double_pinyin_zgpy_sheng[] = {
+ PINYIN_ID_Z, // Z
+ PINYIN_ID_VOID, // ;
+ };
+-static const char double_pinyin_zgpy_yun[][2] = {
++static const signed char double_pinyin_zgpy_yun[][2] = {
+ { PINYIN_ID_A, PINYIN_ID_VOID }, // A
+ { PINYIN_ID_IAO, PINYIN_ID_VOID }, // B
+ { PINYIN_ID_VOID, PINYIN_ID_VOID }, // C
+@@ -258,7 +258,7 @@ static const char double_pinyin_zgpy_yun[][2] = {
+ { PINYIN_ID_OU, PINYIN_ID_VOID }, // Z
+ { PINYIN_ID_ING, PINYIN_ID_VOID }, // ;
+ };
+-static const char double_pinyin_pyjj_sheng[] = {
++static const signed char double_pinyin_pyjj_sheng[] = {
+ PINYIN_ID_ZERO, // A
+ PINYIN_ID_B, // B
+ PINYIN_ID_C, // C
+@@ -287,7 +287,7 @@ static const char double_pinyin_pyjj_sheng[] = {
+ PINYIN_ID_Z, // Z
+ PINYIN_ID_VOID, // ;
+ };
+-static const char double_pinyin_pyjj_yun[][2] = {
++static const signed char double_pinyin_pyjj_yun[][2] = {
+ { PINYIN_ID_A, PINYIN_ID_VOID }, // A
+ { PINYIN_ID_IA, PINYIN_ID_UA }, // B
+ { PINYIN_ID_UAN, PINYIN_ID_VOID }, // C
+@@ -316,7 +316,7 @@ static const char double_pinyin_pyjj_yun[][2] = {
+ { PINYIN_ID_UN, PINYIN_ID_VOID }, // Z
+ { PINYIN_ID_VOID, PINYIN_ID_VOID }, // ;
+ };
+-static const char double_pinyin_xhe_sheng[] = {
++static const signed char double_pinyin_xhe_sheng[] = {
+ PINYIN_ID_AEO, // A
+ PINYIN_ID_B, // B
+ PINYIN_ID_C, // C
+@@ -345,7 +345,7 @@ static const char double_pinyin_xhe_sheng[] = {
+ PINYIN_ID_Z, // Z
+ PINYIN_ID_VOID, // ;
+ };
+-static const char double_pinyin_xhe_yun[][2] = {
++static const signed char double_pinyin_xhe_yun[][2] = {
+ { PINYIN_ID_A, PINYIN_ID_VOID }, // A
+ { PINYIN_ID_IN, PINYIN_ID_VOID }, // B
+ { PINYIN_ID_AO, PINYIN_ID_VOID }, // C
+@@ -376,8 +376,8 @@ static const char double_pinyin_xhe_yun[][2] = {
+ };
+
+ static const struct {
+- const char (&sheng)[27];
+- const char (&yun)[27][2];
++ const signed char (&sheng)[27];
++ const signed char (&yun)[27][2];
+ } double_pinyin_map [] = {
+ { double_pinyin_mspy_sheng, double_pinyin_mspy_yun },
+ { double_pinyin_zrm_sheng, double_pinyin_zrm_yun },