From 3f7af0281310ffdc7769a0f587abd6185c09eaa0 Mon Sep 17 00:00:00 2001 From: kitty Date: Wed, 13 Jun 2001 00:02:33 +0000 Subject: ChangeLogTag: Tue Jun 12 18:53:25 2001 Krishnakumar B --- ChangeLog | 34 +++++++ ChangeLogs/ChangeLog-02a | 34 +++++++ ChangeLogs/ChangeLog-03a | 34 +++++++ ace/Basic_Types.h | 12 +++ ace/Configuration.cpp | 210 ++++++++++++++++++++-------------------- ace/Naming_Context.cpp | 2 +- ace/Task.cpp | 2 +- ace/config-linux-common.h | 20 ++++ tests/MEM_Stream_Test.cpp | 4 +- tests/MT_Reactor_Timer_Test.cpp | 2 +- tests/Message_Block_Test.cpp | 2 +- tests/TSS_Test.cpp | 2 +- tests/Thread_Manager_Test.cpp | 2 +- tests/Thread_Pool_Test.cpp | 4 +- 14 files changed, 250 insertions(+), 114 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb7ee503bfa..f9d6bb7cffe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,37 @@ +Tue Jun 12 18:53:25 2001 Krishnakumar B + + * ace/config-linux-common.h: + + Added new printf specifier ACE_SIZE_T_FORMAT_SPECIFIER, + ACE_SSIZE_T_FORMAT_SPECIFIER for use with types size_t and + ssize_t. + + * ace/Basic_Types.h: + + 1. Changed default base address on IA-64 to be 64-bit little endian. + 2. Added default values for ACE_SIZE_T_FORMAT_SPECIFIER, + ACE_SIZE_T_FORMAT_SPECIFIER. + 3. Changed size of LONG_DOUBLE for IA-64. + + * ace/Configuration.cpp: + * ace/Naming_Context.cpp: + * ace/Task.cpp: + + Added a reinterpret_cast to silence gcc. + + * tests/MEM_Stream_Test.cpp: + * tests/MT_Reactor_Timer_Test.cpp: + * tests/Message_Block_Test.cpp: + * tests/TSS_Test.cpp: + * tests/Thread_Manager_Test.cpp: + * tests/Thread_Pool_Test.cpp: + + 1. Fixed usage of ACE_DEBUG with types size_t and ssize_t. + 2. Added ACE_reinterpret_cast to silence warnings about + conversion from integer to pointer of different size. + + ACE runs on Intel IA-64/Linux. + Tue Jun 12 15:06:06 2001 Krishnakumar B * tests/run_test.lst: diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index bb7ee503bfa..f9d6bb7cffe 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,37 @@ +Tue Jun 12 18:53:25 2001 Krishnakumar B + + * ace/config-linux-common.h: + + Added new printf specifier ACE_SIZE_T_FORMAT_SPECIFIER, + ACE_SSIZE_T_FORMAT_SPECIFIER for use with types size_t and + ssize_t. + + * ace/Basic_Types.h: + + 1. Changed default base address on IA-64 to be 64-bit little endian. + 2. Added default values for ACE_SIZE_T_FORMAT_SPECIFIER, + ACE_SIZE_T_FORMAT_SPECIFIER. + 3. Changed size of LONG_DOUBLE for IA-64. + + * ace/Configuration.cpp: + * ace/Naming_Context.cpp: + * ace/Task.cpp: + + Added a reinterpret_cast to silence gcc. + + * tests/MEM_Stream_Test.cpp: + * tests/MT_Reactor_Timer_Test.cpp: + * tests/Message_Block_Test.cpp: + * tests/TSS_Test.cpp: + * tests/Thread_Manager_Test.cpp: + * tests/Thread_Pool_Test.cpp: + + 1. Fixed usage of ACE_DEBUG with types size_t and ssize_t. + 2. Added ACE_reinterpret_cast to silence warnings about + conversion from integer to pointer of different size. + + ACE runs on Intel IA-64/Linux. + Tue Jun 12 15:06:06 2001 Krishnakumar B * tests/run_test.lst: diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index bb7ee503bfa..f9d6bb7cffe 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,37 @@ +Tue Jun 12 18:53:25 2001 Krishnakumar B + + * ace/config-linux-common.h: + + Added new printf specifier ACE_SIZE_T_FORMAT_SPECIFIER, + ACE_SSIZE_T_FORMAT_SPECIFIER for use with types size_t and + ssize_t. + + * ace/Basic_Types.h: + + 1. Changed default base address on IA-64 to be 64-bit little endian. + 2. Added default values for ACE_SIZE_T_FORMAT_SPECIFIER, + ACE_SIZE_T_FORMAT_SPECIFIER. + 3. Changed size of LONG_DOUBLE for IA-64. + + * ace/Configuration.cpp: + * ace/Naming_Context.cpp: + * ace/Task.cpp: + + Added a reinterpret_cast to silence gcc. + + * tests/MEM_Stream_Test.cpp: + * tests/MT_Reactor_Timer_Test.cpp: + * tests/Message_Block_Test.cpp: + * tests/TSS_Test.cpp: + * tests/Thread_Manager_Test.cpp: + * tests/Thread_Pool_Test.cpp: + + 1. Fixed usage of ACE_DEBUG with types size_t and ssize_t. + 2. Added ACE_reinterpret_cast to silence warnings about + conversion from integer to pointer of different size. + + ACE runs on Intel IA-64/Linux. + Tue Jun 12 15:06:06 2001 Krishnakumar B * tests/run_test.lst: diff --git a/ace/Basic_Types.h b/ace/Basic_Types.h index 359798cfabd..1264045db5a 100644 --- a/ace/Basic_Types.h +++ b/ace/Basic_Types.h @@ -466,6 +466,14 @@ typedef ACE_UINT16 ACE_USHORT16; # define ACE_INT64_FORMAT_SPECIFIER ACE_LIB_TEXT ("%lld") #endif /* ACE_INT64_FORMAT_SPECIFIER */ +#if !defined (ACE_SSIZE_T_FORMAT_SPECIFIER) +# define ACE_SSIZE_T_FORMAT_SPECIFIER ACE_LIB_TEXT ("%d") +#endif /* ACE_SSIZE_T_FORMAT_SPECIFIER */ + +#if !defined (ACE_SIZE_T_FORMAT_SPECIFIER) +# define ACE_SIZE_T_FORMAT_SPECIFIER ACE_LIB_TEXT ("%u") +#endif /* ACE_SIZE_T_FORMAT_SPECIFIER */ + // Cast from UINT64 to a double requires an intermediate cast to INT64 // on some platforms. # if defined (ACE_LACKS_LONGLONG_T) @@ -508,7 +516,11 @@ typedef ACE_UINT16 ACE_USHORT16; # define ACE_SIZEOF_LONG_DOUBLE 8 # elif LDBL_MAX_EXP == 16384 # if defined (LDBL_DIG) && LDBL_DIG == 18 +# if defined (__ia64) +# define ACE_SIZEOF_LONG_DOUBLE 16 +# else /* ! __ia64 */ # define ACE_SIZEOF_LONG_DOUBLE 12 +# endif /* __ia64 */ # else /* ! LDBL_DIG || LDBL_DIG != 18 */ # define ACE_SIZEOF_LONG_DOUBLE 16 # endif /* ! LDBL_DIG || LDBL_DIG != 18 */ diff --git a/ace/Configuration.cpp b/ace/Configuration.cpp index ce1da480d24..8b78305fc5b 100644 --- a/ace/Configuration.cpp +++ b/ace/Configuration.cpp @@ -160,54 +160,54 @@ ACE_Configuration::get_internal_key (const ACE_Configuration_Section_Key& key) return key.key_; } -int -ACE_Configuration::expand_path (const ACE_Configuration_Section_Key& key, - const ACE_TString& path_in, - ACE_Configuration_Section_Key& key_out, - int create) -{ - // Make a copy of key - ACE_Configuration_Section_Key current_section = key; - ACE_Auto_Basic_Array_Ptr pData (path_in.rep ()); - ACE_Tokenizer parser (pData.get ()); - parser.delimiter_replace ('\\', '\0'); - parser.delimiter_replace ('/', '\0'); - - for (ACE_TCHAR *temp = parser.next (); - temp != 0; - temp = parser.next ()) - { - // Open the section - if (open_section (current_section, - temp, - create, - key_out)) - return -1; - - current_section = key_out; - } - - return 0; - -} +int +ACE_Configuration::expand_path (const ACE_Configuration_Section_Key& key, + const ACE_TString& path_in, + ACE_Configuration_Section_Key& key_out, + int create) +{ + // Make a copy of key + ACE_Configuration_Section_Key current_section = key; + ACE_Auto_Basic_Array_Ptr pData (path_in.rep ()); + ACE_Tokenizer parser (pData.get ()); + parser.delimiter_replace ('\\', '\0'); + parser.delimiter_replace ('/', '\0'); + + for (ACE_TCHAR *temp = parser.next (); + temp != 0; + temp = parser.next ()) + { + // Open the section + if (open_section (current_section, + temp, + create, + key_out)) + return -1; + + current_section = key_out; + } + + return 0; + +} int ACE_Configuration::validate_name (const ACE_TCHAR* name) { - const ACE_TCHAR *pos; + const ACE_TCHAR *pos; - for (pos = name; - // Make sure it doesn't contain any invalid characters - *pos != '\0'; - pos++) - if (ACE_OS::strchr (ACE_LIB_TEXT ("\\]["), *pos)) - return -1; + for (pos = name; + // Make sure it doesn't contain any invalid characters + *pos != '\0'; + pos++) + if (ACE_OS::strchr (ACE_LIB_TEXT ("\\]["), *pos)) + return -1; - // Make sure its not too long. - if (pos - name > 255) - return -2; + // Make sure its not too long. + if (pos - name > 255) + return -2; - return 0; + return 0; } @@ -404,7 +404,7 @@ int ACE_Configuration::operator== (const ACE_Configuration& rhs) const // Finally, make sure that there are no sections in rhs that do not // exist in this sectionIndex = 0; - while ((rc) + while ((rc) && (!nonconst_rhs.enumerate_sections (rhsRoot, sectionIndex, sectionName))) @@ -451,16 +451,16 @@ ACE_Section_Key_Win32::~ACE_Section_Key_Win32 (void) ////////////////////////////////////////////////////////////////////////////// -int +int ACE_Configuration_Win32Registry::operator== (const ACE_Configuration_Win32Registry &rhs) const { ACE_UNUSED_ARG (rhs); - return 1; + return 1; } -int +int ACE_Configuration_Win32Registry::operator!=(const ACE_Configuration_Win32Registry &rhs) const -{ +{ ACE_UNUSED_ARG (rhs); return 1; } @@ -832,7 +832,7 @@ ACE_Configuration_Win32Registry::get_binary_value (const ACE_Configuration_Secti return 0; } -int +int ACE_Configuration_Win32Registry::find_value (const ACE_Configuration_Section_Key& key, const ACE_TCHAR* name, VALUETYPE& type_out) @@ -844,7 +844,7 @@ ACE_Configuration_Win32Registry::find_value (const ACE_Configuration_Section_Key if (load_key (key, base_key)) return -1; - DWORD buffer_length=0; + DWORD buffer_length=0; DWORD type; int result=ACE_TEXT_RegQueryValueEx (base_key, name, @@ -904,61 +904,61 @@ ACE_Configuration_Win32Registry::load_key (const ACE_Configuration_Section_Key& return 0; } -HKEY -ACE_Configuration_Win32Registry::resolve_key (HKEY hKey, - const ACE_TCHAR* path, - int create) -{ - HKEY result = 0; - // Make a copy of hKey - if (::RegOpenKey (hKey, NULL, &result) != ERROR_SUCCESS) - return 0; - - // recurse through the path - ACE_Auto_Basic_Array_Ptr pData (new ACE_TCHAR[ACE_OS::strlen (path) + 1]); - ACE_OS::strcpy (pData.get (), path); - ACE_Tokenizer parser (pData.get ()); - parser.delimiter_replace ('\\', '\0'); - parser.delimiter_replace ('/', '\0'); - - for (ACE_TCHAR *temp = parser.next (); - temp != 0; - temp = parser.next ()) - { - // Open the key - HKEY subkey; - if (ACE_TEXT_RegOpenKey (result, - temp, - &subkey) != ERROR_SUCCESS) - { - // try creating it - if (!create || ACE_TEXT_RegCreateKeyEx (result, - temp, - 0, - NULL, - 0, - KEY_ALL_ACCESS, - NULL, - &subkey, -#if defined (__MINGW32__) - (PDWORD) 0 -#else - NULL -#endif /* __MINGW32__ */ - ) != ERROR_SUCCESS) - { - // error - ::RegCloseKey (result); - return 0; - } - } - // release our open key handle - ::RegCloseKey (result); - result = subkey; - } - - return result; -} +HKEY +ACE_Configuration_Win32Registry::resolve_key (HKEY hKey, + const ACE_TCHAR* path, + int create) +{ + HKEY result = 0; + // Make a copy of hKey + if (::RegOpenKey (hKey, NULL, &result) != ERROR_SUCCESS) + return 0; + + // recurse through the path + ACE_Auto_Basic_Array_Ptr pData (new ACE_TCHAR[ACE_OS::strlen (path) + 1]); + ACE_OS::strcpy (pData.get (), path); + ACE_Tokenizer parser (pData.get ()); + parser.delimiter_replace ('\\', '\0'); + parser.delimiter_replace ('/', '\0'); + + for (ACE_TCHAR *temp = parser.next (); + temp != 0; + temp = parser.next ()) + { + // Open the key + HKEY subkey; + if (ACE_TEXT_RegOpenKey (result, + temp, + &subkey) != ERROR_SUCCESS) + { + // try creating it + if (!create || ACE_TEXT_RegCreateKeyEx (result, + temp, + 0, + NULL, + 0, + KEY_ALL_ACCESS, + NULL, + &subkey, +#if defined (__MINGW32__) + (PDWORD) 0 +#else + NULL +#endif /* __MINGW32__ */ + ) != ERROR_SUCCESS) + { + // error + ::RegCloseKey (result); + return 0; + } + } + // release our open key handle + ::RegCloseKey (result); + result = subkey; + } + + return result; +} #endif /* WIN_32 */ @@ -980,7 +980,7 @@ ACE_Configuration_Value_IntId::ACE_Configuration_Value_IntId (ACE_TCHAR* string) ACE_Configuration_Value_IntId::ACE_Configuration_Value_IntId (u_int integer) : type_ (ACE_Configuration::INTEGER), - data_ ((void*) integer), + data_ (ACE_reinterpret_cast (void*, integer)), length_ (0) { } @@ -1827,7 +1827,7 @@ ACE_Configuration_Heap::set_binary_value (const ACE_Configuration_Section_Key& k if (IntId.value_hash_map_->find (VExtIdFind, VIntIdFind, allocator_)) { // it doesn't exist, bind it - ACE_TCHAR* pers_name = + ACE_TCHAR* pers_name = (ACE_TCHAR *) allocator_->malloc ((ACE_OS::strlen (name) + 1) * sizeof (ACE_TCHAR)); ACE_OS::strcpy (pers_name, name); ACE_TCHAR* pers_value = diff --git a/ace/Naming_Context.cpp b/ace/Naming_Context.cpp index 91eda1b7d30..2f442632513 100644 --- a/ace/Naming_Context.cpp +++ b/ace/Naming_Context.cpp @@ -637,7 +637,7 @@ ACE_Name_Options::parse_args (int argc, ACE_TCHAR *argv[]) this->database (get_opt.optarg); break; case 'b': - this->base_address ((char *) ACE_OS::atoi (get_opt.optarg)); + this->base_address (ACE_reinterpret_cast (char *, ACE_OS::atoi (get_opt.optarg))); break; case 'T': if (ACE_OS::strcasecmp (get_opt.optarg, ACE_LIB_TEXT ("ON")) == 0) diff --git a/ace/Task.cpp b/ace/Task.cpp index 3856f3dee92..b073c27eaed 100644 --- a/ace/Task.cpp +++ b/ace/Task.cpp @@ -200,7 +200,7 @@ ACE_Task_Base::svc_run (void *args) #endif /* ACE_HAS_SIG_C_FUNC */ // Call the Task's svc() hook method. - void *status = (void *) t->svc (); + void * status = ACE_reinterpret_cast(void *, t->svc ()); // If we changed this zero change the other if in OS.cpp Thread_Adapter::invoke #if 1 diff --git a/ace/config-linux-common.h b/ace/config-linux-common.h index 0e609e09d7c..a41c0a74834 100644 --- a/ace/config-linux-common.h +++ b/ace/config-linux-common.h @@ -154,7 +154,11 @@ #define ACE_LACKS_WCSNICMP #if !defined (ACE_DEFAULT_BASE_ADDR) +# if defined (__ia64) +# define ACE_DEFAULT_BASE_ADDR ((char *) 0x0000000080000000) +# else /* ! __ia64 */ # define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000) +# endif /* __ia64 */ #endif /* ! ACE_DEFAULT_BASE_ADDR */ // Compiler/platform supports alloca(). @@ -251,7 +255,23 @@ #define ACE_HAS_DIRENT +#if defined (__ia64) +# define ACE_UINT64_FORMAT_SPECIFIER "%lu" +#else /* ! __ia64 */ # define ACE_UINT64_FORMAT_SPECIFIER "%Lu" +#endif /* __ia64 */ + +#if defined (__ia64) +# define ACE_SSIZE_T_FORMAT_SPECIFIER "%ld" +#else /* ! __ia64 */ +# define ACE_SSIZE_T_FORMAT_SPECIFIER "%d" +#endif /* __ia64 */ + +#if defined (__ia64) +# define ACE_SIZE_T_FORMAT_SPECIFIER "%lu" +#else /* ! __ia64 */ +# define ACE_SIZE_T_FORMAT_SPECIFIER "%u" +#endif /* __ia64 */ #if !defined (ACE_TIMER_SKEW) # define ACE_TIMER_SKEW 10 * 1000 diff --git a/tests/MEM_Stream_Test.cpp b/tests/MEM_Stream_Test.cpp index 18e6ae7ed4c..d7e05cb349d 100644 --- a/tests/MEM_Stream_Test.cpp +++ b/tests/MEM_Stream_Test.cpp @@ -173,7 +173,9 @@ connect_client (void *arg) for (ssize_t cntr = 0; cntr < NO_OF_ITERATION; cntr ++) { - ACE_OS::sprintf (buf, ACE_TEXT ("Iteration %d"), cntr); + ACE_OS::sprintf (buf, ACE_TEXT ("Iteration ")ACE_SSIZE_T_FORMAT_SPECIFIER, + cntr); + ssize_t slen = (ACE_OS::strlen (buf) + 1) * sizeof (ACE_TCHAR); if (stream.send (buf, slen) < slen) diff --git a/tests/MT_Reactor_Timer_Test.cpp b/tests/MT_Reactor_Timer_Test.cpp index 566ae8c9bad..a506fe3fe5c 100644 --- a/tests/MT_Reactor_Timer_Test.cpp +++ b/tests/MT_Reactor_Timer_Test.cpp @@ -277,7 +277,7 @@ main (int, ACE_TCHAR *[]) for (int i = ACE_MAX_TIMERS; i > 0; i--) // Schedule a timeout to expire immediately. if (r->schedule_timer (&callback, - (const void *) i, + ACE_reinterpret_cast (const void *, i), ACE_Time_Value (0)) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), diff --git a/tests/Message_Block_Test.cpp b/tests/Message_Block_Test.cpp index eb0e93d1f1a..92f490b0897 100644 --- a/tests/Message_Block_Test.cpp +++ b/tests/Message_Block_Test.cpp @@ -201,7 +201,7 @@ produce (Worker_Task &worker_task, for (size_t count = 0; count < n_iterations; count++) { ACE_TCHAR buf[BUFSIZ]; - ACE_OS::sprintf (buf, ACE_TEXT ("%d\n"), count); + ACE_OS::sprintf (buf, ACE_SIZE_T_FORMAT_SPECIFIER, count); int n = (ACE_OS::strlen (buf) + 1) * sizeof (ACE_TCHAR); diff --git a/tests/TSS_Test.cpp b/tests/TSS_Test.cpp index ea14892df29..880c1f75f7d 100644 --- a/tests/TSS_Test.cpp +++ b/tests/TSS_Test.cpp @@ -282,7 +282,7 @@ main (int, ACE_TCHAR *[]) if (ACE_Thread_Manager::instance ()->spawn_n (threads, ACE_THR_FUNC (worker), - (void *) ITERATIONS, + ACE_reinterpret_cast (void *, ITERATIONS), THR_BOUND) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("spawn_n")), 1); diff --git a/tests/Thread_Manager_Test.cpp b/tests/Thread_Manager_Test.cpp index f06e3d45603..5b926a63a42 100644 --- a/tests/Thread_Manager_Test.cpp +++ b/tests/Thread_Manager_Test.cpp @@ -218,7 +218,7 @@ main (int, ACE_TCHAR *[]) #endif /* VXWORKS */ n_threads, (ACE_THR_FUNC) worker, - (void *) n_iterations, + ACE_reinterpret_cast (void *, n_iterations), THR_BOUND #if defined (VXWORKS) , ACE_DEFAULT_THREAD_PRIORITY diff --git a/tests/Thread_Pool_Test.cpp b/tests/Thread_Pool_Test.cpp index e8a6decd8e8..be0d1d0b56d 100644 --- a/tests/Thread_Pool_Test.cpp +++ b/tests/Thread_Pool_Test.cpp @@ -230,7 +230,7 @@ Thread_Pool::test_queue_deactivation_shutdown (void) static size_t count = 0; ACE_OS::sprintf (mb->wr_ptr (), - "%d\n", + ACE_SIZE_T_FORMAT_SPECIFIER, count); n = ACE_OS::strlen (mb->rd_ptr ()); @@ -320,7 +320,7 @@ Thread_Pool::test_empty_message_shutdown (void) static size_t count = 0; ACE_OS::sprintf (mb->wr_ptr (), - "%d\n", + ACE_SIZE_T_FORMAT_SPECIFIER, count); n = ACE_OS::strlen (mb->rd_ptr ()); -- cgit v1.2.1