summaryrefslogtreecommitdiff
path: root/src/unicode_fold1_key.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-06-25 09:54:19 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-06-25 09:54:19 +0200
commit49ce5df5ac9c855bef26106c3e870f391a44dce2 (patch)
tree57ec61c31f78449949c85891024ebecc19aa1242 /src/unicode_fold1_key.c
parent0e4c1c1dd3dd4271e54a7305699c303b629fa915 (diff)
parent3ef49f8de6794777791fdc48ee4b73926ea51e1a (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'src/unicode_fold1_key.c')
-rw-r--r--src/unicode_fold1_key.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/unicode_fold1_key.c b/src/unicode_fold1_key.c
index 6b390fc..2151211 100644
--- a/src/unicode_fold1_key.c
+++ b/src/unicode_fold1_key.c
@@ -1,7 +1,7 @@
/* This file was converted by gperf_fold_key_conv.py
from gperf output file. */
-/* ANSI-C code produced by gperf version 3.0.3 */
-/* Command-line: /Library/Developer/CommandLineTools/usr/bin/gperf -n -C -T -c -t -j1 -L ANSI-C -F,-1 -N unicode_fold1_key unicode_fold1_key.gperf */
+/* ANSI-C code produced by gperf version 3.0.4 */
+/* Command-line: gperf -n -C -T -c -t -j1 -L ANSI-C -F,-1 -N unicode_fold1_key unicode_fold1_key.gperf */
/* Computed positions: -k'1-3' */
@@ -60,6 +60,12 @@ hash(OnigCodePoint codes[])
return asso_values[(unsigned char)onig_codes_byte_at(codes, 2)+3] + asso_values[(unsigned char)onig_codes_byte_at(codes, 1)] + asso_values[(unsigned char)onig_codes_byte_at(codes, 0)];
}
+#ifdef __GNUC__
+__inline
+#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
+#endif
int
unicode_fold1_key(OnigCodePoint codes[])
{
@@ -2534,7 +2540,7 @@ unicode_fold1_key(OnigCodePoint codes[])
{
int key = hash(codes);
- if (key <= MAX_HASH_VALUE)
+ if (key <= MAX_HASH_VALUE && key >= 0)
{
int index = wordlist[key];