From f9b4ea2841dbf795393b392355f1bd9c673f5fba Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 6 Dec 2021 20:22:26 +0100 Subject: [PATCH] Define a local variable for sym:name attribute No changes, this is just a tiny simplification. --- Source/Modules/c.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Modules/c.cxx b/Source/Modules/c.cxx index 90c015cc3..8011dd5a7 100644 --- a/Source/Modules/c.cxx +++ b/Source/Modules/c.cxx @@ -499,6 +499,8 @@ public: if (!cxx_wrappers_.is_initialized()) return; + String* const classname = Getattr(n, "sym:name"); + scoped_dohptr base_classes(NewStringEmpty()); if (List *baselist = Getattr(n, "bases")) { for (Iterator i = First(baselist); i.item; i = Next(i)) { @@ -508,7 +510,7 @@ public: if (first_base_) { Swig_warning(WARN_C_UNSUPPORTTED, Getfile(n), Getline(n), "Multiple inheritance not supported yet, skipping C++ wrapper generation for %s\n", - Getattr(n, "sym:name") + classname ); // Return before initializing class_node_, so that the dtor won't output anything neither. @@ -522,12 +524,12 @@ public: } Printv(cxx_wrappers_.sect_types, - "class ", Getattr(n, "sym:name"), ";\n", + "class ", classname, ";\n", NIL ); Printv(cxx_wrappers_.sect_decls, - "class ", Getattr(n, "sym:name"), base_classes.get(), " {\n" + "class ", classname, base_classes.get(), " {\n" "public:", NIL );