From 8a4966d133452682086270b719e93fadf69cd266 Mon Sep 17 00:00:00 2001
From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Fri, 15 Oct 2010 13:47:38 +0000
Subject: [PATCH] * include/ruby/ruby.h (VALUE): prefer long over uintptr_t,  
 FIX2LONG expects VALUE to be long at least.

* include/ruby/ruby.h (FIX2LONG): parenthesize the argument.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
---
 ChangeLog           | 7 +++++++
 include/ruby/ruby.h | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cfe3d5e982..2e4e373cd7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Fri Oct 15 22:47:31 2010  Nobuyoshi Nakada  <nobu@ruby-lang.org>
+
+	* include/ruby/ruby.h (VALUE): prefer long over uintptr_t,
+	  FIX2LONG expects VALUE to be long at least.
+
+	* include/ruby/ruby.h (FIX2LONG): parenthesize the argument.
+
 Fri Oct 15 20:30:30 2010  Nobuyoshi Nakada  <nobu@ruby-lang.org>
 
 	* configure.in (dev_t): use RUBY_REPLACE_TYPE.
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 5d550b5f3c..019285b2c1 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -83,7 +83,7 @@ extern "C" {
 #  endif
 #endif
 
-#if defined HAVE_UINTPTR_T
+#if defined HAVE_UINTPTR_T && 0
 typedef uintptr_t VALUE;
 typedef uintptr_t ID;
 # define SIGNED_VALUE intptr_t
@@ -313,7 +313,7 @@ rb_long2int(long n) {rb_long2int_internal(n, i); return i;}
 #define NUM2GIDT(v) NUM2LONG(v)
 #endif
 
-#define FIX2LONG(x) RSHIFT((SIGNED_VALUE)x,1)
+#define FIX2LONG(x) RSHIFT((SIGNED_VALUE)(x),1)
 #define FIX2ULONG(x) ((((VALUE)(x))>>1)&LONG_MAX)
 #define FIXNUM_P(f) (((SIGNED_VALUE)(f))&FIXNUM_FLAG)
 #define POSFIXABLE(f) ((f) < FIXNUM_MAX+1)