зеркало из https://github.com/github/ruby.git
* transcode_data.h (WORDINDEX_SHIFT_BITS): defined.
(WORDINDEX2INFO): defined. (INFO2WORDINDEX): defined. * tool/transcode-tblgen.rb: use WORDINDEX2INFO. * transcode.c: use INFO2WORDINDEX. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
b99c31b38f
Коммит
6378201f8b
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
Wed Sep 3 21:31:59 2008 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* transcode_data.h (WORDINDEX_SHIFT_BITS): defined.
|
||||
(WORDINDEX2INFO): defined.
|
||||
(INFO2WORDINDEX): defined.
|
||||
|
||||
* tool/transcode-tblgen.rb: use WORDINDEX2INFO.
|
||||
|
||||
* transcode.c: use INFO2WORDINDEX.
|
||||
|
||||
Wed Sep 3 21:19:51 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
|
||||
|
||||
* golf_prelude.rb: suppress warning when goruby -v.
|
||||
|
|
|
@ -365,13 +365,13 @@ class ActionMap
|
|||
|
||||
size = words_code.length
|
||||
words_code.insert_at_last(infos.length,
|
||||
"\#define #{infos_name} (sizeof(unsigned int)*#{size})\n" +
|
||||
"\#define #{infos_name} WORDINDEX2INFO(#{size})\n" +
|
||||
format_infos(infos) + "\n")
|
||||
end
|
||||
|
||||
size = words_code.length
|
||||
words_code.insert_at_last(NUM_ELEM_BYTELOOKUP,
|
||||
"\#define #{name} (sizeof(unsigned int)*#{size})\n" +
|
||||
"\#define #{name} WORDINDEX2INFO(#{size})\n" +
|
||||
<<"End" + "\n")
|
||||
#{offsets_name},
|
||||
#{infos_name},
|
||||
|
|
|
@ -492,7 +492,7 @@ transcode_restartable0(const unsigned char **in_pos, unsigned char **out_pos,
|
|||
}
|
||||
|
||||
#define BYTE_ADDR(index) (tr->byte_array + (index))
|
||||
#define WORD_ADDR(index) (tr->word_array + (index)/sizeof(*tr->word_array))
|
||||
#define WORD_ADDR(index) (tr->word_array + INFO2WORDINDEX(index))
|
||||
#define BL_BASE(bl) BYTE_ADDR(BYTE_LOOKUP_BASE(WORD_ADDR(bl)))
|
||||
#define BL_INFO(bl) WORD_ADDR(BYTE_LOOKUP_INFO(WORD_ADDR(bl)))
|
||||
#define BL_MIN_BYTE(bl) (BL_BASE(bl)[0])
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
#ifndef RUBY_TRANSCODE_DATA_H
|
||||
#define RUBY_TRANSCODE_DATA_H 1
|
||||
|
||||
#define WORDINDEX_SHIFT_BITS 2
|
||||
#define WORDINDEX2INFO(widx) ((widx) << WORDINDEX_SHIFT_BITS)
|
||||
#define INFO2WORDINDEX(info) ((info) >> WORDINDEX_SHIFT_BITS)
|
||||
#define BYTE_LOOKUP_BASE(bl) ((bl)[0])
|
||||
#define BYTE_LOOKUP_INFO(bl) ((bl)[1])
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче