From a7c660fe615030b41128a20e0bd2676ff4c2a196 Mon Sep 17 00:00:00 2001 From: Ray Molenkamp Date: Tue, 17 Mar 2020 13:45:35 -0600 Subject: Cleanup: Fix warnings about function signature of register pass RE_engine_register_pass is sometimes in the headers with type as an integer parameter, sometimes as eNodeSocketDatatype. This caused warnings, the root cause was makesrna was not able to generate the proper type for enums and defaulted to int. makesrna has been extended with the RNA_def_property_enum_native_type that allows telling makesrna the native type of an enum, if set it will be used otherwise it will still fall back to int. Differential Revision: https://developer.blender.org/D7117 Reviewed By: brecht --- source/blender/makesrna/intern/rna_define.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source/blender/makesrna/intern/rna_define.c') diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 55c97672958..8932639d1ac 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -1819,6 +1819,23 @@ void RNA_def_property_struct_runtime(PropertyRNA *prop, StructRNA *type) } } +void RNA_def_property_enum_native_type(PropertyRNA *prop, const char *native_enum_type) +{ + StructRNA *srna = DefRNA.laststruct; + switch (prop->type) { + case PROP_ENUM: { + EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; + eprop->native_enum_type = native_enum_type; + break; + } + default: + CLOG_ERROR( + &LOG, "\"%s.%s\", invalid type for struct type.", srna->identifier, prop->identifier); + DefRNA.error = 1; + break; + } +} + void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item) { StructRNA *srna = DefRNA.laststruct; -- cgit v1.2.3