diff options
author | sma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-06-05 15:23:26 +0000 |
---|---|---|
committer | sma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-06-05 15:23:26 +0000 |
commit | 806e824f3b96f50d10d607e227d52da0e093842f (patch) | |
tree | d179eebd9fa3d84f9d4a318441e5b095c007316f /TAO/TAO_IDL | |
parent | bfa0d2a15a5f3077b0ad2b3f561cef49d6c90d94 (diff) | |
download | ATCD-806e824f3b96f50d10d607e227d52da0e093842f.tar.gz |
ChangeLogTag: Thu Jun 05 15:22:00 UTC 2008 Simon Massey <sma at prismtech dot com>
Diffstat (limited to 'TAO/TAO_IDL')
-rw-r--r-- | TAO/TAO_IDL/tao_idl.cpp | 49 | ||||
-rw-r--r-- | TAO/TAO_IDL/util/utl_global.cpp | 39 |
2 files changed, 45 insertions, 43 deletions
diff --git a/TAO/TAO_IDL/tao_idl.cpp b/TAO/TAO_IDL/tao_idl.cpp index b696734dbb8..416eb9760f9 100644 --- a/TAO/TAO_IDL/tao_idl.cpp +++ b/TAO/TAO_IDL/tao_idl.cpp @@ -96,11 +96,9 @@ DRV_version (void) { ACE_DEBUG ((LM_DEBUG, "%s\n" - "%s %s (%s %s)\n", - idl_global->prog_name (), - ACE_TEXT ("TAO_IDL_FE, version"), + "TAO_IDL_FE, version %s (Based on Sun IDL FE, version %s)\n", + ACE_TEXT_CHAR_TO_TCHAR (idl_global->prog_name ()), ACE_TEXT (TAO_VERSION), - ACE_TEXT ("Based on Sun IDL FE, version"), ACE_TEXT (SUN_IDL_FE_VERSION))); BE_version (); @@ -197,10 +195,9 @@ DRV_drive (const char *s) if (idl_global->compile_flags () & IDL_CF_INFORMATIVE) { ACE_DEBUG ((LM_DEBUG, - "%s%s %s\n", - idl_global->prog_name (), - ACE_TEXT (": preprocessing"), - s)); + "%s: preprocessing %s\n", + ACE_TEXT_CHAR_TO_TCHAR (idl_global->prog_name ()), + ACE_TEXT_CHAR_TO_TCHAR (s))); } DRV_pre_proc (s); @@ -216,10 +213,9 @@ DRV_drive (const char *s) if (idl_global->compile_flags () & IDL_CF_INFORMATIVE) { ACE_DEBUG ((LM_DEBUG, - "%s%s %s\n", - idl_global->prog_name (), - ACE_TEXT (": parsing"), - s)); + "%s: parsing %s\n", + ACE_TEXT_CHAR_TO_TCHAR (idl_global->prog_name ()), + ACE_TEXT_CHAR_TO_TCHAR (s))); } // Return value not used - error count stored in idl_global @@ -229,7 +225,7 @@ DRV_drive (const char *s) // Filename set by FE_yyparse(), so we output it immediately after. ACE_DEBUG ((LM_DEBUG, "processing %s\n", - idl_global->filename ()->get_string ())); + ACE_TEXT_CHAR_TO_TCHAR (idl_global->filename ()->get_string ()))); // We must do this as late as possible to make sure any // forward declared structs or unions contained in a @@ -240,16 +236,13 @@ DRV_drive (const char *s) if (idl_global->err_count () > 0) { ACE_ERROR ((LM_ERROR, - "%s%s %s%s %d %s%s\n", - idl_global->prog_name (), - ACE_TEXT (":"), - s, - ACE_TEXT (": found"), + "%s: %s: found %d error%s\n", + ACE_TEXT_CHAR_TO_TCHAR (idl_global->prog_name ()), + ACE_TEXT_CHAR_TO_TCHAR (s), idl_global->err_count (), - ACE_TEXT ("error"), - ACE_TEXT ((idl_global->err_count () > 1 + (idl_global->err_count () > 1 ? ACE_TEXT ("s") - : ACE_TEXT (""))))); + : ACE_TEXT ("")) )); // Backend will be cleaned up after the exception is caught. throw Bailout (); @@ -260,10 +253,9 @@ DRV_drive (const char *s) && (idl_global->compile_flags () & IDL_CF_DUMP_AST)) { ACE_DEBUG ((LM_DEBUG, - "%s%s %s\n", - idl_global->prog_name (), - ACE_TEXT (": dump"), - s)); + "%s: dump %s\n", + ACE_TEXT_CHAR_TO_TCHAR (idl_global->prog_name ()), + ACE_TEXT_CHAR_TO_TCHAR (s))); } if (idl_global->compile_flags () & IDL_CF_DUMP_AST) @@ -278,10 +270,9 @@ DRV_drive (const char *s) if (idl_global->compile_flags () & IDL_CF_INFORMATIVE) { ACE_DEBUG ((LM_DEBUG, - "%s%s %s\n", - idl_global->prog_name (), - ACE_TEXT (": BE processing on"), - s)); + "%s: BE processing on %s\n", + ACE_TEXT_CHAR_TO_TCHAR (idl_global->prog_name ()), + ACE_TEXT_CHAR_TO_TCHAR (s))); } // Make sure all forward declared structs and unions are defined diff --git a/TAO/TAO_IDL/util/utl_global.cpp b/TAO/TAO_IDL/util/utl_global.cpp index 4f671f70fc9..7a33efe4aa4 100644 --- a/TAO/TAO_IDL/util/utl_global.cpp +++ b/TAO/TAO_IDL/util/utl_global.cpp @@ -188,7 +188,7 @@ IDL_GlobalData::IDL_GlobalData (void) + ACE_OS::strlen (ace_gperf) + 1]); ACE_OS::sprintf (this->gperf_path_, - "%s" ACE_DIRECTORY_SEPARATOR_STR "bin" ACE_DIRECTORY_SEPARATOR_STR "%s", + "%s" ACE_DIRECTORY_SEPARATOR_STR_A "bin" ACE_DIRECTORY_SEPARATOR_STR_A "%s", ace_root, ace_gperf); #else /* Not ACE_GPERF */ @@ -198,7 +198,7 @@ IDL_GlobalData::IDL_GlobalData (void) + ACE_OS::strlen ("/bin/gperf") + 1]); ACE_OS::sprintf (this->gperf_path_, - "%s" ACE_DIRECTORY_SEPARATOR_STR "bin" ACE_DIRECTORY_SEPARATOR_STR "gperf", + "%s" ACE_DIRECTORY_SEPARATOR_STR_A "bin" ACE_DIRECTORY_SEPARATOR_STR_A "gperf", ace_root); #endif /* ACE_GPERF */ } @@ -782,7 +782,7 @@ IDL_GlobalData::validate_included_idl_files (void) pre_partial.substr (1, pre_partial.length () - 2); } - pre_partial += ACE_DIRECTORY_SEPARATOR_STR; + pre_partial += ACE_DIRECTORY_SEPARATOR_STR_A; pre_partial += pre_preproc_includes[j]; full_path = ACE_OS::realpath (pre_partial.c_str (), pre_abspath); @@ -919,18 +919,29 @@ IDL_GlobalData::temp_dir (const char *s) { // Delete the old pointer. delete [] this->temp_dir_; + this->temp_dir_ = 0; // In case the ACE_NEW fails below. + + const size_t lengthSep = sizeof (ACE_DIRECTORY_SEPARATOR_STR_A) - 1u; + const size_t lengthPath = ACE_OS::strlen (s); // Allocate memory, 1 for the end of string. - ACE_NEW (this->temp_dir_, - char [ACE_OS::strlen (s) + - ACE_OS::strlen (ACE_DIRECTORY_SEPARATOR_STR) + - 1]); + ACE_NEW (this->temp_dir_, char [lengthPath + lengthSep + 1u]); // Copy the strings. - ACE_OS::sprintf (this->temp_dir_, - "%s%s", - s, - ACE_DIRECTORY_SEPARATOR_STR); + if (lengthSep < lengthPath && + 0 == ACE_OS::strcmp (s + lengthPath - lengthSep, ACE_DIRECTORY_SEPARATOR_STR_A)) + { + // Already has a directory seporator on end of temp root, don't add another. + ACE_OS::strcpy (this->temp_dir_, s); + } + else + { + // Need to add a directory seporator to temp root. + ACE_OS::sprintf (this->temp_dir_, + "%s%s", + s, + ACE_DIRECTORY_SEPARATOR_STR_A); + } } const char * @@ -1800,7 +1811,7 @@ IDL_GlobalData::add_dcps_data_key (const char* id, const char* key) if (this->dcps_type_info_map_.find (id, newinfo) == 0) { // Add the new key field to the type. - newinfo->key_list_.enqueue_tail (key); + newinfo->key_list_.enqueue_tail (ACE_TEXT_CHAR_TO_TCHAR (key)); return true; } else @@ -1880,7 +1891,7 @@ is_include_file_found (ACE_CString & inc_file, inc_file.substr (1, inc_file.length () - 2); } - inc_file += ACE_DIRECTORY_SEPARATOR_STR; + inc_file += ACE_DIRECTORY_SEPARATOR_STR_A; inc_file += idl_file_name->get_string (); full_path = ACE_OS::realpath (inc_file.c_str (), abspath); @@ -1917,7 +1928,7 @@ IDL_GlobalData::validate_orb_include (UTL_String * idl_file_name) // will change in fe/fe_init.cpp:FE_store_env_include_paths () // then the below do/while loop has to be changed accordingly. unsigned int env_includes = 0; - ACE_Env_Value<char*> incl_paths ("INCLUDE", + ACE_Env_Value<char*> incl_paths (ACE_TEXT ("INCLUDE"), (char *) 0); const char *aggr_str = incl_paths; if (aggr_str != 0) |