From 11ddcb0256546c11cc87669f9ef2e84c1500a7ee Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 16 Sep 2024 18:37:53 +0500 Subject: [PATCH] IfcSchema declaration_by_name to use size_t instead of int By accident noticed that `declaration_by_name(-1)` crashes python. If we use size_t it will just throw an error like below NotImplementedError: Wrong number or type of arguments for overloaded function 'schema_definition_declaration_by_name'. Possible C/C++ prototypes are: IfcParse::schema_definition::declaration_by_name(std::string const &) const IfcParse::schema_definition::declaration_by_name(size_t) const --- src/ifcparse/IfcSchema.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifcparse/IfcSchema.h b/src/ifcparse/IfcSchema.h index 5d31a728df..c5139260db 100644 --- a/src/ifcparse/IfcSchema.h +++ b/src/ifcparse/IfcSchema.h @@ -495,7 +495,7 @@ class IFC_PARSE_API schema_definition { return *iter; } - const declaration* declaration_by_name(int name) const { + const declaration* declaration_by_name(size_t name) const { return declarations_[name]; }