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

ruby-changes:65763

From: usa <ko1@a...>
Date: Mon, 5 Apr 2021 07:59:01 +0900 (JST)
Subject: [ruby-changes:65763] 1bce19a7e5 (ruby_2_6): merge revision(s) a0bc3f2a1c2c98f225612101cb4e1ea1a6813546,75a0447c15a7ab017bd4240c2a9cc69b134b80b9,f1699314147bad2cf5550cc582693424fdbc2510: [Backport #16846]

https://git.ruby-lang.org/ruby.git/commit/?id=1bce19a7e5

From 1bce19a7e573d94e99fb28601c483383b9ef56a4 Mon Sep 17 00:00:00 2001
From: usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Sun, 4 Apr 2021 22:58:46 +0000
Subject: merge revision(s)
 a0bc3f2a1c2c98f225612101cb4e1ea1a6813546,75a0447c15a7ab017bd4240c2a9cc69b134b80b9,f1699314147bad2cf5550cc582693424fdbc2510:
 [Backport #16846]

	Suppress C4267 "possible loss of data" warnings

	---
	 ext/win32ole/win32ole.c | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)

	Suppress C4267 "possible loss of data" warnings

	Just cast down explicitly.
	---
	 ext/win32ole/win32ole.c | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)

	win32ole: separate global variable declarations and definitions

	https://gcc.gnu.org/gcc-10/changes.html#c

	> * GCC now defaults to `-fno-common`.  As a result, global
	>   variable accesses are more efficient on various targets.  In
	>   C, global variables with multiple tentative definitions now
	>   result in linker errors.  With `-fcommon` such definitions are
	>   silently merged during linking.
	---
	 ext/win32ole/win32ole.c           | 1 +
	 ext/win32ole/win32ole.h           | 4 ++--
	 ext/win32ole/win32ole_error.c     | 3 +++
	 ext/win32ole/win32ole_error.h     | 4 ++--
	 ext/win32ole/win32ole_method.c    | 2 ++
	 ext/win32ole/win32ole_method.h    | 2 +-
	 ext/win32ole/win32ole_record.c    | 2 ++
	 ext/win32ole/win32ole_record.h    | 2 +-
	 ext/win32ole/win32ole_type.c      | 2 ++
	 ext/win32ole/win32ole_type.h      | 2 +-
	 ext/win32ole/win32ole_typelib.c   | 2 ++
	 ext/win32ole/win32ole_typelib.h   | 2 +-
	 ext/win32ole/win32ole_variable.c  | 2 ++
	 ext/win32ole/win32ole_variable.h  | 2 +-
	 ext/win32ole/win32ole_variant.c   | 2 ++
	 ext/win32ole/win32ole_variant.h   | 2 +-
	 ext/win32ole/win32ole_variant_m.c | 2 ++
	 ext/win32ole/win32ole_variant_m.h | 2 +-
	 18 files changed, 29 insertions(+), 11 deletions(-)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
---
 ext/win32ole/win32ole.c           | 3 ++-
 ext/win32ole/win32ole.h           | 4 ++--
 ext/win32ole/win32ole_error.c     | 3 +++
 ext/win32ole/win32ole_error.h     | 4 ++--
 ext/win32ole/win32ole_method.c    | 2 ++
 ext/win32ole/win32ole_method.h    | 2 +-
 ext/win32ole/win32ole_record.c    | 2 ++
 ext/win32ole/win32ole_record.h    | 2 +-
 ext/win32ole/win32ole_type.c      | 2 ++
 ext/win32ole/win32ole_type.h      | 2 +-
 ext/win32ole/win32ole_typelib.c   | 2 ++
 ext/win32ole/win32ole_typelib.h   | 2 +-
 ext/win32ole/win32ole_variable.c  | 2 ++
 ext/win32ole/win32ole_variable.h  | 2 +-
 ext/win32ole/win32ole_variant.c   | 2 ++
 ext/win32ole/win32ole_variant.h   | 2 +-
 ext/win32ole/win32ole_variant_m.c | 2 ++
 ext/win32ole/win32ole_variant_m.h | 2 +-
 version.h                         | 2 +-
 19 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index c46d393..8c647e8 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -2663,7 +2663,7 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L2663
         /*------------------------------------------
           hash object ==> named dispatch parameters
         --------------------------------------------*/
-        cNamedArgs = rb_long2int(RHASH_SIZE(param));
+        cNamedArgs = rb_long2int((long)RHASH_SIZE(param));
         op.dp.cArgs = cNamedArgs + argc - 2;
         op.pNamedArgs = ALLOCA_N(OLECHAR*, cNamedArgs + 1);
         op.dp.rgvarg = ALLOCA_N(VARIANTARG, op.dp.cArgs);
@@ -3974,6 +3974,7 @@ check_nano_server(void) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L3974
     }
 }
 
+LCID cWIN32OLE_lcid;
 
 void
 Init_win32ole(void)
diff --git a/ext/win32ole/win32ole.h b/ext/win32ole/win32ole.h
index c019930..cd627ef 100644
--- a/ext/win32ole/win32ole.h
+++ b/ext/win32ole/win32ole.h
@@ -112,8 +112,8 @@ struct oledata { https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.h#L112
     IDispatch *pDispatch;
 };
 
-VALUE cWIN32OLE;
-LCID cWIN32OLE_lcid;
+extern VALUE cWIN32OLE;
+extern LCID cWIN32OLE_lcid;
 
 struct oledata *oledata_get_struct(VALUE obj);
 LPWSTR ole_vstr2wc(VALUE vstr);
diff --git a/ext/win32ole/win32ole_error.c b/ext/win32ole/win32ole_error.c
index 0225276..2bb5156 100644
--- a/ext/win32ole/win32ole_error.c
+++ b/ext/win32ole/win32ole_error.c
@@ -60,6 +60,9 @@ ole_raise(HRESULT hr, VALUE ecs, const char *fmt, ...) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_error.c#L60
     rb_exc_raise(rb_exc_new_str(ecs, msg));
 }
 
