From 1364ae3488cac0acbf2d61ef3ce2b62fe0c0f528 Mon Sep 17 00:00:00 2001 From: "K.Takata" Date: Mon, 3 Apr 2017 22:14:47 +0900 Subject: [PATCH] tool: Fix some scripts for gperf 3.1 Gperf 3.1 uses size_t instead of long. --- tool/convert-jis-props.sh | 4 ++-- tool/enc-unicode.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tool/convert-jis-props.sh b/tool/convert-jis-props.sh index 37d43dac..5eb008ca 100755 --- a/tool/convert-jis-props.sh +++ b/tool/convert-jis-props.sh @@ -3,9 +3,9 @@ # Convert props.kwd to props.h using GNU gperf. # # Usage: -# ./tool/convert-jis-props enc/jis/props.kwd enc/jis/props.h +# ./tool/convert-jis-props.sh enc/jis/props.kwd enc/jis/props.h JIS_PROPS_OPTIONS='-k1,3 -7 -c -j1 -i1 -t -C -P -t --ignore-case -H onig_jis_property_hash -Q onig_jis_property_pool -N onig_jis_property' gperf $JIS_PROPS_OPTIONS $1 | \ - sed 's/(int)(long)&((\([a-zA-Z_0-9 ]*[a-zA-Z_0-9]\) *\*)0)->\([a-zA-Z0-9_]*\),/(char)offsetof(\1, \2),/g' > $2 + sed 's/(int)(\(long\|size_t\))&((\([a-zA-Z_0-9 ]*[a-zA-Z_0-9]\) *\*)0)->\([a-zA-Z0-9_]*\),/(char)offsetof(\2, \3),/g' > $2 diff --git a/tool/enc-unicode.rb b/tool/enc-unicode.rb index baa05da4..ed45a303 100755 --- a/tool/enc-unicode.rb +++ b/tool/enc-unicode.rb @@ -534,7 +534,7 @@ def write(str) IO.popen(%W[diff -DUSE_UNICODE_AGE_PROPERTIES #{fds[1].path} #{fds[0].path}], "r") {|age| IO.popen(%W[diff -DUSE_UNICODE_PROPERTIES #{fds[2].path} -], "r", in: age) {|f| f.each {|line| - line.gsub!(/\(int\)\(long\)&\(\(struct uniname2ctype_pool_t \*\)0\)->uniname2ctype_pool_(str\d+),\s+/, + line.gsub!(/\(int\)\((?:long|size_t)\)&\(\(struct uniname2ctype_pool_t \*\)0\)->uniname2ctype_pool_(str\d+),\s+/, 'uniname2ctype_offset(\1), ') puts line }