[前][次][番号順一覧][スレッド一覧]

ruby-changes:44299

From: suke <ko1@a...>
Date: Fri, 7 Oct 2016 19:25:01 +0900 (JST)
Subject: [ruby-changes:44299] suke:r56372 (trunk): ext/win32ole/*.c, ext/win32ole/win32ole.h: use RB_INT2FIX instead of

suke	2016-10-07 19:24:56 +0900 (Fri, 07 Oct 2016)

  New Revision: 56372

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56372

  Log:
    ext/win32ole/*.c, ext/win32ole/win32ole.h: use RB_INT2FIX instead of
    INT2FIX, and so on.

  Modified files:
    trunk/ChangeLog
    trunk/ext/win32ole/win32ole.c
    trunk/ext/win32ole/win32ole.h
    trunk/ext/win32ole/win32ole_event.c
    trunk/ext/win32ole/win32ole_method.c
    trunk/ext/win32ole/win32ole_param.c
    trunk/ext/win32ole/win32ole_type.c
    trunk/ext/win32ole/win32ole_typelib.c
    trunk/ext/win32ole/win32ole_variable.c
    trunk/ext/win32ole/win32ole_variant.c
    trunk/ext/win32ole/win32ole_variant_m.c
Index: ext/win32ole/win32ole_param.c
===================================================================
--- ext/win32ole/win32ole_param.c	(revision 56371)
+++ ext/win32ole/win32ole_param.c	(revision 56372)
@@ -149,7 +149,7 @@ foleparam_initialize(VALUE self, VALUE o https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_param.c#L149
     if (!rb_obj_is_kind_of(olemethod, cWIN32OLE_METHOD)) {
         rb_raise(rb_eTypeError, "1st parameter must be WIN32OLE_METHOD object");
     }
-    idx = FIX2INT(n);
+    idx = RB_FIX2INT(n);
     return oleparam_ole_param(self, olemethod, idx);
 }
 
Index: ext/win32ole/win32ole_variant.c
===================================================================
--- ext/win32ole/win32ole_variant.c	(revision 56371)
+++ ext/win32ole/win32ole_variant.c	(revision 56372)
@@ -160,7 +160,7 @@ ole_val2variant_err(VALUE val, VARIANT * https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_variant.c#L160
     }
     V_VT(var) = VT_ERROR;
     if (v != Qnil) {
-        V_ERROR(var) = NUM2LONG(val);
+        V_ERROR(var) = RB_NUM2LONG(val);
     } else {
         V_ERROR(var) = 0;
     }
@@ -294,7 +294,7 @@ folevariant_s_array(VALUE klass, VALUE e https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_variant.c#L294
 
     ole_initialize();
 
-    vt = NUM2UINT(vvt);
+    vt = RB_NUM2UINT(vvt);
     vt = (vt | VT_ARRAY);
     Check_Type(elems, T_ARRAY);
     obj = folevariant_s_allocate(klass);
@@ -309,7 +309,7 @@ folevariant_s_array(VALUE klass, VALUE e https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_variant.c#L309
     }
 
     for (i = 0; i < dim; i++) {
-        psab[i].cElements = FIX2INT(rb_ary_entry(elems, i));
+        psab[i].cElements = RB_FIX2INT(rb_ary_entry(elems, i));
         psab[i].lLbound = 0;
     }
 
@@ -420,7 +420,7 @@ folevariant_initialize(VALUE self, VALUE https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_variant.c#L420
         ole_val2variant(val, &(pvar->var));
     } else {
         vvt = rb_ary_entry(args, 1);
-        vt = NUM2INT(vvt);
+        vt = RB_NUM2INT(vvt);
         if ((vt & VT_TYPEMASK) == VT_RECORD) {
             rb_raise(rb_eArgError, "not supported VT_RECORD WIN32OLE_VARIANT object");
         }
@@ -465,7 +465,7 @@ ary2safe_array_index(int ary_size, VALUE https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_variant.c#L465
         rb_raise(rb_eRuntimeError, "failed to allocate memory for indices");
     }
     for (i = 0; i < dim; i++) {
-        pid[i] = NUM2INT(ary[i]);
+        pid[i] = RB_NUM2INT(ary[i]);
     }
     return pid;
 }
@@ -649,7 +649,7 @@ folevariant_vartype(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_variant.c#L649
 {
     struct olevariantdata *pvar;
     TypedData_Get_Struct(self, struct olevariantdata, &olevariant_datatype, pvar);
-    return INT2FIX(V_VT(&pvar->var));
+    return RB_INT2FIX(V_VT(&pvar->var));
 }
 
 /*
@@ -706,19 +706,19 @@ Init_win32ole_variant(void) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_variant.c#L706
      * represents VT_EMPTY OLE object.
      */
     rb_define_const(cWIN32OLE_VARIANT, "Empty",
-            rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, Qnil, INT2FIX(VT_EMPTY)));
+            rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, Qnil, RB_INT2FIX(VT_EMPTY)));
 
     /*
      * represents VT_NULL OLE object.
      */
     rb_define_const(cWIN32OLE_VARIANT, "Null",
-            rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, Qnil, INT2FIX(VT_NULL)));
+            rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, Qnil, RB_INT2FIX(VT_NULL)));
 
     /*
      * represents Nothing of VB.NET or VB.
      */
     rb_define_const(cWIN32OLE_VARIANT, "Nothing",
-            rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, Qnil, INT2FIX(VT_DISPATCH)));
+            rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, Qnil, RB_INT2FIX(VT_DISPATCH)));
 
     /*
      * represents VT_ERROR variant with DISP_E_PARAMNOTFOUND.
@@ -728,5 +728,5 @@ Init_win32ole_variant(void) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_variant.c#L728
      *  fso.openTextFile(filename, WIN32OLE_VARIANT::NoParam, false)
      */
     rb_define_const(cWIN32OLE_VARIANT, "NoParam",
-            rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, INT2NUM(DISP_E_PARAMNOTFOUND), INT2FIX(VT_ERROR)));
+            rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, INT2NUM(DISP_E_PARAMNOTFOUND), RB_INT2FIX(VT_ERROR)));
 }
