From 00fb802284de17da913506377f4a346210baa4a6 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 13 Jan 2008 01:21:42 +0000 Subject: * encoding.c (enc_table): packed all enc_table stuff. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- enc/make_encdb.rb | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'enc/make_encdb.rb') diff --git a/enc/make_encdb.rb b/enc/make_encdb.rb index b49f13c16e..32dacbc740 100755 --- a/enc/make_encdb.rb +++ b/enc/make_encdb.rb @@ -40,25 +40,21 @@ open('encdb.h', 'wb') do |f| replicas.each_key {|name| f.puts' "%s",' % name} aliases.each_key {|name| f.puts' "%s",' % name} f.puts(<<"_TEXT_") - NULL }; -static const int enc_name_list_size = #{encodings.length + replicas.length + aliases.length}; -static const int enc_aliases_size = #{aliases.length}; -static st_table *enc_table_replica_name; -static st_table *enc_table_alias_name; +#define enc_name_list_size (sizeof(enc_name_list)/sizeof(enc_name_list[0])) static void enc_init_db(void) { - if (!enc_table_replica_name) { - enc_table_replica_name = st_init_strcasetable(); + if (!enc_table.replica_name) { + enc_table.replica_name = st_init_strcasetable(); } - if (!enc_table_alias_name) { - enc_table_alias_name = st_init_strcasetable(); + if (!enc_table.alias_name) { + enc_table.alias_name = st_init_strcasetable(); } _TEXT_ replicas.each_pair {|name, orig| - f.puts' st_insert(enc_table_replica_name, (st_data_t)"%s", (st_data_t)"%s");' % [name, orig]} + f.puts' st_insert(enc_table.replica_name, (st_data_t)"%s", (st_data_t)"%s");' % [name, orig]} aliases.each_pair {|name, orig| - f.puts' st_insert(enc_table_alias_name, (st_data_t)"%s", (st_data_t)"%s");' % [name, orig]} + f.puts' st_insert(enc_table.alias_name, (st_data_t)"%s", (st_data_t)"%s");' % [name, orig]} f.puts '}' end -- cgit v1.2.3