Skip to content

Commit

Permalink
tool: Fix some scripts for gperf 3.1
Browse files Browse the repository at this point in the history
Gperf 3.1 uses size_t instead of long.
  • Loading branch information
k-takata committed Apr 3, 2017
1 parent 7acbee3 commit 1364ae3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tool/convert-jis-props.sh
Expand Up @@ -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
2 changes: 1 addition & 1 deletion tool/enc-unicode.rb
Expand Up @@ -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
}
Expand Down

0 comments on commit 1364ae3

Please sign in to comment.