]> granicus.if.org Git - onig/commitdiff
add cast into hval assignment for escape warning in Windows
authorK.Kosako <kosako@sofnec.co.jp>
Wed, 22 Aug 2018 05:33:32 +0000 (14:33 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Wed, 22 Aug 2018 05:33:32 +0000 (14:33 +0900)
src/make_unicode_property.sh
src/unicode_property_data.c

index 48466f40aa4695d69c4d8ff39ba20cc4faeebcd4..2aab41b3a769d9e448ae4933616dfe46535eeec7 100755 (executable)
@@ -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}
 
index ac02b1a9f7953e98e4bdd63646323ff2a3a335dd..9f4c56ed2d25b9ab595b0538279ca76b2a4e8f47 100644 (file)
@@ -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)
     {