зеркало из https://github.com/github/ruby.git
* ext/dl/cptr.c (rb_dlptr_cmp): return signed value, and restrict
to Fixnum. [ruby-dev:38533] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
4bdd854347
Коммит
fb3fa6aa4e
|
@ -1,3 +1,8 @@
|
|||
Sat May 23 18:48:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/dl/cptr.c (rb_dlptr_cmp): return signed value, and restric
|
||||
to Fixnum. [ruby-dev:38533]
|
||||
|
||||
Fri May 22 23:22:53 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||
|
||||
* missing/vsnprintf.c (errno): [BUG] fixes a compilation
|
||||
|
|
|
@ -318,9 +318,12 @@ VALUE
|
|||
rb_dlptr_cmp(VALUE self, VALUE other)
|
||||
{
|
||||
void *ptr1, *ptr2;
|
||||
SIGNED_VALUE diff;
|
||||
ptr1 = rb_dlptr2cptr(self);
|
||||
ptr2 = rb_dlptr2cptr(other);
|
||||
return PTR2NUM((long)ptr1 - (long)ptr2);
|
||||
diff = (SIGNED_VALUE)ptr1 - (SIGNED_VALUE)ptr2;
|
||||
if (!diff) return INT2FIX(0);
|
||||
return diff > 0 ? INT2NUM(1) : INT2NUM(-1);
|
||||
}
|
||||
|
||||
VALUE
|
||||
|
|
Загрузка…
Ссылка в новой задаче