Index: ext/win32ole/win32ole_typelib.c
===================================================================
--- ext/win32ole/win32ole_typelib.c	(revision 56371)
+++ ext/win32ole/win32ole_typelib.c	(revision 56372)
@@ -539,7 +539,7 @@ foletypelib_major_version(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_typelib.c#L539
     pTypeLib = itypelib(self);
     oletypelib_get_libattr(pTypeLib, &pTLibAttr);
 
-    major =  INT2NUM(pTLibAttr->wMajorVerNum);
+    major =  RB_INT2NUM(pTLibAttr->wMajorVerNum);
     pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
     return major;
 }
@@ -561,7 +561,7 @@ foletypelib_minor_version(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_typelib.c#L561
     ITypeLib *pTypeLib;
     pTypeLib = itypelib(self);
     oletypelib_get_libattr(pTypeLib, &pTLibAttr);
-    minor =  INT2NUM(pTLibAttr->wMinorVerNum);
+    minor =  RB_INT2NUM(pTLibAttr->wMinorVerNum);
     pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
     return minor;
 }
Index: ext/win32ole/win32ole_variant_m.c
===================================================================
--- ext/win32ole/win32ole_variant_m.c	(revision 56371)
+++ ext/win32ole/win32ole_variant_m.c	(revision 56372)
@@ -17,133 +17,133 @@ void Init_win32ole_variant_m(void) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_variant_m.c#L17
     /*
      * represents VT_EMPTY type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_EMPTY", INT2FIX(VT_EMPTY));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_EMPTY", RB_INT2FIX(VT_EMPTY));
 
     /*
      * represents VT_NULL type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_NULL", INT2FIX(VT_NULL));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_NULL", RB_INT2FIX(VT_NULL));
 
     /*
      * represents VT_I2 type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_I2", INT2FIX(VT_I2));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_I2", RB_INT2FIX(VT_I2));
 
     /*
      * represents VT_I4 type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_I4", INT2FIX(VT_I4));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_I4", RB_INT2FIX(VT_I4));
 
     /*
      * represents VT_R4 type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_R4", INT2FIX(VT_R4));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_R4", RB_INT2FIX(VT_R4));
 
     /*
      * represents VT_R8 type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_R8", INT2FIX(VT_R8));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_R8", RB_INT2FIX(VT_R8));
 
     /*
      * represents VT_CY type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_CY", INT2FIX(VT_CY));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_CY", RB_INT2FIX(VT_CY));
 
     /*
      * represents VT_DATE type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_DATE", INT2FIX(VT_DATE));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_DATE", RB_INT2FIX(VT_DATE));
 
     /*
      * represents VT_BSTR type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_BSTR", INT2FIX(VT_BSTR));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_BSTR", RB_INT2FIX(VT_BSTR));
 
     /*
      * represents VT_USERDEFINED type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_USERDEFINED", INT2FIX(VT_USERDEFINED));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_USERDEFINED", RB_INT2FIX(VT_USERDEFINED));
 
     /*
      * represents VT_PTR type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_PTR", INT2FIX(VT_PTR));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_PTR", RB_INT2FIX(VT_PTR));
 
     /*
      * represents VT_DISPATCH type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_DISPATCH", INT2FIX(VT_DISPATCH));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_DISPATCH", RB_INT2FIX(VT_DISPATCH));
 
     /*
      * represents VT_ERROR type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_ERROR", INT2FIX(VT_ERROR));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_ERROR", RB_INT2FIX(VT_ERROR));
 
     /*
      * represents VT_BOOL type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_BOOL", INT2FIX(VT_BOOL));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_BOOL", RB_INT2FIX(VT_BOOL));
 
     /*
      * represents VT_VARIANT type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_VARIANT", INT2FIX(VT_VARIANT));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_VARIANT", RB_INT2FIX(VT_VARIANT));
 
     /*
      * represents VT_UNKNOWN type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_UNKNOWN", INT2FIX(VT_UNKNOWN));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_UNKNOWN", RB_INT2FIX(VT_UNKNOWN));
 
     /*
      * represents VT_I1 type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_I1", INT2FIX(VT_I1));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_I1", RB_INT2FIX(VT_I1));
 
     /*
      * represents VT_UI1 type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_UI1", INT2FIX(VT_UI1));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_UI1", RB_INT2FIX(VT_UI1));
 
     /*
      * represents VT_UI2 type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_UI2", INT2FIX(VT_UI2));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_UI2", RB_INT2FIX(VT_UI2));
 
     /*
      * represents VT_UI4 type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_UI4", INT2FIX(VT_UI4));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_UI4", RB_INT2FIX(VT_UI4));
 
 #if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
     /*
      * represents VT_I8 type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_I8", INT2FIX(VT_I8));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_I8", RB_INT2FIX(VT_I8));
 
     /*
      * represents VT_UI8 type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_UI8", INT2FIX(VT_UI8));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_UI8", RB_INT2FIX(VT_UI8));
 #endif
 
     /*
      * represents VT_INT type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_INT", INT2FIX(VT_INT));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_INT", RB_INT2FIX(VT_INT));
 
     /*
      * represents VT_UINT type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_UINT", INT2FIX(VT_UINT));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_UINT", RB_INT2FIX(VT_UINT));
 
     /*
      * represents VT_ARRAY type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_ARRAY", INT2FIX(VT_ARRAY));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_ARRAY", RB_INT2FIX(VT_ARRAY));
 
     /*
      * represents VT_BYREF type constant.
      */
-    rb_define_const(mWIN32OLE_VARIANT, "VT_BYREF", INT2FIX(VT_BYREF));
+    rb_define_const(mWIN32OLE_VARIANT, "VT_BYREF", RB_INT2FIX(VT_BYREF));
 
 }
Index: ext/win32ole/win32ole.c
===================================================================
--- ext/win32ole/win32ole.c	(revision 56371)
+++ ext/win32ole/win32ole.c	(revision 56372)
@@ -421,12 +421,12 @@ rbtime2vtdate(VALUE tmobj) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L421
     double t;
     double nsec;
 
-    st.wYear = FIX2INT(rb_funcall(tmobj, rb_intern("year"), 0));
-    st.wMonth = FIX2INT(rb_funcall(tmobj, rb_intern("month"), 0));
-    st.wDay = FIX2INT(rb_funcall(tmobj, rb_intern("mday"), 0));
-    st.wHour = FIX2INT(rb_funcall(tmobj, rb_intern("hour"), 0));
-    st.wMinute = FIX2INT(rb_funcall(tmobj, rb_intern("min"), 0));
-    st.wSecond = FIX2INT(rb_funcall(tmobj, rb_intern("sec"), 0));
+    st.wYear = RB_FIX2INT(rb_funcall(tmobj, rb_intern("year"), 0));
+    st.wMonth = RB_FIX2INT(rb_funcall(tmobj, rb_intern("month"), 0));
+    st.wDay = RB_FIX2INT(rb_funcall(tmobj, rb_intern("mday"), 0));
+    st.wHour = RB_FIX2INT(rb_funcall(tmobj, rb_intern("hour"), 0));
+    st.wMinute = RB_FIX2INT(rb_funcall(tmobj, rb_intern("min"), 0));
+    st.wSecond = RB_FIX2INT(rb_funcall(tmobj, rb_intern("sec"), 0));
     st.wMilliseconds = 0;
     SystemTimeToVariantTime(&st, &t);
 
@@ -435,7 +435,7 @@ rbtime2vtdate(VALUE tmobj) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L435
      * wMilliseconds of SYSTEMTIME struct.
      * So, we need to calculate milliseconds by ourselves.
      */