+VALUE eWIN32OLERuntimeError;
+VALUE eWIN32OLEQueryInterfaceError;
+
 void
 Init_win32ole_error(void)
 {
diff --git a/ext/win32ole/win32ole_error.h b/ext/win32ole/win32ole_error.h
index 296eb10..a2f3298 100644
--- a/ext/win32ole/win32ole_error.h
+++ b/ext/win32ole/win32ole_error.h
@@ -1,8 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_error.h#L1
 #ifndef WIN32OLE_ERROR_H
 #define WIN32OLE_ERROR_H 1
 
-VALUE eWIN32OLERuntimeError;
-VALUE eWIN32OLEQueryInterfaceError;
+extern VALUE eWIN32OLERuntimeError;
+extern VALUE eWIN32OLEQueryInterfaceError;
 NORETURN(PRINTF_ARGS(void ole_raise(HRESULT hr, VALUE ecs, const char *fmt, ...), 3, 4));
 void Init_win32ole_error(void);
 
diff --git a/ext/win32ole/win32ole_method.c b/ext/win32ole/win32ole_method.c
index ffa9324..bf66830 100644
--- a/ext/win32ole/win32ole_method.c
+++ b/ext/win32ole/win32ole_method.c
@@ -923,6 +923,8 @@ folemethod_inspect(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_method.c#L923
     return default_inspect(self, "WIN32OLE_METHOD");
 }
 
+VALUE cWIN32OLE_METHOD;
+
 void Init_win32ole_method(void)
 {
     cWIN32OLE_METHOD = rb_define_class("WIN32OLE_METHOD", rb_cObject);
diff --git a/ext/win32ole/win32ole_method.h b/ext/win32ole/win32ole_method.h
index ff2898e..ef907d2 100644
--- a/ext/win32ole/win32ole_method.h
+++ b/ext/win32ole/win32ole_method.h
@@ -7,7 +7,7 @@ struct olemethoddata { https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_method.h#L7
     UINT index;
 };
 
-VALUE cWIN32OLE_METHOD;
+extern VALUE cWIN32OLE_METHOD;
 VALUE folemethod_s_allocate(VALUE klass);
 VALUE ole_methods_from_typeinfo(ITypeInfo *pTypeInfo, int mask);
 VALUE create_win32ole_method(ITypeInfo *pTypeInfo, VALUE name);
diff --git a/ext/win32ole/win32ole_record.c b/ext/win32ole/win32ole_record.c
index e883883..03523bc 100644
--- a/ext/win32ole/win32ole_record.c
+++ b/ext/win32ole/win32ole_record.c
@@ -589,6 +589,8 @@ folerecord_inspect(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_record.c#L589
                       field);
 }
 
+VALUE cWIN32OLE_RECORD;
+
 void
 Init_win32ole_record(void)
 {
diff --git a/ext/win32ole/win32ole_record.h b/ext/win32ole/win32ole_record.h
index ea431e9..ab1df0e 100644
--- a/ext/win32ole/win32ole_record.h
+++ b/ext/win32ole/win32ole_record.h
@@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_record.h#L1
 #ifndef WIN32OLE_RECORD_H
 #define WIN32OLE_RECORD_H 1
 
-VALUE cWIN32OLE_RECORD;
+extern VALUE cWIN32OLE_RECORD;
 void ole_rec2variant(VALUE rec, VARIANT *var);
 void olerecord_set_ivar(VALUE obj, IRecordInfo *pri, void *prec);
 VALUE create_win32ole_record(IRecordInfo *pri, void *prec);
diff --git a/ext/win32ole/win32ole_type.c b/ext/win32ole/win32ole_type.c
index e6ac402..fa39bf3 100644
--- a/ext/win32ole/win32ole_type.c
+++ b/ext/win32ole/win32ole_type.c
@@ -883,6 +883,8 @@ foletype_inspect(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_type.c#L883
     return default_inspect(self, "WIN32OLE_TYPE");
 }
 
+VALUE cWIN32OLE_TYPE;
+
 void Init_win32ole_type(void)
 {
     cWIN32OLE_TYPE = rb_define_class("WIN32OLE_TYPE", rb_cObject);
diff --git a/ext/win32ole/win32ole_type.h b/ext/win32ole/win32ole_type.h
index a26bf3e..87b551e 100644
--- a/ext/win32ole/win32ole_type.h
+++ b/ext/win32ole/win32ole_type.h
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_type.h#L1
 #ifndef WIN32OLE_TYPE_H
 #define WIN32OLE_TYPE_H 1
-VALUE cWIN32OLE_TYPE;
+extern VALUE cWIN32OLE_TYPE;
 VALUE create_win32ole_type(ITypeInfo *pTypeInfo, VALUE name);
 ITypeInfo *itypeinfo(VALUE self);
 VALUE ole_type_from_itypeinfo(ITypeInfo *pTypeInfo);
diff --git a/ext/win32ole/win32ole_typelib.c b/ext/win32ole/win32ole_typelib.c
index 35376c6..d89f181 100644
--- a/ext/win32ole/win32ole_typelib.c
+++ b/ext/win32ole/win32ole_typelib.c
@@ -822,6 +822,8 @@ foletypelib_inspect(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_typelib.c#L822
     return default_inspect(self, "WIN32OLE_TYPELIB");
 }
 
+VALUE cWIN32OLE_TYPELIB;
+
 void
 Init_win32ole_typelib(void)
 {
diff --git a/ext/win32ole/win32ole_typelib.h b/ext/win32ole/win32ole_typelib.h
index 9fc117f..2c2730b 100644
--- a/ext/win32ole/win32ole_typelib.h
+++ b/ext/win32ole/win32ole_typelib.h
@@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_typelib.h#L1
 #ifndef WIN32OLE_TYPELIB_H
 #define WIN32OLE_TYPELIB_H 1
 
-VALUE cWIN32OLE_TYPELIB;
+extern VALUE cWIN32OLE_TYPELIB;
 
 void Init_win32ole_typelib(void);
 ITypeLib * itypelib(VALUE self);
diff --git a/ext/win32ole/win32ole_variable.c b/ext/win32ole/win32ole_variable.c
index 3dc9972..8030831 100644
--- a/ext/win32ole/win32ole_variable.c
+++ b/ext/win32ole/win32ole_variable.c
@@ -365,6 +365,8 @@ folevariable_inspect(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_variable.c#L365
     return make_inspect("WIN32OLE_VARIABLE", detail);
 }
 
+VALUE cWIN32OLE_VARIABLE;
+
 void Init_win32ole_variable(void)
 {
     cWIN32OLE_VARIABLE = rb_define_class("WIN32OLE_VARIABLE", rb_cObject);
diff --git a/ext/win32ole/win32ole_variable.h b/ext/win32ole/win32ole_variable.h
index 704dc13..209613f 100644
--- a/ext/win32ole/win32ole_variable.h
+++ b/ext/win32ole/win32ole_variable.h
@@ -1,7 +1,7 @@ https://gith (... truncated)

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

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