зеркало из https://github.com/github/ruby.git
* include/ruby/intern.h (rb_integer_pack): Declaration moved from
internal.h. (rb_integer_unpack): Ditto. [ruby-core:42813] [Feature #6065] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
8a165f9665
Коммит
8fd992d71d
|
@ -1,3 +1,10 @@
|
||||||
|
Sun Jul 28 00:07:48 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* include/ruby/intern.h (rb_integer_pack): Declaration moved from
|
||||||
|
internal.h.
|
||||||
|
(rb_integer_unpack): Ditto.
|
||||||
|
[ruby-core:42813] [Feature #6065]
|
||||||
|
|
||||||
Fri Jul 26 23:18:13 2013 Kouhei Sutou <kou@cozmixng.org>
|
Fri Jul 26 23:18:13 2013 Kouhei Sutou <kou@cozmixng.org>
|
||||||
|
|
||||||
* NEWS: Add a new feature that REXML::Parsers::StreamParser
|
* NEWS: Add a new feature that REXML::Parsers::StreamParser
|
||||||
|
|
|
@ -134,6 +134,30 @@ VALUE rb_big_or(VALUE, VALUE);
|
||||||
VALUE rb_big_xor(VALUE, VALUE);
|
VALUE rb_big_xor(VALUE, VALUE);
|
||||||
VALUE rb_big_lshift(VALUE, VALUE);
|
VALUE rb_big_lshift(VALUE, VALUE);
|
||||||
VALUE rb_big_rshift(VALUE, VALUE);
|
VALUE rb_big_rshift(VALUE, VALUE);
|
||||||
|
|
||||||
|
/* For rb_integer_pack and rb_integer_unpack: */
|
||||||
|
/* "MS" in MSWORD and MSBYTE means "most significant" */
|
||||||
|
/* "LS" in LSWORD and LSBYTE means "least significant" */
|
||||||
|
#define INTEGER_PACK_MSWORD_FIRST 0x01
|
||||||
|
#define INTEGER_PACK_LSWORD_FIRST 0x02
|
||||||
|
#define INTEGER_PACK_MSBYTE_FIRST 0x10
|
||||||
|
#define INTEGER_PACK_LSBYTE_FIRST 0x20
|
||||||
|
#define INTEGER_PACK_NATIVE_BYTE_ORDER 0x40
|
||||||
|
#define INTEGER_PACK_2COMP 0x80
|
||||||
|
#define INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION 0x400
|
||||||
|
/* For rb_integer_unpack: */
|
||||||
|
#define INTEGER_PACK_FORCE_BIGNUM 0x100
|
||||||
|
#define INTEGER_PACK_NEGATIVE 0x200
|
||||||
|
/* Combinations: */
|
||||||
|
#define INTEGER_PACK_LITTLE_ENDIAN \
|
||||||
|
(INTEGER_PACK_LSWORD_FIRST | \
|
||||||
|
INTEGER_PACK_LSBYTE_FIRST)
|
||||||
|
#define INTEGER_PACK_BIG_ENDIAN \
|
||||||
|
(INTEGER_PACK_MSWORD_FIRST | \
|
||||||
|
INTEGER_PACK_MSBYTE_FIRST)
|
||||||
|
int rb_integer_pack(VALUE val, void *words, size_t numwords, size_t wordsize, size_t nails, int flags);
|
||||||
|
VALUE rb_integer_unpack(const void *words, size_t numwords, size_t wordsize, size_t nails, int flags);
|
||||||
|
|
||||||
/* rational.c */
|
/* rational.c */
|
||||||
VALUE rb_rational_raw(VALUE, VALUE);
|
VALUE rb_rational_raw(VALUE, VALUE);
|
||||||
#define rb_rational_raw1(x) rb_rational_raw((x), INT2FIX(1))
|
#define rb_rational_raw1(x) rb_rational_raw((x), INT2FIX(1))
|
||||||
|
|
23
internal.h
23
internal.h
|
@ -56,27 +56,6 @@ extern "C" {
|
||||||
#define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LONG_MIN, LONG_MAX)
|
#define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LONG_MIN, LONG_MAX)
|
||||||
#define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, INT_MIN, INT_MAX)
|
#define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, INT_MIN, INT_MAX)
|
||||||
|
|
||||||
/* "MS" in MSWORD and MSBYTE means "most significant" */
|
|
||||||
/* "LS" in LSWORD and LSBYTE means "least significant" */
|
|
||||||
/* For rb_integer_pack and rb_integer_unpack: */
|
|
||||||
#define INTEGER_PACK_MSWORD_FIRST 0x01
|
|
||||||
#define INTEGER_PACK_LSWORD_FIRST 0x02
|
|
||||||
#define INTEGER_PACK_MSBYTE_FIRST 0x10
|
|
||||||
#define INTEGER_PACK_LSBYTE_FIRST 0x20
|
|
||||||
#define INTEGER_PACK_NATIVE_BYTE_ORDER 0x40
|
|
||||||
#define INTEGER_PACK_2COMP 0x80
|
|
||||||
#define INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION 0x400
|
|
||||||
/* For rb_integer_unpack: */
|
|
||||||
#define INTEGER_PACK_FORCE_BIGNUM 0x100
|
|
||||||
#define INTEGER_PACK_NEGATIVE 0x200
|
|
||||||
/* Combinations: */
|
|
||||||
#define INTEGER_PACK_LITTLE_ENDIAN \
|
|
||||||
(INTEGER_PACK_LSWORD_FIRST | \
|
|
||||||
INTEGER_PACK_LSBYTE_FIRST)
|
|
||||||
#define INTEGER_PACK_BIG_ENDIAN \
|
|
||||||
(INTEGER_PACK_MSWORD_FIRST | \
|
|
||||||
INTEGER_PACK_MSBYTE_FIRST)
|
|
||||||
|
|
||||||
#ifndef swap16
|
#ifndef swap16
|
||||||
# define swap16(x) ((uint16_t)((((x)&0xFF)<<8) | (((x)>>8)&0xFF)))
|
# define swap16(x) ((uint16_t)((((x)&0xFF)<<8) | (((x)>>8)&0xFF)))
|
||||||
#endif
|
#endif
|
||||||
|
@ -517,8 +496,6 @@ const char *rb_objspace_data_type_name(VALUE obj);
|
||||||
VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd);
|
VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd);
|
||||||
|
|
||||||
/* bignum.c */
|
/* bignum.c */
|
||||||
int rb_integer_pack(VALUE val, void *words, size_t numwords, size_t wordsize, size_t nails, int flags);
|
|
||||||
VALUE rb_integer_unpack(const void *words, size_t numwords, size_t wordsize, size_t nails, int flags);
|
|
||||||
VALUE rb_big_mul_normal(VALUE x, VALUE y);
|
VALUE rb_big_mul_normal(VALUE x, VALUE y);
|
||||||
VALUE rb_big_mul_balance(VALUE x, VALUE y);
|
VALUE rb_big_mul_balance(VALUE x, VALUE y);
|
||||||
VALUE rb_big_mul_karatsuba(VALUE x, VALUE y);
|
VALUE rb_big_mul_karatsuba(VALUE x, VALUE y);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче