diff options
Diffstat (limited to 'TAO/TAO_IDL/be/be_interface.cpp')
-rw-r--r-- | TAO/TAO_IDL/be/be_interface.cpp | 107 |
1 files changed, 42 insertions, 65 deletions
diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp index 816cb87badb..6fc79e08fe7 100644 --- a/TAO/TAO_IDL/be/be_interface.cpp +++ b/TAO/TAO_IDL/be/be_interface.cpp @@ -502,8 +502,7 @@ be_interface::gen_def_ctors_helper (be_interface* node, } else { - *os << ", " << be_global->impl_class_prefix () - << base->flat_name () + *os << ", " << be_global->impl_class_prefix () << base->flat_name () << be_global->impl_class_suffix () << " ()"; } } @@ -763,8 +762,8 @@ Pure_Virtual_Regenerator::emit (be_interface *derived_interface, if (d->accept (this->visitor_) == -1) { ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) Pure_Virtual_Regenerator::emit - " - "visit base interface operation failed\n"), + "(%N:%l) Pure_Virtual_Regenerator::emit - " + "visit base interface operation failed\n"), -1); } @@ -922,8 +921,7 @@ be_interface::gen_operation_table (const char *flat_name, // interface. // Retrieve the singleton instance to the outstream factory. - TAO_OutStream_Factory *factory = - TAO_OUTSTREAM_FACTORY::instance (); + TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance (); // Get a new instance for the temp file. TAO_OutStream *os = factory->make_outstream (); @@ -1293,8 +1291,7 @@ be_interface::gen_collocated_skel_body (be_interface *derived, *os << be_nl << be_nl << "ACE_INLINE void" << be_nl << derived->full_direct_proxy_impl_name () - << "::" << prefix << d->local_name () << " (" - << be_idt << be_idt_nl + << "::" << prefix << d->local_name () << " (" << be_idt << be_idt_nl << "TAO_Abstract_ServantBase *servant," << be_nl << "TAO::Argument ** args," << be_nl << "int num_args" << env_decl << be_uidt_nl @@ -1305,8 +1302,7 @@ be_interface::gen_collocated_skel_body (be_interface *derived, *os << be_uidt_nl << "{" << be_idt_nl << ancestor->full_direct_proxy_impl_name () - << "::" << prefix << d->local_name () << " (" - << be_idt << be_idt_nl + << "::" << prefix << d->local_name () << " (" << be_idt << be_idt_nl << "servant," << be_nl << "args," << be_nl << "num_args" << env_arg << be_uidt_nl @@ -1384,8 +1380,8 @@ be_interface::traverse_inheritance_graph (be_interface::tao_code_emitter gen, if (insert_queue.enqueue_tail (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_interface::traverse_inheritance_graph" - " - error generating entries\n"), + "(%N:%l) be_interface::traverse_inheritance_graph - " + "error generating entries\n"), -1); } @@ -1428,7 +1424,7 @@ be_interface::traverse_inheritance_graph ( { (void) this->insert_non_dup (base); - long const n_supports = base->n_supports (); + long n_supports = base->n_supports (); AST_Interface **supports = base->supports (); for (long j = 0; j < n_supports; ++j) @@ -1657,14 +1653,11 @@ be_interface::gen_gperf_lookup_methods (const char *flat_name) "fclose"), -1); } - + // Open the temp file. #if defined (ACE_OPENVMS) - ACE_HANDLE input = ::open (tao_cg->gperf_input_filename (), - O_RDONLY, - "shr=get,put,upd", - "ctx=rec", - "fop=dfw"); + ACE_HANDLE input = ::open(tao_cg->gperf_input_filename(), O_RDONLY, + "shr=get,put,upd", "ctx=rec", "fop=dfw"); #else ACE_HANDLE input = ACE::open_temp_file (tao_cg->gperf_input_filename (), O_RDONLY); @@ -1689,20 +1682,14 @@ be_interface::gen_gperf_lookup_methods (const char *flat_name) // this, remember to update the file offset to the correct location. #if defined (ACE_OPENVMS) - char* gperfOutput = tempnam (0, "idl_"); - - if (gperfOutput == 0) + char* gperfOutput = tempnam(NULL, "idl_"); + if (gperfOutput == NULL) { - ACE_OS::close (input); - ACE_ERROR_RETURN ((LM_ERROR, "failed to allocate memory\n"), -1); + ACE_OS::close(input); + ACE_ERROR_RETURN ((LM_ERROR, "failed to allocate memory\n"), -1); } - - ACE_HANDLE output = ::open (gperfOutput, - O_WRONLY | O_CREAT | O_EXCL, - ACE_DEFAULT_FILE_PERMS , - "shr=get,put,upd", - "ctx=rec", - "fop=dfw"); + ACE_HANDLE output = ::open(gperfOutput, O_WRONLY | O_CREAT | O_EXCL, + ACE_DEFAULT_FILE_PERMS , "shr=get,put,upd", "ctx=rec", "fop=dfw"); #else ACE_HANDLE output = ACE_OS::open (this->strategy_->get_out_stream_fname (), O_WRONLY | O_APPEND); @@ -1798,8 +1785,7 @@ be_interface::gen_gperf_lookup_methods (const char *flat_name) default: ACE_ERROR ((LM_ERROR, - "tao_idl:ERROR:%N:%l:Unknown " - "Operation Lookup Strategy\n")); + "tao_idl:ERROR:%N:%l:Unknown Operation Lookup Strategy\n")); result = -1; } @@ -1820,8 +1806,7 @@ be_interface::gen_gperf_lookup_methods (const char *flat_name) else if (process.wait () == -1) { ACE_ERROR ((LM_ERROR, - "Error:%p:Error on waiting for " - "completion of gperf program.\n", + "Error:%p:Error on waiting for completion of gperf program.\n", "process.wait")); result = -1; @@ -1829,7 +1814,7 @@ be_interface::gen_gperf_lookup_methods (const char *flat_name) // Adjust the file offset to the EOF for the server skeleton // file. - ACE_OS::fseek (this->strategy_->get_out_stream ()->file (), + ACE_OS::fseek (this->strategy_->get_out_stream()->file (), 0, SEEK_END); } @@ -1837,15 +1822,13 @@ be_interface::gen_gperf_lookup_methods (const char *flat_name) ACE_OS::close (output); ACE_OS::close (input); -#if defined (ACE_OPENVMS) - ACE_OS::unlink(tao_cg->gperf_input_filename ()); - process_options.release_handles (); - +#if defined(ACE_OPENVMS) + ACE_OS::unlink(tao_cg->gperf_input_filename()); + process_options.release_handles(); if (result != -1) { FILE* gperfOutputFile; - gperfOutputFile = ::fopen (gperfOutput, "r"); - + gperfOutputFile = ::fopen(gperfOutput, "r"); if (gperfOutputFile == 0) { ACE_ERROR ((LM_ERROR, @@ -1855,28 +1838,24 @@ be_interface::gen_gperf_lookup_methods (const char *flat_name) } else { - FILE* out = this->strategy_->get_out_stream ()->file (); + FILE* out = this->strategy_->get_out_stream()->file(); int c; - while ((c = fgetc(gperfOutputFile)) != EOF) { - fputc (c, out); + fputc(c, out); } - - if (ferror (gperfOutputFile) || ferror (out)) + if (ferror(gperfOutputFile) || ferror(out)) { ACE_ERROR ((LM_ERROR, "Error:%p:Couldn't open gperf output file\n", "get/put")); result = -1; } - - fclose (gperfOutputFile); + fclose(gperfOutputFile); } } - - ACE_OS::unlink (gperfOutput); - free (gperfOutput); + ACE_OS::unlink(gperfOutput); + free(gperfOutput); #endif /* ACE_OPENVMS */ return result; @@ -1963,9 +1942,9 @@ be_interface::gen_skel_helper (be_interface *derived, if (ancestor->nmembers () > 0) { // If there are elements in ancestor scope i.e., any operations and - // attributes defined by "ancestor", become methods on the derived - // class which call the corresponding method of the base class by - // doing the proper casting. + // attributes defined by "ancestor", become methods on the derived class + // which call the corresponding method of the base class by doing the + // proper casting. for (UTL_ScopeActiveIterator si (ancestor, UTL_Scope::IK_decls); !si.is_done (); @@ -1976,10 +1955,10 @@ be_interface::gen_skel_helper (be_interface *derived, if (d->node_type () == AST_Decl::NT_op) { - *os << be_nl << be_nl - << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ - << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl << be_nl; if (os->stream_type () == TAO_OutStream::TAO_SVR_HDR) { @@ -2203,8 +2182,7 @@ be_interface::gen_colloc_op_decl_helper (be_interface *derived, // Generate the static method corresponding to // this method. *os << "static void" << be_nl - << "_set_" << d->local_name () << " (" - << be_idt << be_idt_nl + << "_set_" << d->local_name () << " (" << be_idt << be_idt_nl << "TAO_Abstract_ServantBase *servant, " << be_nl << "TAO::Argument ** args," << be_nl << "int num_args" << env_dflts << be_uidt_nl @@ -2456,7 +2434,7 @@ be_interface::destroy (void) delete this->strategy_; this->strategy_ = 0; } - + // Call the destroy methods of our base classes. this->AST_Interface::destroy (); this->be_scope::destroy (); @@ -2479,8 +2457,7 @@ be_interface::next_state (TAO_CodeGen::CG_STATE current_state, } int -be_interface::has_extra_code_generation ( - TAO_CodeGen::CG_STATE current_state) +be_interface::has_extra_code_generation (TAO_CodeGen::CG_STATE current_state) { return this->strategy_->has_extra_code_generation (current_state); } @@ -2512,7 +2489,7 @@ be_interface::has_mixed_parentage (void) } AST_Decl::NodeType nt = this->node_type (); - + if (AST_Decl::NT_component == nt || AST_Decl::NT_home == nt) { return 0; |