summaryrefslogtreecommitdiff
path: root/ext/ripper/eventids2.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-28 02:53:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-28 02:53:24 +0000
commitb5524d9f8a569014c7f33d0d01e1621d8d71c9de (patch)
treeadf3a1c39695ad1bb5b5349468cbcd9886c0a255 /ext/ripper/eventids2.c
parentd3dc67350a96c259ca629d31a6f370c78a63b379 (diff)
eventids2.c: reduce size
* ext/ripper/eventids2.c (token_assoc): reduce size. unsigned short can hold 65535 at least. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/ripper/eventids2.c')
-rw-r--r--ext/ripper/eventids2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/ripper/eventids2.c b/ext/ripper/eventids2.c
index bfb4e094d0..abbe584454 100644
--- a/ext/ripper/eventids2.c
+++ b/ext/ripper/eventids2.c
@@ -125,11 +125,13 @@ ripper_init_eventids2(void)
set_id2(CHAR);
}
+STATIC_ASSERT(k__END___range, k__END__ < SHRT_MAX);
+STATIC_ASSERT(ripper_scanner_ids_size, sizeof(ripper_scanner_ids) < SHRT_MAX);
#define O(member) (int)offsetof(ripper_scanner_ids_t, ripper_id_##member)
static const struct token_assoc {
- int token;
- int id_offset;
+ unsigned short token;
+ unsigned short id_offset;
} token_to_eventid[] = {
{' ', O(words_sep)},
{'!', O(op)},