From 752e053a1df0446b6ca20815b1976dd322d736bd Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 1 Sep 2008 16:22:49 +0000 Subject: * transcode_data.h (BYTE_LOOKUP): change to uintptr_t array. (BYTE_LOOKUP_BASE): follow the type change. (BYTE_LOOKUP_INFO): ditto. (PType): ditto. (rb_transcoding): ditto. * tool/transcode-tblgen.rb: follow the type change. * transcode.c: ditto. * enc/trans/newline.trans: ditto. * enc/trans/iso2022.trans: ditto. * enc/trans/utf_16_32.trans: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/transcode-tblgen.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tool') diff --git a/tool/transcode-tblgen.rb b/tool/transcode-tblgen.rb index 22587ac4f3..cdeb27f0fd 100644 --- a/tool/transcode-tblgen.rb +++ b/tool/transcode-tblgen.rb @@ -273,7 +273,7 @@ class ActionMap "o3(0x#$1,0x#$2,0x#$3)" when /\A([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])\z/i "o4(0x#$1,0x#$2,0x#$3,0x#$4)" - when /\A&/ # pointer to BYTE_LOOKUP structure + when /\A\/\*BYTE_LOOKUP\*\// # pointer to BYTE_LOOKUP structure info.to_s else raise "unexpected action: #{info.inspect}" @@ -347,8 +347,9 @@ End else infos_name = "#{name}_infos" infos_code = <<"End" -static const struct byte_lookup* const +static const uintptr_t #{infos_name}[#{infos.length}] = #{format_infos(infos)}; +\#define #{infos_name} ((uintptr_t)#{infos_name}) End InfosMemo[infos] = infos_name end @@ -356,9 +357,10 @@ End r = infos_code + <<"End" static const BYTE_LOOKUP #{name} = { - #{offsets_name}, + (uintptr_t)#{offsets_name}, #{infos_name} }; +\#define #{name} ((uintptr_t)#{name}) End words_code << r @@ -380,7 +382,7 @@ End else name_hint2 = nil name_hint2 = "#{name_hint}_#{'%02X' % byte}" if name_hint - table[byte] = "&" + rest.generate_node(bytes_code, words_code, name_hint2, rest_valid_encoding) + table[byte] = "/*BYTE_LOOKUP*/" + rest.generate_node(bytes_code, words_code, name_hint2, rest_valid_encoding) end } @@ -572,7 +574,7 @@ def transcode_tblgen(from, to, map) transcoder_code = <<"End" static const rb_transcoder #{transcoder_name} = { - #{c_esc from}, #{c_esc to}, &#{real_tree_name}, + #{c_esc from}, #{c_esc to}, #{real_tree_name}, #{input_unit_length}, /* input_unit_length */ #{max_input}, /* max_input */ #{max_output}, /* max_output */ -- cgit v1.2.3