Cleanup: use rna_enum_ prefix for RNA enums
				
					
				
			Definitions could shadow local vars.
This commit is contained in:
		@@ -98,8 +98,8 @@ static PyObject *pyop_poll(PyObject *UNUSED(self), PyObject *args)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (context_str) {
 | 
			
		||||
		if (RNA_enum_value_from_id(operator_context_items, context_str, &context) == 0) {
 | 
			
		||||
			char *enum_str = BPy_enum_as_string(operator_context_items);
 | 
			
		||||
		if (RNA_enum_value_from_id(rna_enum_operator_context_items, context_str, &context) == 0) {
 | 
			
		||||
			char *enum_str = BPy_enum_as_string(rna_enum_operator_context_items);
 | 
			
		||||
			PyErr_Format(PyExc_TypeError,
 | 
			
		||||
			             "Calling operator \"bpy.ops.%s.poll\" error, "
 | 
			
		||||
			             "expected a string enum in (%s)",
 | 
			
		||||
@@ -184,8 +184,8 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (context_str) {
 | 
			
		||||
		if (RNA_enum_value_from_id(operator_context_items, context_str, &context) == 0) {
 | 
			
		||||
			char *enum_str = BPy_enum_as_string(operator_context_items);
 | 
			
		||||
		if (RNA_enum_value_from_id(rna_enum_operator_context_items, context_str, &context) == 0) {
 | 
			
		||||
			char *enum_str = BPy_enum_as_string(rna_enum_operator_context_items);
 | 
			
		||||
			PyErr_Format(PyExc_TypeError,
 | 
			
		||||
			             "Calling operator \"bpy.ops.%s\" error, "
 | 
			
		||||
			             "expected a string enum in (%s)",
 | 
			
		||||
@@ -301,7 +301,7 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args)
 | 
			
		||||
	bpy_import_main_set(CTX_data_main(C));
 | 
			
		||||
 | 
			
		||||
	/* return operator_ret as a bpy enum */
 | 
			
		||||
	return pyrna_enum_bitfield_to_py(operator_return_items, operator_ret);
 | 
			
		||||
	return pyrna_enum_bitfield_to_py(rna_enum_operator_return_items, operator_ret);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -85,7 +85,7 @@ static EnumPropertyItem property_flag_enum_items[] = {
 | 
			
		||||
"   :type options: set\n" \
 | 
			
		||||
 | 
			
		||||
/* subtypes */
 | 
			
		||||
/* XXX Keep in sync with rna_rna.c's property_subtype_items ???
 | 
			
		||||
/* XXX Keep in sync with rna_rna.c's rna_enum_property_subtype_items ???
 | 
			
		||||
 *     Currently it is not...
 | 
			
		||||
 */
 | 
			
		||||
static EnumPropertyItem property_subtype_string_items[] = {
 | 
			
		||||
@@ -1304,7 +1304,7 @@ static int icon_id_from_name(const char *name)
 | 
			
		||||
	int id;
 | 
			
		||||
 | 
			
		||||
	if (name[0]) {
 | 
			
		||||
		for (item = icon_items, id = 0; item->identifier; item++, id++) {
 | 
			
		||||
		for (item = rna_enum_icon_items, id = 0; item->identifier; item++, id++) {
 | 
			
		||||
			if (STREQ(item->name, name)) {
 | 
			
		||||
				return item->value;
 | 
			
		||||
			}
 | 
			
		||||
@@ -2376,7 +2376,7 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
 | 
			
		||||
 | 
			
		||||
		BPY_PROPDEF_SUBTYPE_CHECK(FloatProperty, property_flag_items, property_subtype_number_items);
 | 
			
		||||
 | 
			
		||||
		if (pyunit && RNA_enum_value_from_id(property_unit_items, pyunit, &unit) == 0) {
 | 
			
		||||
		if (pyunit && RNA_enum_value_from_id(rna_enum_property_unit_items, pyunit, &unit) == 0) {
 | 
			
		||||
			PyErr_Format(PyExc_TypeError, "FloatProperty(unit='%s'): invalid unit", pyunit);
 | 
			
		||||
			return NULL;
 | 
			
		||||
		}
 | 
			
		||||
@@ -2489,7 +2489,7 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec
 | 
			
		||||
 | 
			
		||||
		BPY_PROPDEF_SUBTYPE_CHECK(FloatVectorProperty, property_flag_items, property_subtype_array_items);
 | 
			
		||||
 | 
			
		||||
		if (pyunit && RNA_enum_value_from_id(property_unit_items, pyunit, &unit) == 0) {
 | 
			
		||||
		if (pyunit && RNA_enum_value_from_id(rna_enum_property_unit_items, pyunit, &unit) == 0) {
 | 
			
		||||
			PyErr_Format(PyExc_TypeError, "FloatVectorProperty(unit='%s'): invalid unit", pyunit);
 | 
			
		||||
			return NULL;
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -920,7 +920,7 @@ static PyObject *pyrna_prop_str(BPy_PropertyRNA *self)
 | 
			
		||||
 | 
			
		||||
	type = RNA_property_type(self->prop);
 | 
			
		||||
 | 
			
		||||
	if (RNA_enum_id_from_value(property_type_items, type, &type_id) == 0) {
 | 
			
		||||
	if (RNA_enum_id_from_value(rna_enum_property_type_items, type, &type_id) == 0) {
 | 
			
		||||
		PyErr_SetString(PyExc_RuntimeError, "could not use property type, internal error"); /* should never happen */
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -171,7 +171,7 @@ static int pyrna_struct_keyframe_parse(
 | 
			
		||||
 | 
			
		||||
	/* flag may be null (no option currently for remove keyframes e.g.). */
 | 
			
		||||
	if (options) {
 | 
			
		||||
		if (pyoptions && (pyrna_set_to_enum_bitfield(keying_flag_items, pyoptions, options, error_prefix) == -1)) {
 | 
			
		||||
		if (pyoptions && (pyrna_set_to_enum_bitfield(rna_enum_keying_flag_items, pyoptions, options, error_prefix) == -1)) {
 | 
			
		||||
			return -1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -215,7 +215,7 @@ PyObject *pyrna_callback_classmethod_add(PyObject *UNUSED(self), PyObject *args)
 | 
			
		||||
		if (pyrna_enum_value_from_id(region_draw_mode_items, cb_event_str, &cb_event, "bpy_struct.callback_add()") == -1) {
 | 
			
		||||
			return NULL;
 | 
			
		||||
		}
 | 
			
		||||
		else if (pyrna_enum_value_from_id(region_type_items, cb_regiontype_str, &cb_regiontype, "bpy_struct.callback_add()") == -1) {
 | 
			
		||||
		else if (pyrna_enum_value_from_id(rna_enum_region_type_items, cb_regiontype_str, &cb_regiontype, "bpy_struct.callback_add()") == -1) {
 | 
			
		||||
			return NULL;
 | 
			
		||||
		}
 | 
			
		||||
		else {
 | 
			
		||||
@@ -278,7 +278,7 @@ PyObject *pyrna_callback_classmethod_remove(PyObject *UNUSED(self), PyObject *ar
 | 
			
		||||
		customdata = ED_region_draw_cb_customdata(handle);
 | 
			
		||||
		Py_DECREF((PyObject *)customdata);
 | 
			
		||||
 | 
			
		||||
		if (pyrna_enum_value_from_id(region_type_items, cb_regiontype_str, &cb_regiontype, "bpy_struct.callback_remove()") == -1) {
 | 
			
		||||
		if (pyrna_enum_value_from_id(rna_enum_region_type_items, cb_regiontype_str, &cb_regiontype, "bpy_struct.callback_remove()") == -1) {
 | 
			
		||||
			return NULL;
 | 
			
		||||
		}
 | 
			
		||||
		else {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user