]> git.buserror.net Git - polintos/scott/priv.git/commitdiff
idlcomp/c++: Separate output_nsdecl into begin/children/end.
authorScott Wood <scottwood@freescale.com>
Thu, 27 Sep 2007 23:37:56 +0000 (18:37 -0500)
committerScott Wood <scottwood@freescale.com>
Thu, 27 Sep 2007 23:37:56 +0000 (18:37 -0500)
idlcomp/languages/c++/c++.h
idlcomp/languages/c++/main.cc
include/c++/orb.h

index 214f2cdb1828abec115a2337607b15b628238bbe..a8fb246821ea3c025d8c43d6bfd5dfc02041a665 100644 (file)
@@ -82,8 +82,6 @@ class CPPFile : public LangCallback {
                               bool prototype, bool retval);
        void output_one_method_ptr(Method *m, Interface *iface);
        
                               bool prototype, bool retval);
        void output_one_method_ptr(Method *m, Interface *iface);
        
-       static void output_iface_ns(CPPFile *file, NameSpace *sym);
-       
        //// Misc members:
 
        // Output the static const guid[] value, and the IFaceInfo struct.
        //// Misc members:
 
        // Output the static const guid[] value, and the IFaceInfo struct.
@@ -96,7 +94,6 @@ class CPPFile : public LangCallback {
        
        int output_datum(Struct *ns, Datum *d, int offset);
 
        
        int output_datum(Struct *ns, Datum *d, int offset);
 
-       static void output_vstruct_ns(CPPFile *file, NameSpace *sym);
        void output_vstruct_info(Struct *sym);
        void output_vstruct_main(Struct *sym);
        void output_struct_ctor(Struct *sym, bool extra_vstruct);
        void output_vstruct_info(Struct *sym);
        void output_vstruct_main(Struct *sym);
        void output_struct_ctor(Struct *sym, bool extra_vstruct);
@@ -142,8 +139,10 @@ class CPPFile : public LangCallback {
        // namespace, before any namespace members have been
        // emitted.
        
        // namespace, before any namespace members have been
        // emitted.
        
-       typedef void (*nsdecl_callback)(CPPFile *file, NameSpace *ns);
-       void output_nsdecl(NameSpace *ns, nsdecl_callback cb = NULL);
+       void output_nsdecl_begin(NameSpace *ns);
+       void output_nsdecl_children(NameSpace *ns);
+       void output_nsdecl_end(NameSpace *ns);
+       void output_nsdecl(NameSpace *ns);
 
        void output_aliases_and_types(NameSpace *ns);
        
 
        void output_aliases_and_types(NameSpace *ns);
        
index 12cb65c503e3a166fcdb8e66002af58f809c5c3c..8fb4b7259dd1f23351f7be5e1109ab33157167eb 100644 (file)
@@ -403,7 +403,7 @@ void CPPFile::output_guid(const uint64_t *guid64)
        do_extra_newline = true;
 }
 
        do_extra_newline = true;
 }
 
-void CPPFile::output_nsdecl(NameSpace *ns, nsdecl_callback cb)
+void CPPFile::output_nsdecl_begin(NameSpace *ns)
 {
        // If indent level is not zero, this is a nested struct or interface.
        if (indent.indent_level == 0)
 {
        // If indent level is not zero, this is a nested struct or interface.
        if (indent.indent_level == 0)
@@ -413,10 +413,10 @@ void CPPFile::output_nsdecl(NameSpace *ns, nsdecl_callback cb)
 
        file << indent << "namespace " << **ns->name << "_ns {\n";
        downscope();
 
        file << indent << "namespace " << **ns->name << "_ns {\n";
        downscope();
+}      
        
        
-       if (cb)
-               cb(this, ns);
-       
+void CPPFile::output_nsdecl_children(NameSpace *ns)
+{      
        for (NameSpace::const_iterator i = ns->begin(); i != ns->end(); ++i) {
                Symbol *sym = (*i).second;
 
        for (NameSpace::const_iterator i = ns->begin(); i != ns->end(); ++i) {
                Symbol *sym = (*i).second;
 
@@ -427,7 +427,10 @@ void CPPFile::output_nsdecl(NameSpace *ns, nsdecl_callback cb)
                output_pass(sym, trav_forward);
                output_pass(sym, trav_nsdecl);
        }
                output_pass(sym, trav_forward);
                output_pass(sym, trav_nsdecl);
        }
-       
+}
+
+void CPPFile::output_nsdecl_end(NameSpace *ns)
+{
        upscope();
        
        file << indent << "}\n";
        upscope();
        
        file << indent << "}\n";
@@ -436,6 +439,13 @@ void CPPFile::output_nsdecl(NameSpace *ns, nsdecl_callback cb)
                ns_out(ns);
 }
 
                ns_out(ns);
 }
 
