diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2018-09-05 22:07:01 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2018-09-05 22:07:01 +0200 |
commit | bff9867dafed1bf5aa196614ec6cf2c83022c482 (patch) | |
tree | 13260e2b0cd22ff5327f9a56be748739ae5754ca /src/unicode_fold3_key.c | |
parent | a38d6e8f8417b777925660269969ce2d353808ef (diff) | |
parent | c9b3c26db59d89e320a6eb86d9558051ecba0900 (diff) |
Update upstream source from tag 'upstream/6.9.0'
Update to upstream version '6.9.0'
with Debian dir 3b2adce63a2dab0d7e0e9124b922c348d239c1ec
Diffstat (limited to 'src/unicode_fold3_key.c')
-rw-r--r-- | src/unicode_fold3_key.c | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/src/unicode_fold3_key.c b/src/unicode_fold3_key.c index deb9d22..70e70c8 100644 --- a/src/unicode_fold3_key.c +++ b/src/unicode_fold3_key.c @@ -1,12 +1,38 @@ /* This file was converted by gperf_fold_key_conv.py from gperf output file. */ -/* 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_fold3_key unicode_fold3_key.gperf */ +/* ANSI-C code produced by gperf version 3.1 */ +/* Command-line: /usr/bin/gperf -n -C -T -c -t -j1 -L ANSI-C -F,-1 -N onigenc_unicode_fold3_key unicode_fold3_key.gperf */ /* Computed positions: -k'3,6,9' */ /* This gperf source file was generated by make_unicode_fold_data.py */ + +/*- + * Copyright (c) 2017-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ #include <string.h> #include "regenc.h" @@ -60,14 +86,8 @@ hash(OnigCodePoint codes[]) return asso_values[(unsigned char)onig_codes_byte_at(codes, 8)] + asso_values[(unsigned char)onig_codes_byte_at(codes, 5)] + asso_values[(unsigned char)onig_codes_byte_at(codes, 2)]; } -#ifdef __GNUC__ -__inline -#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ -__attribute__ ((__gnu_inline__)) -#endif -#endif int -unicode_fold3_key(OnigCodePoint codes[]) +onigenc_unicode_fold3_key(OnigCodePoint codes[]) { static const short int wordlist[] = { @@ -105,7 +125,7 @@ unicode_fold3_key(OnigCodePoint codes[]) { int key = hash(codes); - if (key <= MAX_HASH_VALUE && key >= 0) + if (key <= MAX_HASH_VALUE) { int index = wordlist[key]; |