From: K.Kosako Date: Wed, 22 Aug 2018 05:33:32 +0000 (+0900) Subject: add cast into hval assignment for escape warning in Windows X-Git-Tag: v6.9.0~34 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=119a3d4ae5e8d46ccd0f1f345e72cb14f8e42d1a;p=onig add cast into hval assignment for escape warning in Windows --- diff --git a/src/make_unicode_property.sh b/src/make_unicode_property.sh index 48466f4..2aab41b 100755 --- a/src/make_unicode_property.sh +++ b/src/make_unicode_property.sh @@ -3,19 +3,22 @@ NAME=unicode_property_data TMP1=gperf1.tmp TMP2=gperf2.tmp +TMP= GPERF=/usr/bin/gperf GPERF_OPT='-T -C -c -t -j1 -L ANSI-C --ignore-case --pic -Q unicode_prop_name_pool' POOL_CAST='s/\(int *\)\(size_t *\)&\(\(struct +unicode_prop_name_pool_t *\* *\) *0\)->unicode_prop_name_pool_str([^,]+)/pool_offset(\1)/g' ADD_STATIC='s/(const +struct +PoolPropertyNameCtype +\*)/static \1/' +ADD_CAST='s/unsigned +int +hval *= *len/unsigned int hval = (unsigned int )len/' ./make_unicode_property_data.py > ${NAME}.gperf ./make_unicode_property_data.py -posix > ${NAME}_posix.gperf ${GPERF} ${GPERF_OPT} -N unicode_lookup_property_name --output-file ${TMP1} ${NAME}.gperf -sed -e 's/^#line.*$//g' ${TMP1} | sed -r "${POOL_CAST}" | sed -r "${ADD_STATIC}"> ${NAME}.c +cat ${TMP1} | sed -e 's/^#line.*$//g' | sed -r "${POOL_CAST}" | sed -r "${ADD_STATIC}" | sed -r "${ADD_CAST}" > ${NAME}.c + ${GPERF} ${GPERF_OPT} -N unicode_lookup_property_name --output-file ${TMP2} ${NAME}_posix.gperf -sed -e 's/^#line.*$//g' ${TMP2} | sed -r "${POOL_CAST}" | sed -r "${ADD_STATIC}" > ${NAME}_posix.c +cat ${TMP2} | sed -e 's/^#line.*$//g' | sed -r "${POOL_CAST}" | sed -r "${ADD_STATIC}" > ${NAME}_posix.c rm -f ${NAME}.gperf ${NAME}_posix.gperf ${TMP1} ${TMP2} diff --git a/src/unicode_property_data.c b/src/unicode_property_data.c index ac02b1a..9f4c56e 100644 --- a/src/unicode_property_data.c +++ b/src/unicode_property_data.c @@ -23003,7 +23003,7 @@ hash (register const char *str, register size_t len) 5163, 5163, 5163, 5163, 5163, 5163, 5163, 5163, 5163, 5163, 5163, 5163, 5163, 5163, 5163, 5163 }; - register unsigned int hval = len; + register unsigned int hval = (unsigned int )len; switch (hval) {