+void CPPFile::output_nsdecl(NameSpace *ns)
+{
+       output_nsdecl_begin(ns);
+       output_nsdecl_children(ns);
+       output_nsdecl_end(ns);
+}
+
 void CPPFile::output_aliases_and_types(NameSpace *ns)
 {
        for (NameSpace::const_iterator i = ns->begin(); i != ns->end(); ++i) {
 void CPPFile::output_aliases_and_types(NameSpace *ns)
 {
        for (NameSpace::const_iterator i = ns->begin(); i != ns->end(); ++i) {
@@ -445,15 +455,6 @@ void CPPFile::output_aliases_and_types(NameSpace *ns)
        }
 }              
 
        }
 }              
 
-void CPPFile::output_vstruct_ns(CPPFile *cpp, NameSpace *sym)
-{
-       Struct *str = dynamic_cast<Struct *>(sym);
-       assert(str);
-       assert(str->is_virtual());
-       
-       cpp->output_guid(str->def.guid);
-}
-
 void CPPFile::output_vstruct_info(Struct *sym)
 {
        all_ns_in(sym, true, "VINFO_");
 void CPPFile::output_vstruct_info(Struct *sym)
 {
        all_ns_in(sym, true, "VINFO_");
@@ -638,7 +639,10 @@ void CPPFile::output(Struct *sym, int pass, void *arg2)
        switch (pass) {
                case trav_nsdecl:
                        if (sym->is_virtual()) {
        switch (pass) {
                case trav_nsdecl:
                        if (sym->is_virtual()) {
-                               output_nsdecl(sym, output_vstruct_ns);
+                               output_nsdecl_begin(sym);
+                               output_nsdecl_children(sym);
+                               output_guid(sym->def.guid);
+                               output_nsdecl_end(sym);
                        } else {
                                output_nsdecl(sym);
                        }
                        } else {
                                output_nsdecl(sym);
                        }
@@ -734,20 +738,17 @@ void CPPFile::output(Struct *sym, int pass, void *arg2)
        }
 }
 
        }
 }
 
-void CPPFile::output_iface_ns(CPPFile *file, NameSpace *sym)
-{
-       Interface *i = dynamic_cast<Interface *>(sym);
-       assert(i);
-
-       file->output_guid(i->def.guid);
-       file->output_ifaceinfo(i);
-}
-
 void CPPFile::output(Interface *sym, int pass, void *arg2)
 {
        switch (pass) {
                case trav_nsdecl:
 void CPPFile::output(Interface *sym, int pass, void *arg2)
 {
        switch (pass) {
                case trav_nsdecl:
-                       output_nsdecl(sym, output_iface_ns);
+                       output_nsdecl_begin(sym);
+                       output_nsdecl_children(sym);
+
+                       output_guid(sym->def.guid);
+                       output_ifaceinfo(sym);
+
+                       output_nsdecl_end(sym);
                        break;
                
                case trav_forward: {
                        break;
                
                case trav_forward: {
index 484c1426473e4a88c67f3e6b57d72cef48886c9f..a20f44d8aebc6be9f994f5c813b20fbe5cdec05e 100644 (file)
@@ -337,8 +337,8 @@ namespace System {
                struct ParamInfoBlock {
                        uint32_t buffer_size;
                        uint32_t copy_size;
                struct ParamInfoBlock {
                        uint32_t buffer_size;
                        uint32_t copy_size;
-                       ID *objlist;
-                       uint32_t objlist_len;
+                       ID *objlist, *newobj;
+                       uint32_t objlist_len, newobj_len;
                        uint32_t num_segments;
 
                        struct Segment {
                        uint32_t num_segments;
 
                        struct Segment {