From: K.Kosako Date: Wed, 22 Aug 2018 04:44:09 +0000 (+0900) Subject: add prefix onigenc_ to sjsi_lookup_property_name() X-Git-Tag: v6.9.0~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e533f0005391afe2bca799c35a538014eb24777b;p=onig add prefix onigenc_ to sjsi_lookup_property_name() --- diff --git a/src/regenc.h b/src/regenc.h index 4707008..ae8d65e 100644 --- a/src/regenc.h +++ b/src/regenc.h @@ -160,7 +160,7 @@ extern int onigenc_mb4_code_to_mbclen P_((OnigCodePoint code)); extern int onigenc_mb4_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf)); extern int onigenc_mb4_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, unsigned int ctype)); extern struct PropertyNameCtype* onigenc_euc_jp_lookup_property_name P_((register const char *str, register size_t len)); -extern struct PropertyNameCtype* sjis_lookup_property_name P_((register const char *str, register unsigned int len)); +extern struct PropertyNameCtype* onigenc_sjis_lookup_property_name P_((register const char *str, register size_t len)); /* in enc/unicode.c */ extern int onigenc_unicode_is_code_ctype P_((OnigCodePoint code, unsigned int ctype)); diff --git a/src/sjis.c b/src/sjis.c index 8e57b8f..4ffd44b 100644 --- a/src/sjis.c +++ b/src/sjis.c @@ -268,7 +268,7 @@ property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end) if (len < sizeof(q) - 1) { xmemcpy(q, p, (size_t )len); q[len] = '\0'; - pc = sjis_lookup_property_name(q, len); + pc = onigenc_sjis_lookup_property_name(q, len); if (pc != 0) return pc->ctype; } diff --git a/src/sjis_prop.c b/src/sjis_prop.c index 83a7b45..a84a9e6 100644 --- a/src/sjis_prop.c +++ b/src/sjis_prop.c @@ -1,5 +1,5 @@ -/* ANSI-C code produced by gperf version 3.0.4 */ -/* Command-line: gperf -pt -T -L ANSI-C -N sjis_lookup_property_name --output-file sjis_prop.c sjis_prop.gperf */ +/* ANSI-C code produced by gperf version 3.1 */ +/* Command-line: gperf -pt -T -L ANSI-C -N onigenc_sjis_lookup_property_name --output-file sjis_prop.c sjis_prop.gperf */ /* Computed positions: -k'1,3' */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ @@ -26,7 +26,7 @@ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) /* The character set is not based on ISO-646. */ -#error "gperf generated tables don't work with this execution character set. Please report a bug to ." +#error "gperf generated tables don't work with this execution character set. Please report a bug to ." #endif #line 1 "sjis_prop.gperf" @@ -49,7 +49,7 @@ inline #endif #endif static unsigned int -hash (register const char *str, register unsigned int len) +hash (register const char *str, register size_t len) { static unsigned char asso_values[] = { @@ -83,14 +83,8 @@ hash (register const char *str, register unsigned int len) return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]]; } -#ifdef __GNUC__ -__inline -#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ -__attribute__ ((__gnu_inline__)) -#endif -#endif struct PropertyNameCtype * -sjis_lookup_property_name (register const char *str, register unsigned int len) +onigenc_sjis_lookup_property_name (register const char *str, register size_t len) { static struct PropertyNameCtype wordlist[] = { @@ -144,9 +138,9 @@ sjis_lookup_property_name (register const char *str, register unsigned int len) if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { - register int key = hash (str, len); + register unsigned int key = hash (str, len); - if (key <= MAX_HASH_VALUE && key >= 0) + if (key <= MAX_HASH_VALUE) { register const char *s = wordlist[key].name;