From dbb9cc250cedcabd28ab5b09f1de6176cf55b99e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 15 Apr 2016 02:30:23 +0200 Subject: [PATCH] No real changes, just narrow scope for a variable Initialize "baselist" just where it is needed. --- Source/Modules/c.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Modules/c.cxx b/Source/Modules/c.cxx index 9eec7b8b1..d55a3383e 100644 --- a/Source/Modules/c.cxx +++ b/Source/Modules/c.cxx @@ -1286,11 +1286,10 @@ ready: virtual int classHandler(Node *n) { String *name = getNamespacedName(n); - List *baselist = Getattr(n, "bases"); if (CPlusPlus) { // inheritance support: attach all members from base classes to this class - if (baselist) { + if (List *baselist = Getattr(n, "bases")) { // We may need to specialize SWIG_derives_from<> for this class: its unique check() method will return true iff it's given the name of any subclasses of // this class. Notice that it may happen that all our base classes are ignored, in which case we don't do anything. int specialize_derives_from = -1;