* ext/fiddle/conversions.h (PTR2NUM): use signed integer to make
  Fixnum for negative values.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-12-13 09:35:10 +00:00
Родитель d10d5a974d
Коммит 34a0df159b
2 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Sun Dec 13 18:35:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/fiddle/conversions.h (PTR2NUM): use signed integer to make
Fixnum for negative values.
Sun Dec 13 18:33:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* pack.c (pack_pack): always check index range against the

Просмотреть файл

@ -33,11 +33,11 @@ VALUE generic_to_value(VALUE rettype, fiddle_generic retval);
#define GENERIC2VALUE(_type, _retval) generic_to_value((_type), (_retval))
#if SIZEOF_VOIDP == SIZEOF_LONG
# define PTR2NUM(x) (ULONG2NUM((unsigned long)(x)))
# define PTR2NUM(x) (LONG2NUM((long)(x)))
# define NUM2PTR(x) ((void*)(NUM2ULONG(x)))
#else
/* # error --->> Ruby/DL2 requires sizeof(void*) == sizeof(long) to be compiled. <<--- */
# define PTR2NUM(x) (ULL2NUM((unsigned long long)(x)))
# define PTR2NUM(x) (LL2NUM((LONG_LONG)(x)))
# define NUM2PTR(x) ((void*)(NUM2ULL(x)))
#endif