[hydra-commits] file: branch ice/slice-translator-versioning r653 - /ice/branches/slice-trans...

SVN commits to the Hydra project hydra-commits at lists.digium.com
Wed Jun 2 09:43:30 CDT 2010


Author: file
Date: Wed Jun  2 09:43:30 2010
New Revision: 653

URL: https://origsvn.digium.com/svn-view/hydra?view=rev&rev=653
Log:
Optimize the more common case of not suppressing, and fix a bug with the scope. scope != scoped

Modified:
    ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Gen.cpp

Modified: ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Gen.cpp
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Gen.cpp?view=diff&rev=653&r1=652&r2=653
==============================================================================
--- ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Gen.cpp (original)
+++ ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Gen.cpp Wed Jun  2 09:43:30 2010
@@ -31,12 +31,15 @@
 {
     string suppressed_scope = flattenedScope;
 
-    for (ContainedPtr contained = ContainedPtr::dynamicCast(cp); contained; contained = ContainedPtr::dynamicCast(contained->container())) {
-	ModulePtr mod = ModulePtr::dynamicCast(contained);
-	if (mod && mod->hasMetaData("suppress") && _suppress) {
-	    string suppress_string = mod->name() + "__";
-	    string::size_type pos = suppressed_scope.rfind(suppress_string);
-	    suppressed_scope.replace(pos, suppress_string.length(), "");
+    if (_suppress) {
+	for (ContainedPtr contained = ContainedPtr::dynamicCast(cp); contained; contained = ContainedPtr::dynamicCast(contained->container())) {
+	    ModulePtr mod = ModulePtr::dynamicCast(contained);
+	    if (mod && mod->hasMetaData("suppress")) {
+		cout << "Suppress" << endl;
+		string suppress_string = mod->name() + "__";
+		string::size_type pos = suppressed_scope.rfind(suppress_string);
+		suppressed_scope.replace(pos, suppress_string.length(), "");
+	    }
 	}
     }
 
@@ -48,12 +51,15 @@
 {
     string suppressed_scope = scope;
 
-    for (ContainedPtr contained = ContainedPtr::dynamicCast(cp); contained; contained = ContainedPtr::dynamicCast(contained->container())) {
-	ModulePtr mod = ModulePtr::dynamicCast(contained);
-	if (mod && mod->hasMetaData("suppress") && _suppress) {
-	    string suppress_string = "::" + mod->name();
-	    string::size_type pos = suppressed_scope.rfind(suppress_string);
-	    suppressed_scope.replace(pos, suppress_string.length(), "");
+    if (_suppress) {
+	for (ContainedPtr contained = ContainedPtr::dynamicCast(cp); contained; contained = ContainedPtr::dynamicCast(contained->container())) {
+	    ModulePtr mod = ModulePtr::dynamicCast(contained);
+	    if (mod && mod->hasMetaData("suppress")) {
+		cout << "Suppress" << endl;
+		string suppress_string = "::" + mod->name();
+		string::size_type pos = suppressed_scope.rfind(suppress_string);
+		suppressed_scope.replace(pos, suppress_string.length(), "");
+	    }
 	}
     }
 
@@ -3473,7 +3479,7 @@
 
     ContainerPtr container = p->container();
     ClassDefPtr cl = ClassDefPtr::dynamicCast(container);
-    string thisPointer = fixKwd(suppressedscoped(container, cl->scope(), _suppress)) + "*";
+    string thisPointer = fixKwd(suppressedscoped(container, cl->scoped(), _suppress)) + "*";
 
     H << sp;
 





More information about the asterisk-scf-commits mailing list