diff options
30 files changed, 367 insertions, 228 deletions
diff --git a/ChangeLog b/ChangeLog index 384158346e8..75654d53e7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,40 @@ +Thu Nov 15 08:26:57 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> + + * ace/*.cpp: Changed all remaining uses of ACE_TEXT to ACE_LIB_TEXT + to be consistent... Thanks to Johnny Willemsen for reporting + the inconsistencies and for Darrell Brunsch for clarifying what + the right behavior should be. + +Wed Nov 14 07:43:20 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> + + * docs/ACE-guidelines.html: Updated the guidelines to explain + the use of ACE_TCHAR for the argv parameter to main(). Thanks + to Johnny Willemsen for reporting this. + + * ace/OS_Dirent.inl (opendir): Replace char * const cast with + ACE_TCHAR * const cast. Thanks to Nick Pratt for reporting + this. + + * tests/Upgradable_RW_Test.cpp (main): Fixed the test to avoid + dividing by 0 and also initialized all pointers to NULL. Thanks + to Johnny Willemsen for reporting this. Thanks fixes BudID 650. + +Tue Nov 13 15:25:04 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu> + + * ace/ACE.h (ACE): Clarified what the time_len parameter is used for. + Thanks to Tompa <safdsfd@adsffda.com> for reporting this. + +Sun Nov 11 09:50:52 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> + + * ace/Naming_Context.cpp (info): Added an ACE_UNUSED_ARG to + silence warning about "length" parameter and changed buf from + char to ACE_TCHAR. Thanks to Johnny Willemsen for reporting + this. + + * tests/Aio_Platform_Test.cpp: The argv parameter of main() should + be ACE_TCHAR rather than char. Thanks to Johnny Willemsen for + reporting this. + Thu Nov 15 15:43:20 2001 Craig Rodrigues <crodrigu@bbn.com> * ace/Naming_Context.cpp (info): Wrapped sprintf() arguments with @@ -42,10 +79,10 @@ Tue Nov 13 15:04:15 2001 Carlos O'Ryan <coryan@uci.edu> Tue Nov 13 11:46:11 2001 Chris Cleeland <cleeland_c@ociweb.com> - * tests/Collection_Test.cpp (iterate_const): Fixed ACE_DEBUG print - statements that were accessing the element of the unbounded set as - an int rather than an UglyThing. Thanks to Ossama for pointing - this out. + * tests/Collection_Test.cpp (iterate_const): Fixed ACE_DEBUG print + statements that were accessing the element of the unbounded set + as an int rather than an UglyThing. Thanks to Ossama for + pointing this out. Mon Nov 12 11:41:35 2001 Ossama Othman <ossama@uci.edu> diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index 384158346e8..75654d53e7e 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,40 @@ +Thu Nov 15 08:26:57 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> + + * ace/*.cpp: Changed all remaining uses of ACE_TEXT to ACE_LIB_TEXT + to be consistent... Thanks to Johnny Willemsen for reporting + the inconsistencies and for Darrell Brunsch for clarifying what + the right behavior should be. + +Wed Nov 14 07:43:20 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> + + * docs/ACE-guidelines.html: Updated the guidelines to explain + the use of ACE_TCHAR for the argv parameter to main(). Thanks + to Johnny Willemsen for reporting this. + + * ace/OS_Dirent.inl (opendir): Replace char * const cast with + ACE_TCHAR * const cast. Thanks to Nick Pratt for reporting + this. + + * tests/Upgradable_RW_Test.cpp (main): Fixed the test to avoid + dividing by 0 and also initialized all pointers to NULL. Thanks + to Johnny Willemsen for reporting this. Thanks fixes BudID 650. + +Tue Nov 13 15:25:04 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu> + + * ace/ACE.h (ACE): Clarified what the time_len parameter is used for. + Thanks to Tompa <safdsfd@adsffda.com> for reporting this. + +Sun Nov 11 09:50:52 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> + + * ace/Naming_Context.cpp (info): Added an ACE_UNUSED_ARG to + silence warning about "length" parameter and changed buf from + char to ACE_TCHAR. Thanks to Johnny Willemsen for reporting + this. + + * tests/Aio_Platform_Test.cpp: The argv parameter of main() should + be ACE_TCHAR rather than char. Thanks to Johnny Willemsen for + reporting this. + Thu Nov 15 15:43:20 2001 Craig Rodrigues <crodrigu@bbn.com> * ace/Naming_Context.cpp (info): Wrapped sprintf() arguments with @@ -42,10 +79,10 @@ Tue Nov 13 15:04:15 2001 Carlos O'Ryan <coryan@uci.edu> Tue Nov 13 11:46:11 2001 Chris Cleeland <cleeland_c@ociweb.com> - * tests/Collection_Test.cpp (iterate_const): Fixed ACE_DEBUG print - statements that were accessing the element of the unbounded set as - an int rather than an UglyThing. Thanks to Ossama for pointing - this out. + * tests/Collection_Test.cpp (iterate_const): Fixed ACE_DEBUG print + statements that were accessing the element of the unbounded set + as an int rather than an UglyThing. Thanks to Ossama for + pointing this out. Mon Nov 12 11:41:35 2001 Ossama Othman <ossama@uci.edu> diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index 384158346e8..75654d53e7e 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,40 @@ +Thu Nov 15 08:26:57 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> + + * ace/*.cpp: Changed all remaining uses of ACE_TEXT to ACE_LIB_TEXT + to be consistent... Thanks to Johnny Willemsen for reporting + the inconsistencies and for Darrell Brunsch for clarifying what + the right behavior should be. + +Wed Nov 14 07:43:20 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> + + * docs/ACE-guidelines.html: Updated the guidelines to explain + the use of ACE_TCHAR for the argv parameter to main(). Thanks + to Johnny Willemsen for reporting this. + + * ace/OS_Dirent.inl (opendir): Replace char * const cast with + ACE_TCHAR * const cast. Thanks to Nick Pratt for reporting + this. + + * tests/Upgradable_RW_Test.cpp (main): Fixed the test to avoid + dividing by 0 and also initialized all pointers to NULL. Thanks + to Johnny Willemsen for reporting this. Thanks fixes BudID 650. + +Tue Nov 13 15:25:04 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu> + + * ace/ACE.h (ACE): Clarified what the time_len parameter is used for. + Thanks to Tompa <safdsfd@adsffda.com> for reporting this. + +Sun Nov 11 09:50:52 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> + + * ace/Naming_Context.cpp (info): Added an ACE_UNUSED_ARG to + silence warning about "length" parameter and changed buf from + char to ACE_TCHAR. Thanks to Johnny Willemsen for reporting + this. + + * tests/Aio_Platform_Test.cpp: The argv parameter of main() should + be ACE_TCHAR rather than char. Thanks to Johnny Willemsen for + reporting this. + Thu Nov 15 15:43:20 2001 Craig Rodrigues <crodrigu@bbn.com> * ace/Naming_Context.cpp (info): Wrapped sprintf() arguments with @@ -42,10 +79,10 @@ Tue Nov 13 15:04:15 2001 Carlos O'Ryan <coryan@uci.edu> Tue Nov 13 11:46:11 2001 Chris Cleeland <cleeland_c@ociweb.com> - * tests/Collection_Test.cpp (iterate_const): Fixed ACE_DEBUG print - statements that were accessing the element of the unbounded set as - an int rather than an UglyThing. Thanks to Ossama for pointing - this out. + * tests/Collection_Test.cpp (iterate_const): Fixed ACE_DEBUG print + statements that were accessing the element of the unbounded set + as an int rather than an UglyThing. Thanks to Ossama for + pointing this out. Mon Nov 12 11:41:35 2001 Ossama Othman <ossama@uci.edu> diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 61a1d8128a0..a45d3a85e41 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -41,7 +41,6 @@ Tue Nov 13 18:01:57 2001 Craig Rodrigues <crodrigu@bbn.com> * orbsvcs/orbsvcs/AV/RTCP_Channel.cpp: Fixed comment. - Tue Nov 13 14:31:44 2001 Craig Rodrigues <crodrigu@bbn.com> * orbsvcs/orbsvcs/AV.dsp: (updated) @@ -72,63 +71,79 @@ Tue Nov 13 14:14:24 2001 Craig Rodrigues <crodrigu@bbn.com> only allows one flow between stream endpoints). The code was modified to allow data and control information to be passed as part of the same flow. + * orbsvcs/orbsvcs/AV/AVStreams_i.cpp: Added/renamed several properties defined in the CORBA AV spec. Implemented the TAO_StreamCtrl::unbind operation. Fixed several memory leaks. + * orbsvcs/orbsvcs/AV/AV_Core.cpp: Added code to clean up transport/flow factories (fix memory leak). Added get_transport_factory(const char *transport_protocol). Added get_flow_protocol_factory(const char *flow_protocol). + * orbsvcs/orbsvcs/AV/AV_Core.h: Added get_transport_factory(const char *transport_protocol). Added get_flow_protocol_factory(const char *flow_protocol). + * orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp: Added a remove_ref call to activate_mediactrl. + * orbsvcs/orbsvcs/AV/FlowSpec_Entry.cpp: Changed the flow specification to better conform to the AV Service spec. + * orbsvcs/orbsvcs/AV/MCast.cpp: TAO_AV_UDP_MCast_Flow_Handler::handle_input now returns the value returned by protocol_object->handle_input rather than 0. + * orbsvcs/orbsvcs/AV/MCast.h: Made the TAO_AV_UDP_MCast_Flow_Handler destructor virtual. + * orbsvcs/orbsvcs/AV/RTCP.cpp: * orbsvcs/orbsvcs/AV/RTCP.h: Added full RFC compliant RTCP control protocol implementation. Modified the ssrc allocation operation to use the MD5 algorithm to more reliably choose a unique id. + * orbsvcs/orbsvcs/AV/RTCP_Channel.h: (added) * orbsvcs/orbsvcs/AV/RTCP_Channel.cpp: (added) These files contain two classes, one used to represent incoming RTP streams and one to represent outgoing streams. They keep track of transmission/reception statistics. + * orbsvcs/orbsvcs/AV/RTCP_Packet.h: (added) * orbsvcs/orbsvcs/AV/RTCP_Packet.cpp: (added) These files contain classes to represent each of the control packet message types. + * orbsvcs/orbsvcs/AV/RTP.cpp: * orbsvcs/orbsvcs/AV/RTP.h: Made several changes to support the RTCP implementation. Added a class to represent an RTP packet. + * orbsvcs/orbsvcs/AV/Transport.cpp: Modified code to use the get_xxx_factory routines added to AV_Core rather than doing the search in this file. + * orbsvcs/orbsvcs/AV/UDP.cpp: When the protocol is RTP/UDP, an even/odd port pair will be reserved as is called out in the RTP RFC. The class TAO_AV_UDP_Connection_Setup was added to replace duplicated code used for both the TAO_AV_UDP_Acceptor and TAO_AV_UDP_Connector. + * orbsvcs/orbsvcs/AV/global.h: (added) * orbsvcs/orbsvcs/AV/md5.h: (added) * orbsvcs/orbsvcs/AV/md5c.c: (added) Used by the operation to allocate ssrc's in RTCP.cpp to help guarantee a unique id. + * orbsvcs/orbsvcs/AV/source.cpp: (removed) * orbsvcs/orbsvcs/AV/source.h: (removed) * orbsvcs/orbsvcs/AV/source.i: (removed) The functionality contained in these files is now implemented in the RTCP*.* files. + * orbsvcs/orbsvcs/Makefile.av: (updated) * orbsvcs/orbsvcs/AV.bor: (updated) diff --git a/ace/ACE.h b/ace/ACE.h index 4765f1f83b9..414644718ad 100644 --- a/ace/ACE.h +++ b/ace/ACE.h @@ -408,15 +408,15 @@ public: * <pathname> and is not reentrant. */ static const ACE_TCHAR *dirname (const ACE_TCHAR *pathname, - ACE_TCHAR delim = - ACE_DIRECTORY_SEPARATOR_CHAR); + ACE_TCHAR delim = ACE_DIRECTORY_SEPARATOR_CHAR); /** * Returns the current timestamp in the form * "hour:minute:second:microsecond." The month, day, and year are - * also stored in the beginning of the date_and_time array. Returns + * also stored in the beginning of the <date_and_time> array, which + * is a user-supplied array of size <time_len> <ACE_TCHAR>s. Returns * 0 if unsuccessful, else returns pointer to beginning of the - * "time" portion of <day_and_time>. If + * "time" portion of <date_and_time>. If * <return_pointer_to_first_digit> is 0 then return a pointer to the * space before the time, else return a pointer to the beginning of * the time portion. diff --git a/ace/ATM_Addr.cpp b/ace/ATM_Addr.cpp index ccc02252c03..d03ae5c5d09 100644 --- a/ace/ATM_Addr.cpp +++ b/ace/ATM_Addr.cpp @@ -41,7 +41,7 @@ const int ACE_ATM_Addr::DEFAULT_SELECTOR = 0x0; // Default constructor -ACE_ATM_Addr::ACE_ATM_Addr (unsigned char selector) +ACE_ATM_Addr::ACE_ATM_Addr (u_char selector) #if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) : ACE_Addr (AF_ATM, #elif defined (ACE_HAS_LINUX_ATM) @@ -52,7 +52,7 @@ ACE_ATM_Addr::ACE_ATM_Addr (unsigned char selector) sizeof this->atm_addr_) { // ACE_TRACE ("ACE_ATM_Addr::ACE_ATM_Addr"); - (void) ACE_OS::memset ((void *) &this->atm_addr_, + (void) ACE_OS::memset ((void *) &this->atm_addr_, 0, sizeof this->atm_addr_); this->init (selector); @@ -61,7 +61,7 @@ ACE_ATM_Addr::ACE_ATM_Addr (unsigned char selector) // Copy constructor. ACE_ATM_Addr::ACE_ATM_Addr (const ACE_ATM_Addr &sap, - unsigned char selector) + u_char selector) #if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) : ACE_Addr (AF_ATM, #elif defined (ACE_HAS_LINUX_ATM) @@ -82,7 +82,7 @@ ACE_ATM_Addr::ACE_ATM_Addr (const ACE_ATM_Addr &sap, } ACE_ATM_Addr::ACE_ATM_Addr (const ATM_Addr *sap, - unsigned char selector) + u_char selector) #if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) : ACE_Addr (AF_ATM, #elif defined (ACE_HAS_LINUX_ATM) @@ -98,7 +98,7 @@ ACE_ATM_Addr::ACE_ATM_Addr (const ATM_Addr *sap, ACE_ATM_Addr::ACE_ATM_Addr (const ACE_TCHAR sap[], - unsigned char selector) + u_char selector) #if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) : ACE_Addr (AF_ATM, #elif defined (ACE_HAS_LINUX_ATM) @@ -113,14 +113,14 @@ ACE_ATM_Addr::ACE_ATM_Addr (const ACE_TCHAR sap[], } void -ACE_ATM_Addr::init (unsigned char selector) +ACE_ATM_Addr::init (u_char selector) { #if defined (ACE_HAS_FORE_ATM_XTI) // Note: this approach may be FORE implementation-specific. When we // bind with tag_addr ABSENT and tag_selector PRESENT, only the // selector (i.e. address[19]) is used by the TP. The rest of the // local address is filled in by the TP and can be obtained via the - // 'ret' parameter or with t_getname()/t_getprotaddr(). + // 'ret' parameter or with t_getname ()/t_getprotaddr (). atm_addr_.addressType = (u_int16_t) AF_ATM; @@ -141,8 +141,8 @@ ACE_ATM_Addr::init (unsigned char selector) BHLI_MAGIC, sizeof atm_addr_.sap.t_atm_sap_appl.ID); #elif defined (ACE_HAS_FORE_ATM_WS2) - ACE_OS::memset(( void *)&atm_addr_, 0, sizeof atm_addr_ ); - atm_addr_.satm_number.Addr[ ATM_ADDR_SIZE - 1 ] = ( char )selector; + ACE_OS::memset ((void *)&atm_addr_, 0, sizeof atm_addr_); + atm_addr_.satm_number.Addr[ ATM_ADDR_SIZE - 1 ] = (char)selector; atm_addr_.satm_family = AF_ATM; atm_addr_.satm_number.AddressType = ATM_NSAP; atm_addr_.satm_number.NumofDigits = ATM_ADDR_SIZE; @@ -158,7 +158,7 @@ ACE_ATM_Addr::init (unsigned char selector) // sizeof atm_addr_.sap.t_atm_sap_appl.ID); #elif defined (ACE_HAS_LINUX_ATM) atm_addr_.sockaddratmsvc.sas_family = AF_ATMSVC; - atm_addr_.sockaddratmsvc.sas_addr.prv[ATM_ESA_LEN - 1] = ( char )selector; + atm_addr_.sockaddratmsvc.sas_addr.prv[ATM_ESA_LEN - 1] = (char)selector; atm_addr_.atmsap.blli[0].l3_proto = ATM_L3_NONE; atm_addr_.atmsap.blli[0].l2_proto = ATM_L2_NONE; atm_addr_.atmsap.bhli.hl_type = ATM_HL_NONE; @@ -169,7 +169,7 @@ ACE_ATM_Addr::init (unsigned char selector) int ACE_ATM_Addr::set (const ACE_ATM_Addr &sap, - unsigned char selector) + u_char selector) { ACE_TRACE ("ACE_ATM_Addr::set"); @@ -184,15 +184,15 @@ ACE_ATM_Addr::set (const ACE_ATM_Addr &sap, ACE_ASSERT (sap.get_type () == PF_ATMSVC); #endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 */ - (void) ACE_OS::memcpy ((void *) &this->atm_addr_, - (void *) &sap.atm_addr_, + (void) ACE_OS::memcpy ((void *) &this->atm_addr_, + (void *) &sap.atm_addr_, sizeof this->atm_addr_); return 0; } int ACE_ATM_Addr::set (const ATM_Addr *sap, - unsigned char selector) + u_char selector) { ACE_TRACE ("ACE_ATM_Addr::set"); @@ -207,15 +207,15 @@ ACE_ATM_Addr::set (const ATM_Addr *sap, #endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 */ sizeof (*sap)); - (void) ACE_OS::memcpy ((void *) &this->atm_addr_, - (void *) sap, + (void) ACE_OS::memcpy ((void *) &this->atm_addr_, + (void *) sap, sizeof this->atm_addr_); return 0; } int ACE_ATM_Addr::set (const ACE_TCHAR address[], - unsigned char selector) + u_char selector) { ACE_TRACE ("ACE_ATM_Addr::set"); int ret; @@ -224,11 +224,11 @@ ACE_ATM_Addr::set (const ACE_TCHAR address[], #if defined (ACE_HAS_FORE_ATM_XTI) atm_addr_.sap.t_atm_sap_addr.SVE_tag_addr = - (int8_t) T_ATM_PRESENT; + (int8_t) T_ATM_PRESENT; #endif /* ACE_HAS_FORE_ATM_XTI */ - ret = this -> string_to_addr( address ); - this -> set_selector( selector ); + ret = this -> string_to_addr (address); + this -> set_selector (selector); return ret; } @@ -257,7 +257,7 @@ ACE_ATM_Addr::string_to_addr (const ACE_TCHAR sap[]) errno = EINVAL; return -1; } - else if ((entry = gethostbyname_atmnsap((ACE_TCHAR *)sap)) != 0) + else if ((entry = gethostbyname_atmnsap ((ACE_TCHAR *)sap)) != 0) { ACE_OS::memcpy (atm_addr_.sap.t_atm_sap_addr.address, entry->h_addr_list[0], @@ -280,7 +280,7 @@ ACE_ATM_Addr::string_to_addr (const ACE_TCHAR sap[]) CSADDR_INFO csaBuffer; WCHAR tmpWStr[100]; - MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, sap, -1, tmpWStr, 100); + MultiByteToWideChar (CP_ACP, MB_PRECOMPOSED, sap, -1, tmpWStr, 100); csaBuffer.LocalAddr.iSockaddrLength = sizeof (struct sockaddr_atm); csaBuffer.LocalAddr.lpSockaddr = (struct sockaddr *)&atm_addr_; @@ -302,41 +302,41 @@ ACE_ATM_Addr::string_to_addr (const ACE_TCHAR sap[]) qsRestrictions.lpcsaBuffer = &csaBuffer; qsRestrictions.lpBlob = NULL; //&blob; - if ( ::WSALookupServiceBeginW(&qsRestrictions, LUP_RETURN_ALL, &hLookup) + if (::WSALookupServiceBeginW (&qsRestrictions, LUP_RETURN_ALL, &hLookup) == SOCKET_ERROR) { - ACE_OS::printf( "Error: WSALookupServiceBeginW failed! %d\n", - ::WSAGetLastError()); + ACE_OS::printf ("Error: WSALookupServiceBeginW failed! %d\n", + ::WSAGetLastError ()); return -1; } dwValue = sizeof (WSAQUERYSETW); - if ( ::WSALookupServiceNextW( hLookup, 0, &dwValue, &qsRestrictions) + if (::WSALookupServiceNextW (hLookup, 0, &dwValue, &qsRestrictions) == SOCKET_ERROR) { - if ( WSAGetLastError() != WSA_E_NO_MORE ) { - ACE_OS::printf( "Error: WSALookupServiceNextW failed! %d\n", - ::WSAGetLastError()); + if (WSAGetLastError () != WSA_E_NO_MORE) { + ACE_OS::printf ("Error: WSALookupServiceNextW failed! %d\n", + ::WSAGetLastError ()); return -1; } } if (WSALookupServiceEnd (hLookup) == SOCKET_ERROR) { - ACE_OS::printf( "Error : WSALookupServiceEnd failed! %d \n", - ::WSAGetLastError()); + ACE_OS::printf ("Error : WSALookupServiceEnd failed! %d \n", + ::WSAGetLastError ()); errno = EINVAL; return -1; } #elif defined (ACE_HAS_LINUX_ATM) - if (sap == 0 || !ACE_OS::strcmp(sap,"")) { + if (sap == 0 || !ACE_OS::strcmp (sap,"")) { errno = EINVAL; return -1; } - if ( text2atm((ACE_TCHAR *)sap, - (struct sockaddr *)&(atm_addr_.sockaddratmsvc), - sizeof(atm_addr_.sockaddratmsvc), - T2A_SVC | T2A_NAME) < 0 ) { - ACE_DEBUG(LM_DEBUG, + if (text2atm ((ACE_TCHAR *)sap, + (struct sockaddr *)& (atm_addr_.sockaddratmsvc), + sizeof (atm_addr_.sockaddratmsvc), + T2A_SVC | T2A_NAME) < 0) { + ACE_DEBUG (LM_DEBUG, "Error : text2atm failed!\n"); errno = EINVAL; return -1; @@ -375,41 +375,41 @@ ACE_ATM_Addr::addr_to_string (ACE_TCHAR addr[], if (addrlen < total_len) return -1; else - ACE_OS::strcpy(addr, buffer); + ACE_OS::strcpy (addr, buffer); return 0; #elif defined (ACE_HAS_FORE_ATM_WS2) ACE_TCHAR buffer[MAXNAMELEN + 1]; int i; - if ( addrlen < ATM_ADDR_SIZE + 1 ) + if (addrlen < ATM_ADDR_SIZE + 1) return -1; - for ( i = 0; i < ATM_ADDR_SIZE; i++ ) { + for (i = 0; i < ATM_ADDR_SIZE; i++) { buffer[ i * 3 ] = '\0'; - ACE_OS::sprintf( buffer, ACE_LIB_TEXT ( "%s%02x." ), + ACE_OS::sprintf (buffer, ACE_LIB_TEXT ("%s%02x."), buffer, atm_addr_.satm_number.Addr[ i ]); } buffer[ ATM_ADDR_SIZE * 3 - 1 ] = '\0'; - ACE_OS::strcpy( addr, buffer ); + ACE_OS::strcpy (addr, buffer); return 0; #elif defined (ACE_HAS_LINUX_ATM) ACE_TCHAR buffer[MAX_ATM_ADDR_LEN + 1]; int total_len; - if ((total_len = atm2text(buffer, + if ((total_len = atm2text (buffer, sizeof buffer, - (struct sockaddr *)&(atm_addr_.sockaddratmsvc), + (struct sockaddr *)& (atm_addr_.sockaddratmsvc), A2T_PRETTY)) < 0) { - ACE_DEBUG((LM_DEBUG,"ACE_ATM_Addr(addr_to_string): atm2text failed\n")); + ACE_DEBUG ((LM_DEBUG,"ACE_ATM_Addr (addr_to_string): atm2text failed\n")); return -1; } if (addrlen < (size_t)total_len) return -1; else - ACE_OS::strcpy(addr, + ACE_OS::strcpy (addr, buffer); return 0; @@ -448,7 +448,7 @@ ACE_ATM_Addr::set_addr (void *addr, int len) #endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_WS2 */ len); ACE_OS::memcpy ((void *) &this->atm_addr_, - (void *) addr, len); + (void *) addr, len); } // Compare two addresses for inequality. @@ -457,7 +457,7 @@ int ACE_ATM_Addr::operator != (const ACE_ATM_Addr &sap) const { ACE_TRACE ("ACE_ATM_Addr::operator !="); - return !((*this) == sap); + return ! ((*this) == sap); } // Compare two addresses for equality. @@ -468,13 +468,13 @@ ACE_ATM_Addr::operator == (const ACE_ATM_Addr &sap) const ACE_TRACE ("ACE_ATM_Addr::operator =="); #if defined (ACE_HAS_LINUX_ATM) - return (atm_equal((const struct sockaddr *)&(this->atm_addr_.sockaddratmsvc), - (const struct sockaddr *)&(sap.atm_addr_.sockaddratmsvc), + return (atm_equal ((const struct sockaddr *)& (this->atm_addr_.sockaddratmsvc), + (const struct sockaddr *)& (sap.atm_addr_.sockaddratmsvc), 0, 0) && - sap_equal(&(this->atm_addr_.atmsap), - &(sap.atm_addr_.atmsap), + sap_equal (& (this->atm_addr_.atmsap), + & (sap.atm_addr_.atmsap), 0)); #else return ACE_OS::memcmp (&atm_addr_, diff --git a/ace/ATM_Addr.h b/ace/ATM_Addr.h index 639d2f71e0c..85319006ba5 100644 --- a/ace/ATM_Addr.h +++ b/ace/ATM_Addr.h @@ -1,4 +1,3 @@ - //============================================================================= /** * @file ATM_Addr.h @@ -9,7 +8,6 @@ */ //============================================================================= - #ifndef ACE_ATM_ADDR_H #define ACE_ATM_ADDR_H #include "ace/pre.h" @@ -56,11 +54,11 @@ public: // = Initialization methods. /// Default constructor. - ACE_ATM_Addr (unsigned char selector = DEFAULT_SELECTOR); + ACE_ATM_Addr (u_char selector = DEFAULT_SELECTOR); /// Copy constructor. ACE_ATM_Addr (const ACE_ATM_Addr &, - unsigned char selector = DEFAULT_SELECTOR); + u_char selector = DEFAULT_SELECTOR); /** * Creates an <ACE_ATM_Addr> from an ATMSAPAddress structure. This @@ -68,7 +66,7 @@ public: * vendors are supported. */ ACE_ATM_Addr (const ATM_Addr *, - unsigned char selector = DEFAULT_SELECTOR); + u_char selector = DEFAULT_SELECTOR); /** * Initializes an <ACE_ATM_Addr> from the <sap> which can be @@ -77,7 +75,7 @@ public: * (e.g., "frisbee.cs.wustl.edu"). */ ACE_ATM_Addr (const ACE_TCHAR sap[], - unsigned char selector = DEFAULT_SELECTOR); + u_char selector = DEFAULT_SELECTOR); /// Default dtor. ~ACE_ATM_Addr (void); @@ -85,11 +83,11 @@ public: // = Initialization methods (useful after object construction). /// Default initialization for non-address values (e.g., /// t_atm_sap_addr.SVE_tag_addr, t_atm_sap_addr.SVE_tag_selector) - void init (unsigned char selector = DEFAULT_SELECTOR); + void init (u_char selector = DEFAULT_SELECTOR); /// Initializes from another <ACE_ATM_Addr>. int set (const ACE_ATM_Addr &, - unsigned char selector = DEFAULT_SELECTOR); + u_char selector = DEFAULT_SELECTOR); /** * Initializes an <ACE_ATM_Addr> from an ATMSAPAddress/sockaddr_atm @@ -97,7 +95,7 @@ public: * change when other vendors are supported. */ int set (const ATM_Addr *, - unsigned char selector = DEFAULT_SELECTOR); + u_char selector = DEFAULT_SELECTOR); /** * Initializes an <ACE_ATM_Addr> from the <sap> which can be @@ -106,7 +104,7 @@ public: * (e.g., "frisbee.cs.wustl.edu"). */ int set (const ACE_TCHAR sap[], - unsigned char selector = DEFAULT_SELECTOR); + u_char selector = DEFAULT_SELECTOR); /** * Initializes an <ACE_ATM_Addr> from the <sap> which can be @@ -142,10 +140,10 @@ public: virtual void set_addr (void *, int); /// Return the selector for network address. - unsigned char get_selector (void) const; + u_char get_selector (void) const; /// Set the selector for the network address. - void set_selector (unsigned char); + void set_selector (u_char); /** * Compare two addresses for equality. The addresses are considered diff --git a/ace/ATM_Stream.cpp b/ace/ATM_Stream.cpp index f0778eb6f5d..71310e29458 100644 --- a/ace/ATM_Stream.cpp +++ b/ace/ATM_Stream.cpp @@ -1,11 +1,8 @@ // $Id$ -/* Defines the member functions for the base class of the ACE_ATM_Stream - abstraction. */ - #include "ace/ATM_Stream.h" -ACE_RCSID(ace, ATM_Stream, "$Id$") +ACE_RCSID (ace, ATM_Stream, "$Id$") #if defined (ACE_HAS_ATM) @@ -13,9 +10,9 @@ ACE_RCSID(ace, ATM_Stream, "$Id$") #include "ace/ATM_Stream.i" #endif /* __ACE_INLINE__ */ - ACE_ALLOC_HOOK_DEFINE(ACE_ATM_Stream) +ACE_ALLOC_HOOK_DEFINE (ACE_ATM_Stream) - void +void ACE_ATM_Stream::dump (void) const { ACE_TRACE ("ACE_ATM_Stream::dump"); @@ -25,7 +22,7 @@ char* ACE_ATM_Stream::get_peer_name (void) const { ACE_TRACE ("ACE_ATM_Stream::get_peer_name"); -#if defined (ACE_HAS_FORE_ATM_XTI) +#if defined (ACE_HAS_FORE_ATM_XTI) // // Use t_getprotaddr for XTI/ATM // struct t_bind *localaddr // = (struct t_bind *) ACE_OS::t_alloc (get_handle (), @@ -35,12 +32,12 @@ ACE_ATM_Stream::get_peer_name (void) const // = (struct t_bind *) ACE_OS::t_alloc (get_handle (), // T_BIND, // T_ADDR); - // ::t_getprotaddr(get_handle (), + // ::t_getprotaddr (get_handle (), // localaddr, // peeraddr); - // char* connected_name = (char*) ACE_OS::malloc(peeraddr->addr.len + 1); - // ACE_OS::strcpy(connected_name, + // char* connected_name = (char*) ACE_OS::malloc (peeraddr->addr.len + 1); + // ACE_OS::strcpy (connected_name, // peeraddr->addr.buf); // ACE_OS::t_free ((char *) localaddr, // T_BIND); @@ -61,74 +58,74 @@ ACE_ATM_Stream::get_peer_name (void) const // &name); return (name.buf); -#elif defined (ACE_HAS_FORE_ATM_WS2) +#elif defined (ACE_HAS_FORE_ATM_WS2) // Use getpeername for WinSock2. struct sockaddr_atm name; - ACE_OS::memset(&name, 0, sizeof(name)); - int nameSize = sizeof(name); + ACE_OS::memset (&name, 0, sizeof (name)); + int nameSize = sizeof (name); - if (ACE_OS::getpeername(this->get_handle (), - (struct sockaddr *) &name, + if (ACE_OS::getpeername (this->get_handle (), + (struct sockaddr *) &name, &nameSize) != 0) { return 0; } char buffer[256]; - for (unsigned int index = 0; index < ATM_ADDR_SIZE - 1; index++ ) { + for (unsigned int index = 0; index < ATM_ADDR_SIZE - 1; index++) { buffer[ index * 3 ] = '\0'; - sprintf(buffer, "%s%02x.", buffer, name.satm_number.Addr[ index ]); + sprintf (buffer, "%s%02x.", buffer, name.satm_number.Addr[ index ]); } buffer[ (ATM_ADDR_SIZE - 1) * 3 ] = '\0'; - sprintf(buffer, "%s%02x.", buffer, 0); + sprintf (buffer, "%s%02x.", buffer, 0); buffer[ ATM_ADDR_SIZE * 3 - 1 ] = '\0'; - for (index = 0; index < ACE_OS::strlen(buffer); ++index) - buffer[index] = tolower(buffer[index]); + for (index = 0; index < ACE_OS::strlen (buffer); ++index) + buffer[index] = tolower (buffer[index]); - ifstream atm_hosts("C:/WINNT/atmhosts"); - assert(atm_hosts.is_open()); + ifstream atm_hosts ("C:/WINNT/atmhosts"); + assert (atm_hosts.is_open ()); // Find the host address in the ATM hosts file and return the // host name char line[256]; char *host_ptr, *host_name = 0; ACE_NEW_RETURN (host_name, char[256], 0); - while (!atm_hosts.eof()) { - atm_hosts.getline(line, 256); + while (!atm_hosts.eof ()) { + atm_hosts.getline (line, 256); // Convert the line to lower case to ease comparison - for (index = 0; index < ACE_OS::strlen(line); ++index) - line[index] = tolower(line[index]); - if (strstr(line, buffer) != 0) + for (index = 0; index < ACE_OS::strlen (line); ++index) + line[index] = tolower (line[index]); + if (strstr (line, buffer) != 0) { // Grab the second token which is the host name - strtok(line, " \t"); - host_ptr = strtok(0, " \t"); - strcpy(host_name, host_ptr); + strtok (line, " \t"); + host_ptr = strtok (0, " \t"); + strcpy (host_name, host_ptr); break; } } return host_name; -#elif defined (ACE_HAS_LINUX_ATM) +#elif defined (ACE_HAS_LINUX_ATM) ATM_Addr name; - int nameSize = sizeof(name.sockaddratmsvc); + int nameSize = sizeof (name.sockaddratmsvc); - if (ACE_OS::getpeername(this->get_handle (), - (struct sockaddr *) &(name.sockaddratmsvc), + if (ACE_OS::getpeername (this->get_handle (), + (struct sockaddr *) & (name.sockaddratmsvc), &nameSize) < 0) { - ACE_OS::perror("ACE_ATM_Stream(get_peer_name): "); + ACE_OS::perror ("ACE_ATM_Stream (get_peer_name) : "); return 0; } static ACE_TCHAR buffer[MAX_ATM_ADDR_LEN + 1]; int total_len; - if ((total_len = atm2text(buffer,sizeof buffer, - (struct sockaddr *)&(name.sockaddratmsvc), + if ((total_len = atm2text (buffer,sizeof buffer, + (struct sockaddr *) & (name.sockaddratmsvc), A2T_PRETTY|A2T_NAME)) < 0) { - ACE_DEBUG((LM_DEBUG,ACE_LIB_TEXT ("ACE_ATM_Stream(get_peer_name):%d"),errno)); + ACE_DEBUG ((LM_DEBUG,ACE_LIB_TEXT ("ACE_ATM_Stream (get_peer_name) :%d"),errno)); return 0; } - return (char*)buffer; + return (char*) buffer; #else return 0; #endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */ @@ -138,7 +135,7 @@ ACE_HANDLE ACE_ATM_Stream::get_handle (void) const { ACE_TRACE ("ACE_ATM_Stream::get_handle"); -#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) || defined (ACE_HAS_LINUX_ATM) +#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) || defined (ACE_HAS_LINUX_ATM) return stream_.get_handle (); #else return 0; @@ -150,45 +147,45 @@ ACE_ATM_Stream::get_vpi_vci (ACE_UINT16 &vpi, ACE_UINT16 &vci) const { ACE_TRACE ("ACE_ATM_Stream::get_vpi_vci"); -#if defined (ACE_HAS_FORE_ATM_XTI) +#if defined (ACE_HAS_FORE_ATM_XTI) struct t_atm_conn_prop conn_prop; - char* connect_opts = (char *)&conn_prop; - int opt_size = sizeof(t_atm_conn_prop); + char* connect_opts = (char *) &conn_prop; + int opt_size = sizeof (t_atm_conn_prop); struct t_info info; struct t_optmgmt opt_req, opt_ret; - if (ACE_OS::t_getinfo(stream_.get_handle(), - &info) < 0) + if (ACE_OS::t_getinfo (stream_.get_handle (), + &info) < 0) { - ACE_OS::t_error("t_getinfo"); + ACE_OS::t_error ("t_getinfo"); return -1; } - char *buf_req = (char *) ACE_OS::malloc(info.options); - if (buf_req == (char *) NULL) + char *buf_req = (char *) ACE_OS::malloc (info.options); + if (buf_req == (char *) NULL) { - ACE_OS::fprintf(stderr, + ACE_OS::fprintf (stderr, "Unable to allocate %ld bytes for options\n", info.options); return -1; } - char *buf_ret = (char *) ACE_OS::malloc(info.options); - if (buf_ret == (char *) NULL) + char *buf_ret = (char *) ACE_OS::malloc (info.options); + if (buf_ret == (char *) NULL) { - ACE_OS::fprintf(stderr, + ACE_OS::fprintf (stderr, "Unable to allocate %ld bytes for options\n", info.options); return -1; } - ACE_OS::memset(&opt_req, 0, sizeof(opt_req)); - ACE_OS::memset(&opt_ret, 0, sizeof(opt_ret)); + ACE_OS::memset (&opt_req, 0, sizeof (opt_req)); + ACE_OS::memset (&opt_ret, 0, sizeof (opt_ret)); struct t_opthdr *popt = (struct t_opthdr *) buf_req; struct t_opthdr *popt_ret = (struct t_opthdr *) buf_ret; - popt->len= sizeof(struct t_opthdr) + opt_size; + popt->len= sizeof (struct t_opthdr) + opt_size; // We are only concerned with SVCs so no other check or values are needed // here. @@ -197,89 +194,89 @@ ACE_ATM_Stream::get_vpi_vci (ACE_UINT16 &vpi, popt->status = 0; opt_req.opt.len = popt->len; - opt_req.opt.buf = (char *)popt; + opt_req.opt.buf = (char *) popt; opt_req.flags = T_CURRENT; - popt = T_OPT_NEXTHDR(buf_req, + popt = T_OPT_NEXTHDR (buf_req, info.options, popt); opt_ret.opt.maxlen = info.options; - opt_ret.opt.buf = (char *)popt_ret; + opt_ret.opt.buf = (char *) popt_ret; - if (ACE_OS::t_optmgmt(stream_.get_handle(), + if (ACE_OS::t_optmgmt (stream_.get_handle (), &opt_req, &opt_ret) < 0) { - ACE_OS::t_error("t_optmgmt"); + ACE_OS::t_error ("t_optmgmt"); return -1; } - ACE_OS::memcpy(connect_opts, - (char *)popt_ret + sizeof(struct t_opthdr), + ACE_OS::memcpy (connect_opts, + (char *) popt_ret + sizeof (struct t_opthdr), opt_size); - ACE_OS::free(buf_ret); - ACE_OS::free(buf_req); + ACE_OS::free (buf_ret); + ACE_OS::free (buf_req); vpi = conn_prop.vpi; vci = conn_prop.vci; return (0); -#elif defined (ACE_HAS_FORE_ATM_WS2) +#elif defined (ACE_HAS_FORE_ATM_WS2) ATM_CONNECTION_ID connID; DWORD bytes = 0; - if ( ::WSAIoctl(( int )this -> get_handle(), + if (::WSAIoctl ((int) this -> get_handle (), SIO_GET_ATM_CONNECTION_ID, NULL, 0, - (LPVOID) &connID, - sizeof(ATM_CONNECTION_ID), + (LPVOID) &connID, + sizeof (ATM_CONNECTION_ID), &bytes, NULL, NULL) == SOCKET_ERROR) { - ACE_OS::printf("Error: WSAIoctl %d\n", WSAGetLastError()); + ACE_OS::printf ("Error: WSAIoctl %d\n", WSAGetLastError ()); } - vpi = ( ACE_UINT16 )connID.VPI; - vci = ( ACE_UINT16 )connID.VCI; + vpi = (ACE_UINT16) connID.VPI; + vci = (ACE_UINT16) connID.VCI; return 0; -#elif defined (ACE_HAS_LINUX_ATM) +#elif defined (ACE_HAS_LINUX_ATM) #if defined (SO_ATMPVC) /* atm version>=0.62 */ struct sockaddr_atmpvc mypvcaddr; - int addrpvclen = sizeof(mypvcaddr); - if (ACE_OS::getsockopt(stream_.get_handle(), + int addrpvclen = sizeof (mypvcaddr); + if (ACE_OS::getsockopt (stream_.get_handle (), SOL_ATM, SO_ATMPVC, - ACE_reinterpret_cast(char*,&mypvcaddr), + ACE_reinterpret_cast (char*,&mypvcaddr), &addrpvclen) < 0) { - ACE_DEBUG(LM_DEBUG, + ACE_DEBUG (LM_DEBUG, ACE_LIB_TEXT ("ACE_ATM_Stream::get_vpi_vci: getsockopt %d\n"), errno); return -1; } - vpi = (ACE_UINT16)mypvcaddr.sap_addr.vpi; - vci = (ACE_UINT16)mypvcaddr.sap_addr.vci; + vpi = (ACE_UINT16) mypvcaddr.sap_addr.vpi; + vci = (ACE_UINT16) mypvcaddr.sap_addr.vci; return 0; #elif defined (SO_VCID) /* patch for atm version 0.59 */ struct atm_vcid mypvcid; - int pvcidlen = sizeof(mypvcid); - if (ACE_OS::getsockopt(stream_.get_handle(), + int pvcidlen = sizeof (mypvcid); + if (ACE_OS::getsockopt (stream_.get_handle (), SOL_ATM,SO_VCID, - ACE_reinterpret_cast(char*,&mypvcid), + ACE_reinterpret_cast (char*,&mypvcid), &pvcidlen) < 0) { - ACE_DEBUG(LM_DEBUG, + ACE_DEBUG (LM_DEBUG, ACE_LIB_TEXT ("ACE_ATM_Stream::get_vpi_vci: getsockopt %d\n"), errno); return -1; } - vpi = (ACE_UINT16)mypvcid.vpi; - vci = (ACE_UINT16)mypvcid.vci; + vpi = (ACE_UINT16) mypvcid.vpi; + vci = (ACE_UINT16) mypvcid.vci; return 0; #else - ACE_DEBUG(LM_DEBUG, + ACE_DEBUG (LM_DEBUG, ACE_LIB_TEXT ("ACE_ATM_Stream::get_vpi_vci: Not implemented in this ATM version. Update to >= 0.62\n Or patch 0.59")); ACE_UNUSED_ARG (vci); ACE_UNUSED_ARG (vpi); diff --git a/ace/Cached_Connect_Strategy_T.cpp b/ace/Cached_Connect_Strategy_T.cpp index 7e5f1f4997d..0086f9d001f 100644 --- a/ace/Cached_Connect_Strategy_T.cpp +++ b/ace/Cached_Connect_Strategy_T.cpp @@ -688,9 +688,9 @@ ACE_Bounded_Cached_Connect_Strategy<ACE_T2>::find_or_create_svc_handler_i ACE_ASSERT (0); // just to see it coming ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%t)ACE_Bounded_Cached_Connect_Strategy<>::") - ACE_TEXT ("find_or_create_svc_handler_i - ") - ACE_TEXT ("error polling server socket state.\n"))); + ACE_LIB_TEXT ("(%t)ACE_Bounded_Cached_Connect_Strategy<>::") + ACE_LIB_TEXT ("find_or_create_svc_handler_i - ") + ACE_LIB_TEXT ("error polling server socket state.\n"))); return -1; } diff --git a/ace/Configuration_Import_Export.cpp b/ace/Configuration_Import_Export.cpp index b6db4cb8e75..23e0dc7cd19 100644 --- a/ace/Configuration_Import_Export.cpp +++ b/ace/Configuration_Import_Export.cpp @@ -295,7 +295,7 @@ ACE_Registry_ImpExp::process_previous_line_format (ACE_TCHAR* buffer, ACE_Configuration_Section_Key& section) { // Chop any cr/lf at the end of the line. - ACE_TCHAR *endp = ACE_OS_String::strpbrk (buffer, ACE_TEXT ("\r\n")); + ACE_TCHAR *endp = ACE_OS_String::strpbrk (buffer, ACE_LIB_TEXT ("\r\n")); if (endp != 0) *endp = '\0'; diff --git a/ace/MEM_IO.cpp b/ace/MEM_IO.cpp index fc2070dced9..65f5b439943 100644 --- a/ace/MEM_IO.cpp +++ b/ace/MEM_IO.cpp @@ -172,13 +172,13 @@ ACE_MT_MEM_IO::init (ACE_HANDLE handle, // Building names. @@ Check buffer overflow? ACE_OS::strcpy (server_sema, basename); - ACE_OS::strcat (server_sema, ACE_TEXT ("_sema_to_server")); + ACE_OS::strcat (server_sema, ACE_LIB_TEXT ("_sema_to_server")); ACE_OS::strcpy (client_sema, basename); - ACE_OS::strcat (client_sema, ACE_TEXT ("_sema_to_client")); + ACE_OS::strcat (client_sema, ACE_LIB_TEXT ("_sema_to_client")); ACE_OS::strcpy (server_lock, basename); - ACE_OS::strcat (server_lock, ACE_TEXT ("_lock_to_server")); + ACE_OS::strcat (server_lock, ACE_LIB_TEXT ("_lock_to_server")); ACE_OS::strcpy (client_lock, basename); - ACE_OS::strcat (client_lock, ACE_TEXT ("_lock_to_client")); + ACE_OS::strcat (client_lock, ACE_LIB_TEXT ("_lock_to_client")); void *to_server_ptr = 0; // @@ Here, we assume the shared memory fill will never be resued. diff --git a/ace/Message_Queue_T.cpp b/ace/Message_Queue_T.cpp index 4a81ff8f465..68ef6be3fee 100644 --- a/ace/Message_Queue_T.cpp +++ b/ace/Message_Queue_T.cpp @@ -56,7 +56,7 @@ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::ACE_Message_Queue_Ex (siz if (this->queue_.open (hwm, lwm, ns) == -1) ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_Message_Queue_Ex"))); + ACE_LIB_TEXT ("ACE_Message_Queue_Ex"))); } template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> diff --git a/ace/Module.cpp b/ace/Module.cpp index 634070305aa..e21b2cc49a6 100644 --- a/ace/Module.cpp +++ b/ace/Module.cpp @@ -160,7 +160,7 @@ ACE_Module<ACE_SYNCH_USE>::ACE_Module (void) : flags_ (0) { ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::ACE_Module"); - this->name (ACE_TEXT ("<unknown>")); + this->name (ACE_LIB_TEXT ("<unknown>")); // Do nothing... this->q_pair_[0] = 0; this->q_pair_[1] = 0; diff --git a/ace/Naming_Context.cpp b/ace/Naming_Context.cpp index cd0e23bf583..cf86fb0aff4 100644 --- a/ace/Naming_Context.cpp +++ b/ace/Naming_Context.cpp @@ -37,11 +37,13 @@ ACE_Naming_Context::info (ACE_TCHAR **strp, size_t length) const { ACE_TRACE ("ACE_Naming_Context::info"); + ACE_UNUSED_ARG (length); ACE_TCHAR buf[BUFSIZ]; - ACE_OS::sprintf (buf, ACE_LIB_TEXT("%s\t#%s\n"), - ACE_LIB_TEXT("ACE_Naming_Context"), - ACE_LIB_TEXT("Proxy for making calls to a Name Server")); + ACE_OS::sprintf (buf, + ACE_LIB_TEXT ("%s\t#%s\n"), + ACE_LIB_TEXT ("ACE_Naming_Context"), + ACE_LIB_TEXT ("Proxy for making calls to a Name Server")); if (*strp == 0 && (*strp = ACE_OS_String::strdup (buf)) == 0) return -1; diff --git a/ace/OS_Dirent.inl b/ace/OS_Dirent.inl index 6f5574c8d7a..e6ab9dc82e1 100644 --- a/ace/OS_Dirent.inl +++ b/ace/OS_Dirent.inl @@ -12,11 +12,13 @@ ACE_OS_Dirent::opendir (const ACE_TCHAR *filename) #elif defined (ACE_HAS_DIRENT) # if defined (ACE_PSOS) // The pointer to the <ACE_DIR> buffer *must* be passed to - // ACE_OS_Dirent::closedir to free it and avoid a memory leak. + // <ACE_OS_Dirent::closedir> to free it and avoid a memory leak. ACE_DIR *dir; u_long result; ACE_NEW_RETURN (dir, ACE_DIR, 0); - result = ::open_dir (ACE_const_cast (char *, filename), &(dir->xdir)); + result = ::open_dir (ACE_const_cast (ACE_TCHAR *, + filename), + &dir->xdir); if (result == 0) return dir; else @@ -29,7 +31,7 @@ ACE_OS_Dirent::opendir (const ACE_TCHAR *filename) return ::ACE_OS_Dirent::opendir_emulation (filename); # else /* ! ACE_WIN32 */ // VxWorks' ::opendir () is declared with a non-const argument. - return ::opendir (ACE_const_cast (char *, filename)); + return ::opendir (ACE_const_cast (ACE_TCHAR *, filename)); # endif /* ACE_WIN32 */ # endif /* ACE_PSOS */ #else diff --git a/ace/Service_Manager.cpp b/ace/Service_Manager.cpp index 82bb9afaecf..d2fd5868af1 100644 --- a/ace/Service_Manager.cpp +++ b/ace/Service_Manager.cpp @@ -173,8 +173,8 @@ ACE_Service_Manager::list_services (void) ACE_OS::strcpy (buf, sr->name ()); ACE_OS::strcat (buf, (sr->active ()) ? - ACE_TEXT (" (active) ") : - ACE_TEXT (" (paused) ")); + ACE_LIB_TEXT (" (active) ") : + ACE_LIB_TEXT (" (paused) ")); p[-1] = ' '; p[0] = '\0'; diff --git a/ace/Sock_Connect.cpp b/ace/Sock_Connect.cpp index b5fbea17464..3fdd2da98ad 100644 --- a/ace/Sock_Connect.cpp +++ b/ace/Sock_Connect.cpp @@ -963,8 +963,8 @@ ACE_Sock_Connect::get_ip_interfaces (size_t &count, else { ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("ACE::get_ip_interface failed\n"), - ACE_TEXT ("Couldnt get the IP Address\n")), + ACE_LIB_TEXT ("ACE::get_ip_interface failed\n"), + ACE_LIB_TEXT ("Couldnt get the IP Address\n")), -1); } ++count; diff --git a/ace/TLI.cpp b/ace/TLI.cpp index 66b782621a3..056bc09a0a3 100644 --- a/ace/TLI.cpp +++ b/ace/TLI.cpp @@ -76,7 +76,7 @@ ACE_TLI::ACE_TLI (const char device[], int oflag, struct t_info *info) { ACE_TRACE ("ACE_TLI::ACE_TLI"); if (this->open (device, oflag, info) == ACE_INVALID_HANDLE) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_TLI::ACE_TLI"))); + ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("%p\n"), ACE_LIB_TEXT ("ACE_TLI::ACE_TLI"))); } int diff --git a/ace/TLI_Acceptor.cpp b/ace/TLI_Acceptor.cpp index 6c6b294f378..29c1717e767 100644 --- a/ace/TLI_Acceptor.cpp +++ b/ace/TLI_Acceptor.cpp @@ -396,8 +396,8 @@ ACE_TLI_Acceptor::ACE_TLI_Acceptor (const ACE_Addr &remote_sap, back, dev) == ACE_INVALID_HANDLE) ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_TLI_Acceptor::ACE_TLI_Acceptor"))); + ACE_LIB_TEXT ("%p\n"), + ACE_LIB_TEXT ("ACE_TLI_Acceptor::ACE_TLI_Acceptor"))); } int diff --git a/apps/JAWS/ChangeLog b/apps/JAWS/ChangeLog index 9d7992eeea5..ea1590cf3de 100644 --- a/apps/JAWS/ChangeLog +++ b/apps/JAWS/ChangeLog @@ -1,3 +1,12 @@ +Wed Nov 14 16:21:46 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> + + * clients/Blobby/Blob.{h,cpp}, + * clients/Blobby/Blob_Handler.{h,cpp}, + * clients/Blobby/blobby.{h,cpp}, + * clients/Blobby/Options.{h,cpp}: + Fixed the code to be Unicode-compliant. Thanks to Johnny + Willemsen for contributing this. + Fri Aug 24 18:39:39 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> * server/HTTP_Response.cpp (normal_response), diff --git a/apps/JAWS/clients/Blobby/Blob.cpp b/apps/JAWS/clients/Blobby/Blob.cpp index 46ea942f714..207a9cc5ded 100644 --- a/apps/JAWS/clients/Blobby/Blob.cpp +++ b/apps/JAWS/clients/Blobby/Blob.cpp @@ -17,14 +17,13 @@ ACE_Blob::~ACE_Blob (void) // initialize address and filename. No network i/o in open int -ACE_Blob::open (char *filename, const char *hostname , u_short port) +ACE_Blob::open (ACE_TCHAR *filename, const ACE_TCHAR *hostname , u_short port) { - filename_ = ACE_OS::strdup(filename); + filename_ = ACE_OS_String::strdup (filename); inet_addr_.set (port, hostname); return 0; } - // read from connection length bytes from offset, into Message block int diff --git a/apps/JAWS/clients/Blobby/Blob.h b/apps/JAWS/clients/Blobby/Blob.h index 4fe63c8da9f..b2c078b0af2 100644 --- a/apps/JAWS/clients/Blobby/Blob.h +++ b/apps/JAWS/clients/Blobby/Blob.h @@ -49,8 +49,8 @@ public: ACE_Blob (void); ~ACE_Blob (void); - int open (char *filename, - const char *hostname = ACE_DEFAULT_SERVER_HOST , + int open (ACE_TCHAR *filename, + const ACE_TCHAR *hostname = ACE_DEFAULT_SERVER_HOST , u_short port = 80); // initializes the class with the given filename, hostname and port. // it should be called with the filename, before any read/write calls @@ -76,7 +76,7 @@ private: ACE_INET_Addr inet_addr_; // store the internet address of the server - char *filename_; + ACE_TCHAR *filename_; // The filename ACE_Connector<ACE_Blob_Handler, ACE_SOCK_CONNECTOR> connector_; diff --git a/apps/JAWS/clients/Blobby/Blob_Handler.cpp b/apps/JAWS/clients/Blobby/Blob_Handler.cpp index 72a8653efc8..783736eb05f 100644 --- a/apps/JAWS/clients/Blobby/Blob_Handler.cpp +++ b/apps/JAWS/clients/Blobby/Blob_Handler.cpp @@ -13,11 +13,11 @@ ACE_Blob_Handler::ACE_Blob_Handler (void) ACE_Blob_Handler::ACE_Blob_Handler (ACE_Message_Block * mb, size_t length, size_t offset, - char *filename) : + ACE_TCHAR *filename) : mb_ (mb), length_ (length), offset_ (offset), - filename_ (ACE_OS::strdup (filename)), + filename_ (ACE_OS_String::strdup (filename)), bytecount_ (0) { } @@ -80,7 +80,7 @@ ACE_Blob_Handler::byte_count (void) ACE_Blob_Reader::ACE_Blob_Reader (ACE_Message_Block * mb, size_t length, size_t offset, - char *filename, + ACE_TCHAR *filename, const char *request_prefix, const char *request_suffix) : ACE_Blob_Handler (mb, length, offset, filename), @@ -96,7 +96,9 @@ ACE_Blob_Reader::send_request (void) char mesg [MAX_HEADER_SIZE]; // Check to see if the request is too big - if ( MAX_HEADER_SIZE < (strlen (request_prefix_) + strlen (filename_) + strlen (request_suffix_) + 4)) + if (MAX_HEADER_SIZE < (ACE_OS_String::strlen (request_prefix_) + + ACE_OS_String::strlen (filename_) + + ACE_OS_String::strlen (request_suffix_) + 4)) ACE_ERROR_RETURN((LM_ERROR,"Request too large!"), -1); // Create a message to send to the server requesting retrieval of the file @@ -242,7 +244,7 @@ ACE_Blob_Reader::receive_reply (void) ACE_Blob_Writer::ACE_Blob_Writer (ACE_Message_Block * mb, size_t length, size_t offset, - char *filename, + ACE_TCHAR *filename, const char *request_prefix, const char *request_suffix) : ACE_Blob_Handler (mb, length, offset, filename), diff --git a/apps/JAWS/clients/Blobby/Blob_Handler.h b/apps/JAWS/clients/Blobby/Blob_Handler.h index 135c1200b6f..b18df484ac5 100644 --- a/apps/JAWS/clients/Blobby/Blob_Handler.h +++ b/apps/JAWS/clients/Blobby/Blob_Handler.h @@ -47,7 +47,10 @@ public: ACE_Blob_Handler (void); // Null constructor, insures that it works properly with Connector - ACE_Blob_Handler (ACE_Message_Block *mb, size_t length, size_t offset, char *filename); + ACE_Blob_Handler (ACE_Message_Block *mb, + size_t length, + size_t offset, + ACE_TCHAR *filename); // Always use this constructor to make Blob_Handlers int byte_count (void); @@ -68,7 +71,7 @@ protected: ACE_Message_Block *mb_; size_t length_; size_t offset_; - char *filename_; + ACE_TCHAR *filename_; int bytecount_; enum { @@ -84,7 +87,7 @@ public: ACE_Blob_Reader (ACE_Message_Block *mb, size_t length, size_t offset, - char *filename, + ACE_TCHAR *filename, const char *request_prefix = "GET", const char *request_suffix = "HTTP/1.0\r\n\r\n"); @@ -101,7 +104,7 @@ public: ACE_Blob_Writer (ACE_Message_Block *mb, size_t length, size_t offset, - char *filename, + ACE_TCHAR *filename, const char *request_prefix = "PUT", const char *request_suffix = "HTTP/1.0\nContent-length:"); diff --git a/apps/JAWS/clients/Blobby/Options.cpp b/apps/JAWS/clients/Blobby/Options.cpp index 801441ed52a..4c28033ae19 100644 --- a/apps/JAWS/clients/Blobby/Options.cpp +++ b/apps/JAWS/clients/Blobby/Options.cpp @@ -21,9 +21,9 @@ Options::instance (void) } void -Options::parse_args (int argc, char *argv[]) +Options::parse_args (int argc, ACE_TCHAR *argv[]) { - ACE_Get_Opt get_opt (argc, argv, "rwh:p:f:l:o:d"); + ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("rwh:p:f:l:o:d")); int c; diff --git a/apps/JAWS/clients/Blobby/Options.h b/apps/JAWS/clients/Blobby/Options.h index 5fe61c55cfa..47c0c852036 100644 --- a/apps/JAWS/clients/Blobby/Options.h +++ b/apps/JAWS/clients/Blobby/Options.h @@ -36,7 +36,7 @@ public: static Options *instance (void); // Returns the singleton instance - void parse_args (int argc, char *argv[]); + void parse_args (int argc, ACE_TCHAR *argv[]); // parses commandline arguments char *hostname_; @@ -45,7 +45,7 @@ public: u_short port_; // Port number to use - char *filename_; + ACE_TCHAR *filename_; // Filename to upload/download int length_; diff --git a/apps/JAWS/clients/Blobby/blobby.cpp b/apps/JAWS/clients/Blobby/blobby.cpp index 21ea46780b6..46e3854b266 100644 --- a/apps/JAWS/clients/Blobby/blobby.cpp +++ b/apps/JAWS/clients/Blobby/blobby.cpp @@ -27,7 +27,7 @@ ACE_RCSID(Blobby, blobby, "$Id$") int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { // Options is a singleton Options *options = Options::instance (); diff --git a/docs/ACE-guidelines.html b/docs/ACE-guidelines.html index 8a08e8c96f9..16dbc995d6d 100644 --- a/docs/ACE-guidelines.html +++ b/docs/ACE-guidelines.html @@ -55,7 +55,7 @@ bgcolor="#ffffff"> always be declared with arguments, <em>e.g.</em>, <pre> int - main (int argc, char *argv[]) + main (int argc, ACE_TCHAR *argv[]) { [...] @@ -67,7 +67,7 @@ bgcolor="#ffffff"> arguments, don't declare them, <em>e.g.</em>, <pre> int - main (int, char *[]) + main (int, ACE_TCHAR *[]) { [...] @@ -75,10 +75,10 @@ bgcolor="#ffffff"> } </pre><p> - Please declare the second argument as <code>char *[]</code> - instead of <code>char **</code>. Ancient versions of MSC - complained about <code>char **</code>; I've never seen a - C++ compiler complain about <code>char *[]</code>.<p> + Please declare the second argument as <code>ACE_TCHAR *[]</code> + instead of <code>ACE_TCHAR **</code> or <code>char *[]</CODE>. Ancient versions of MSC + complained about <code>ACE_TCHAR **</code> and <code>char + *[]</CODE> is not Unicode-compliant.<p> <code>main</code> must also return 0 on successful termination, and non-zero otherwise.<p> diff --git a/tests/Aio_Platform_Test.cpp b/tests/Aio_Platform_Test.cpp index e29a6ce61b9..1add359f631 100644 --- a/tests/Aio_Platform_Test.cpp +++ b/tests/Aio_Platform_Test.cpp @@ -163,10 +163,8 @@ have_asynchio (void) #endif /* _POSIX_ASYNCHRONOUS_IO */ } - - int -main (int, char *[]) +main (int, ACE_TCHAR *[]) { ACE_START_TEST ("Aio_Platform_Test"); diff --git a/tests/Upgradable_RW_Test.cpp b/tests/Upgradable_RW_Test.cpp index 27b68c2b5c2..ae2459cfa4e 100644 --- a/tests/Upgradable_RW_Test.cpp +++ b/tests/Upgradable_RW_Test.cpp @@ -84,7 +84,7 @@ find_last (void) "%d", n_entries - 1); ACE_CString cString (search_string); - Element* element_ptr; + Element *element_ptr = 0; for (ACE_Double_Linked_List_Iterator<Element> iterator (*linked_list_ptr); !iterator.done (); @@ -287,7 +287,10 @@ Time_Calculation ::print_stats (void) elapsed_time.user_time /= iterations; elapsed_time.system_time /= iterations; - double tmp = 1000 / elapsed_time.real_time; + double tmp = 0.0; + + if (elapsed_time.real_time != 0.0) + tmp = 1000 / elapsed_time.real_time; ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n") @@ -313,8 +316,8 @@ static int init (void) { char entry[MAX_STRING_SIZE]; - ACE_CString *cString_ptr; - Element *element_ptr; + ACE_CString *cString_ptr = 0; + Element *element_ptr = 0; ACE_NEW_RETURN (linked_list_ptr, Linked_List, @@ -378,10 +381,10 @@ main (int argc, ACE_TCHAR *argv[]) // for a nice start of all threads (for much contention) // Initialize the readers. - Reader_Task** reader_tasks; + Reader_Task **reader_tasks = 0; ACE_NEW_RETURN (reader_tasks, - Reader_Task*[n_readers], + Reader_Task *[n_readers], -1); u_int i; @@ -401,10 +404,10 @@ main (int argc, ACE_TCHAR *argv[]) } // Create all the writers - Writer_Task** writer_tasks; + Writer_Task **writer_tasks = 0; ACE_NEW_RETURN (writer_tasks, - Writer_Task*[n_writers], + Writer_Task *[n_writers], -1); for (i = 0; @@ -454,8 +457,8 @@ main (int argc, ACE_TCHAR *argv[]) ACE_TEXT (" (%t) exiting main thread\n"))); // Delete the memory of the Double_Linked_List - ACE_CString *cString_ptr; - Element *element_ptr; + ACE_CString *cString_ptr = 0; + Element *element_ptr = 0; for (i = 0; i < n_entries; |