-    nsec =  FIX2INT(rb_funcall(tmobj, rb_intern("nsec"), 0));
+    nsec =  RB_FIX2INT(rb_funcall(tmobj, rb_intern("nsec"), 0));
     nsec /= 1000000.0;
     nsec /= (24.0 * 3600.0);
     nsec /= 1000;
@@ -451,18 +451,18 @@ vtdate2rbtime(double date) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L451
     double sec;
     VariantTimeToSystemTime(date, &st);
     v = rb_funcall(rb_cTime, rb_intern("new"), 6,
-		      INT2FIX(st.wYear),
-		      INT2FIX(st.wMonth),
-		      INT2FIX(st.wDay),
-		      INT2FIX(st.wHour),
-		      INT2FIX(st.wMinute),
-		      INT2FIX(st.wSecond));
-    st.wYear = FIX2INT(rb_funcall(v, rb_intern("year"), 0));
-    st.wMonth = FIX2INT(rb_funcall(v, rb_intern("month"), 0));
-    st.wDay = FIX2INT(rb_funcall(v, rb_intern("mday"), 0));
-    st.wHour = FIX2INT(rb_funcall(v, rb_intern("hour"), 0));
-    st.wMinute = FIX2INT(rb_funcall(v, rb_intern("min"), 0));
-    st.wSecond = FIX2INT(rb_funcall(v, rb_intern("sec"), 0));
+		      RB_INT2FIX(st.wYear),
+		      RB_INT2FIX(st.wMonth),
+		      RB_INT2FIX(st.wDay),
+		      RB_INT2FIX(st.wHour),
+		      RB_INT2FIX(st.wMinute),
+		      RB_INT2FIX(st.wSecond));
+    st.wYear = RB_FIX2INT(rb_funcall(v, rb_intern("year"), 0));
+    st.wMonth = RB_FIX2INT(rb_funcall(v, rb_intern("month"), 0));
+    st.wDay = RB_FIX2INT(rb_funcall(v, rb_intern("mday"), 0));
+    st.wHour = RB_FIX2INT(rb_funcall(v, rb_intern("hour"), 0));
+    st.wMinute = RB_FIX2INT(rb_funcall(v, rb_intern("min"), 0));
+    st.wSecond = RB_FIX2INT(rb_funcall(v, rb_intern("sec"), 0));
     st.wMilliseconds = 0;
     SystemTimeToVariantTime(&st, &sec);
     /*
@@ -871,7 +871,7 @@ ole_vstr2wc(VALUE vstr) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L871
     enc = rb_enc_get(vstr);
 
     if (st_lookup(tbl, (VALUE)enc | FIXNUM_FLAG, &data)) {
-        cp = FIX2INT((VALUE)data);
+        cp = RB_FIX2INT((VALUE)data);
     } else {
         cp = ole_encoding2cp(enc);
         if (code_page_installed(cp) ||
@@ -883,7 +883,7 @@ ole_vstr2wc(VALUE vstr) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L883
             cp == CP_UTF7 ||
             cp == CP_UTF8 ||
             cp == 51932) {
-            st_insert(tbl, (VALUE)enc | FIXNUM_FLAG, INT2FIX(cp));
+            st_insert(tbl, (VALUE)enc | FIXNUM_FLAG, RB_INT2FIX(cp));
         } else {
             rb_raise(eWIN32OLERuntimeError, "not installed Windows codepage(%d) according to `%s'", cp, rb_enc_name(enc));
         }
@@ -1271,7 +1271,7 @@ ole_val2variant(VALUE val, VARIANT *var) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L1271
     case T_FIXNUM:
         V_VT(var) = VT_I4;
         {
-            long v = NUM2LONG(val);
+            long v = RB_NUM2LONG(val);
             V_I4(var) = (LONG)v;
 #if SIZEOF_LONG > 4
             if (V_I4(var) != v) {
@@ -1486,58 +1486,58 @@ ole_variant2val(VARIANT *pvar) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L1486
         break;
     case VT_I1:
         if(V_ISBYREF(pvar))
-            obj = INT2NUM((long)*V_I1REF(pvar));
+            obj = RB_INT2NUM((long)*V_I1REF(pvar));
         else
-            obj = INT2NUM((long)V_I1(pvar));
+            obj = RB_INT2NUM((long)V_I1(pvar));
         break;
 
     case VT_UI1:
         if(V_ISBYREF(pvar))
-            obj = INT2NUM((long)*V_UI1REF(pvar));
+            obj = RB_INT2NUM((long)*V_UI1REF(pvar));
         else
-            obj = INT2NUM((long)V_UI1(pvar));
+            obj = RB_INT2NUM((long)V_UI1(pvar));
         break;
 
     case VT_I2:
         if(V_ISBYREF(pvar))
-            obj = INT2NUM((long)*V_I2REF(pvar));
+            obj = RB_INT2NUM((long)*V_I2REF(pvar));
         else
-            obj = INT2NUM((long)V_I2(pvar));
+            obj = RB_INT2NUM((long)V_I2(pvar));
         break;
 
     case VT_UI2:
         if(V_ISBYREF(pvar))
-            obj = INT2NUM((long)*V_UI2REF(pvar));
+            obj = RB_INT2NUM((long)*V_UI2REF(pvar));
         else
-            obj = INT2NUM((long)V_UI2(pvar));
+            obj = RB_INT2NUM((long)V_UI2(pvar));
         break;
 
     case VT_I4:
         if(V_ISBYREF(pvar))
-            obj = INT2NUM((long)*V_I4REF(pvar));
+            obj = RB_INT2NUM((long)*V_I4REF(pvar));
         else
-            obj = INT2NUM((long)V_I4(pvar));
+            obj = RB_INT2NUM((long)V_I4(pvar));
         break;
 
     case VT_UI4:
         if(V_ISBYREF(pvar))
-            obj = INT2NUM((long)*V_UI4REF(pvar));
+            obj = RB_INT2NUM((long)*V_UI4REF(pvar));
         else
-            obj = INT2NUM((long)V_UI4(pvar));
+            obj = RB_INT2NUM((long)V_UI4(pvar));
         break;
 
     case VT_INT:
         if(V_ISBYREF(pvar))
-            obj = INT2NUM((long)*V_INTREF(pvar));
+            obj = RB_INT2NUM((long)*V_INTREF(pvar));
         else
-            obj = INT2NUM((long)V_INT(pvar));
+            obj = RB_INT2NUM((long)V_INT(pvar));
         break;
 
     case VT_UINT:
         if(V_ISBYREF(pvar))
-            obj = INT2NUM((long)*V_UINTREF(pvar));
+            obj = RB_INT2NUM((long)*V_UINTREF(pvar));
         else
-            obj = INT2NUM((long)V_UINT(pvar));
+            obj = RB_INT2NUM((long)V_UINT(pvar));
         break;
 
 #if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
@@ -1596,9 +1596,9 @@ ole_variant2val(VARIANT *pvar) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L1596
 
     case VT_ERROR:
         if(V_ISBYREF(pvar))
-            obj = INT2NUM(*V_ERRORREF(pvar));
+            obj = RB_INT2NUM(*V_ERRORREF(pvar));
         else
-            obj = INT2NUM(V_ERROR(pvar));
+            obj = RB_INT2NUM(V_ERROR(pvar));
         break;
 
     case VT_BOOL:
@@ -2127,7 +2127,7 @@ fole_s_reference_count(VALUE self, VALUE https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L2127
 {
     struct oledata * pole = NULL;
     pole = oledata_get_struct(obj);
-    return INT2NUM(reference_count(pole));
+    return RB_INT2NUM(reference_count(pole));
 }
 
 /*
@@ -2150,7 +2150,7 @@ fole_s_free(VALUE self, VALUE obj) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L2150
             n = OLE_RELEASE(pole->pDispatch);
         }
     }
-    return INT2NUM(n);
+    return RB_INT2NUM(n);
 }
 
 static HWND
@@ -2167,10 +2167,10 @@ ole_show_help(VALUE helpfile, VALUE help https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L2167
     if (!pfnHtmlHelp)
         return hwnd;
     hwnd = pfnHtmlHelp(GetDesktopWindow(), StringValuePtr(helpfile),
-                    0x0f, NUM2INT(helpcontext));
+                    0x0f, RB_NUM2INT(helpcontext));
     if (hwnd == 0)
         hwnd = pfnHtmlHelp(GetDesktopWindow(), StringValuePtr(helpfile),
-                 0,  NUM2INT(helpcontext));
+                 0,  RB_NUM2INT(helpcontext));
     return hwnd;
 }
 
@@ -2227,7 +2227,7 @@ fole_s_show_help(int argc, VALUE *argv, https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L2227
 static VALUE
 fole_s_get_code_page(VALUE self)
 {
-    return INT2FIX(cWIN32OLE_cp);
+    return RB_INT2FIX(cWIN32OLE_cp);
 }
 
 static BOOL CALLBACK
@@ -2264,7 +2264,7 @@ code_page_installed(UINT cp) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L2 (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]