Commit: 625b2f59f08fc27b8758fb5c407fd1b23558d955
Author: Julian Eisel
Date:   Fri Nov 5 15:31:17 2021 +0100
Branches: master
https://developer.blender.org/rB625b2f59f08fc27b8758fb5c407fd1b23558d955

Fix GCC warnings after own recent commit

Caused by 4e09fd76bcab.

===================================================================

M       source/blender/python/intern/bpy_operator.c

===================================================================

diff --git a/source/blender/python/intern/bpy_operator.c 
b/source/blender/python/intern/bpy_operator.c
index 2e16970bd88..ae42af7cd85 100644
--- a/source/blender/python/intern/bpy_operator.c
+++ b/source/blender/python/intern/bpy_operator.c
@@ -107,7 +107,9 @@ static PyObject *pyop_poll(PyObject *UNUSED(self), PyObject 
*args)
   }
 
   if (context_str) {
-    if (RNA_enum_value_from_id(rna_enum_operator_context_items, context_str, 
&context) == 0) {
+    int context_int = context;
+
+    if (RNA_enum_value_from_id(rna_enum_operator_context_items, context_str, 
&context_int) == 0) {
       char *enum_str = pyrna_enum_repr(rna_enum_operator_context_items);
       PyErr_Format(PyExc_TypeError,
                    "Calling operator \"bpy.ops.%s.poll\" error, "
@@ -117,6 +119,8 @@ static PyObject *pyop_poll(PyObject *UNUSED(self), PyObject 
*args)
       MEM_freeN(enum_str);
       return NULL;
     }
+    /* Copy back to the properly typed enum. */
+    context = context_int;
   }
 
   if (ELEM(context_dict, NULL, Py_None)) {
@@ -208,7 +212,9 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject 
*args)
   }
 
   if (context_str) {
-    if (RNA_enum_value_from_id(rna_enum_operator_context_items, context_str, 
&context) == 0) {
+    int context_int = context;
+
+    if (RNA_enum_value_from_id(rna_enum_operator_context_items, context_str, 
&context_int) == 0) {
       char *enum_str = pyrna_enum_repr(rna_enum_operator_context_items);
       PyErr_Format(PyExc_TypeError,
                    "Calling operator \"bpy.ops.%s\" error, "
@@ -218,6 +224,8 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject 
*args)
       MEM_freeN(enum_str);
       return NULL;
     }
+    /* Copy back to the properly typed enum. */
+    context = context_int;
   }
 
   if (ELEM(context_dict, NULL, Py_None)) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to