diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-01 00:34:42 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-01 00:34:42 +0000 |
commit | 671c929f0ae3cee6a899792949aad83ad895ad42 (patch) | |
tree | de4f3cec2210886bb0ee77e8de15d5dd0bdeeca4 /tool/enc-unicode.rb | |
parent | 4f7c3d3583f31f0754e69b94bf2eb55a65831582 (diff) | |
download | ruby-671c929f0ae3cee6a899792949aad83ad895ad42.tar.gz |
Use offsetof macro and shrink table size
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/enc-unicode.rb')
-rwxr-xr-x | tool/enc-unicode.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tool/enc-unicode.rb b/tool/enc-unicode.rb index 0e3ba474f7..feb94c3e61 100755 --- a/tool/enc-unicode.rb +++ b/tool/enc-unicode.rb @@ -381,7 +381,6 @@ output = Unifdef.new($stdout) output.kwdonly = !header puts '%{' -puts '#define long size_t' props, data = parse_unicode_data(get_file('UnicodeData.txt')) categories = {} props.concat parse_scripts(data, categories) @@ -423,7 +422,8 @@ output.endif :USE_UNICODE_PROPERTIES puts(<<'__HEREDOC') }; struct uniname2ctype_struct { - int name, ctype; + short name; + unsigned short ctype; }; static const struct uniname2ctype_struct *uniname2ctype_p(const char *, unsigned int); @@ -512,6 +512,12 @@ if header end while syms.pop fds.each(&:close) IO.popen(%W[diff -DUSE_UNICODE_AGE_PROPERTIES #{fds[1].path} #{fds[0].path}], "r") {|age| - system(* %W[diff -DUSE_UNICODE_PROPERTIES #{fds[2].path} -], in: 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+/, + 'offsetof(\1, \2), ') + puts line + } + } } end |