diff options
Diffstat (limited to 'ACE')
-rw-r--r-- | ACE/ChangeLog | 11 | ||||
-rw-r--r-- | ACE/ace/OS_NS_time.cpp | 4 | ||||
-rw-r--r-- | ACE/ace/OS_NS_time.h | 8 | ||||
-rw-r--r-- | ACE/ace/OS_NS_time.inl | 8 | ||||
-rw-r--r-- | ACE/tests/Cached_Conn_Test.cpp | 19 | ||||
-rw-r--r-- | ACE/tests/OS_Test.cpp | 1 |
6 files changed, 20 insertions, 31 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index a08e53ecba6..c5a2c8005a9 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,14 @@ +Thu Sep 18 06:33:59 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * ace/OS_NS_Time.{h,cpp,inl} (strptime): + Always clear struct tm to zero + + * tests/OS_Test.cpp: + Updated for change above + + * tests/Cached_Conn_Test.cpp: + Removed check for deprecated compiler + Wed Sep 17 18:47:59 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> * ace/Cached_Connect_Strategy_T.{h,cpp}: diff --git a/ACE/ace/OS_NS_time.cpp b/ACE/ace/OS_NS_time.cpp index b15714866b2..19be27b7579 100644 --- a/ACE/ace/OS_NS_time.cpp +++ b/ACE/ace/OS_NS_time.cpp @@ -354,7 +354,7 @@ ACE_OS::readPPCTimeBase (u_long &most, u_long &least) } #endif /* ACE_HAS_POWERPC_TIMER && ghs */ -#if defined (ACE_LACKS_STRPTIME) && !defined (ACE_REFUSE_STRPTIME_EMULATION) +#if defined (ACE_LACKS_STRPTIME) char * ACE_OS::strptime_emulation (const char *buf, const char *format, struct tm *tm) { @@ -630,6 +630,6 @@ ACE_OS::strptime_getnum (const char *buf, else return 0; } -#endif /* ACE_LACKS_STRPTIME && !ACE_REFUSE_STRPTIME_EMULATION */ +#endif /* ACE_LACKS_STRPTIME */ ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/ACE/ace/OS_NS_time.h b/ACE/ace/OS_NS_time.h index ad1bb484b98..c72c8b8fc86 100644 --- a/ACE/ace/OS_NS_time.h +++ b/ACE/ace/OS_NS_time.h @@ -230,12 +230,16 @@ namespace ACE_OS const char *format, const struct tm *timeptr); + /** + * strptime wrapper. Note that the struct @a tm will always be set to + * zero + */ ACE_NAMESPACE_INLINE_FUNCTION char *strptime (const char *buf, const char *format, struct tm *tm); -# if defined (ACE_LACKS_STRPTIME) && !defined (ACE_REFUSE_STRPTIME_EMULATION) +# if defined (ACE_LACKS_STRPTIME) extern ACE_Export char *strptime_emulation (const char *buf, const char *format, @@ -244,7 +248,7 @@ namespace ACE_OS extern ACE_Export int strptime_getnum (const char *buf, int *num, int *bi, int *fi, int min, int max); -# endif /* ACE_LACKS_STRPTIME && !ACE_REFUSE_STRPTIME_EMULATION */ +# endif /* ACE_LACKS_STRPTIME */ ACE_NAMESPACE_INLINE_FUNCTION time_t time (time_t *tloc = 0); diff --git a/ACE/ace/OS_NS_time.inl b/ACE/ace/OS_NS_time.inl index 0355fe03a8e..39c34704aa7 100644 --- a/ACE/ace/OS_NS_time.inl +++ b/ACE/ace/OS_NS_time.inl @@ -443,15 +443,9 @@ ACE_OS::strftime (char *s, size_t maxsize, const char *format, ACE_INLINE char * ACE_OS::strptime (const char *buf, const char *format, struct tm *tm) { + ACE_OS::memset (tm, 0, sizeof (struct tm)); #if defined (ACE_LACKS_STRPTIME) -# if defined (ACE_REFUSE_STRPTIME_EMULATION) - ACE_UNUSED_ARG (buf); - ACE_UNUSED_ARG (format); - ACE_UNUSED_ARG (tm); - ACE_NOTSUP_RETURN (0); -# else return ACE_OS::strptime_emulation (buf, format, tm); -# endif /* ACE_REFUSE_STRPTIME_EMULATION */ #else return ACE_STD_NAMESPACE::strptime (buf, format, tm); #endif /* ACE_LACKS_STRPTIME */ diff --git a/ACE/tests/Cached_Conn_Test.cpp b/ACE/tests/Cached_Conn_Test.cpp index ce4ba892ed9..63199c2e42a 100644 --- a/ACE/tests/Cached_Conn_Test.cpp +++ b/ACE/tests/Cached_Conn_Test.cpp @@ -25,11 +25,6 @@ #include "test_config.h" -// IBM C Set++ just can't grok the templates in here for auto template -// instantiation. It ends up overwriting a tempinc/*.C file and mashes -// its contents. -#if !defined (__xlC__) || (__xlC__ > 0x0301) - #include "Cached_Conn_Test.h" #include "ace/OS_NS_string.h" @@ -477,20 +472,6 @@ run_main (int argc, ACE_TCHAR *argv[]) ACE_LOG_MSG->set_flags (ACE_Log_Msg::VERBOSE_LITE); -#else /* Do this for C Set++ 3.1 */ - -int -run_main (int argc, ACE_TCHAR *argv[]) -{ - ACE_UNUSED_ARG (argc); - ACE_UNUSED_ARG (argv); - - ACE_START_TEST (ACE_TEXT ("Cached_Conn_Test")); - ACE_ERROR ((LM_INFO, - ACE_TEXT ("C Set++ won't build this test correctly\n"))); - -#endif /* !__xlC__ || __xlC > 0x0301 */ - ACE_END_TEST; return 0; } diff --git a/ACE/tests/OS_Test.cpp b/ACE/tests/OS_Test.cpp index 0a2fa16e278..bee41329ab7 100644 --- a/ACE/tests/OS_Test.cpp +++ b/ACE/tests/OS_Test.cpp @@ -644,7 +644,6 @@ strptime_test (void) int error_count = 0; const char* original_time = "2008-06-21 23:45"; tm lTime; - ACE_OS::memset (&lTime, 0, sizeof (struct tm)); ACE_OS::strptime(original_time, "%Y-%m-%d %H:%M", &lTime); lTime.tm_isdst = 0; // do not change due to daylight saving time time_t lNewTime = ACE_OS::mktime(&lTime); |