X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=ext%2Fext.c;h=1e9d21f1b22a0332a42283dcc4de788fa1f89945;hb=5f313a3c016b0d98af8ee8a731fb9a0870d74fe3;hp=31beceada0ffa392d0459e47069873000b2ebf0a;hpb=49e6c8f56d89681f20836a14480959fa89d24e26;p=ruby-eet.git diff --git a/ext/ext.c b/ext/ext.c index 31becea..1e9d21f 100644 --- a/ext/ext.c +++ b/ext/ext.c @@ -1,5 +1,5 @@ /* - * $Id: ext.c 34 2005-04-30 13:15:19Z tilman $ + * $Id: ext.c 36 2005-05-11 17:19:38Z tilman $ * * Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de) * @@ -27,8 +27,7 @@ #include #define CHECK_KEY(key) \ - if (rb_funcall (key, rb_intern ("include?"), \ - 1, INT2FIX (0)) == Qtrue) \ + if (rb_funcall (key, id_include, 1, INT2FIX (0)) == Qtrue) \ rb_raise (rb_eArgError, "key must not contain binary zeroes"); #define CHECK_CLOSED(ef) \ @@ -40,12 +39,13 @@ ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \ (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) #else /* !WORDS_BIGENDIAN */ -# define BSWAP16(x) (x) # define BSWAP32(x) (x) #endif /* WORDS_BIGENDIAN */ static VALUE c_close (VALUE self); +static VALUE id_include; + static void c_free (Eet_File **ef) { @@ -525,4 +525,6 @@ Init_eet_ext () c = rb_define_class_under (m, "Chunk", rb_cObject); rb_define_method (c, "serialize", chunk_serialize, 0); + + id_include = rb_intern ("include?"); }