diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2006-10-02 12:21:46 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2006-10-02 12:21:46 +0000 |
commit | 351c1137878c1cc1d224ecec5abcf398b5e3e0f1 (patch) | |
tree | ba6ae98190643aa44c7269c53eede2a04d0935f8 | |
parent | 8281d1ccb90de9968f21e3ecdc61da71691ef2a2 (diff) | |
download | ATCD-351c1137878c1cc1d224ecec5abcf398b5e3e0f1.tar.gz |
Mon Oct 2 12:21:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r-- | ACE/ChangeLog | 5 | ||||
-rw-r--r-- | ACE/ace/Log_Msg.cpp | 21 |
2 files changed, 16 insertions, 10 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index a76cf305a4d..e9db9ccbfd9 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,8 @@ +Mon Oct 2 12:21:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl> + + * ace/Log_Msg.cpp: + Const/bool improvements + Mon Oct 2 11:26:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl> * ace/Log_Msg.{h,cpp}: diff --git a/ACE/ace/Log_Msg.cpp b/ACE/ace/Log_Msg.cpp index 68067886d5f..52866c75050 100644 --- a/ACE/ace/Log_Msg.cpp +++ b/ACE/ace/Log_Msg.cpp @@ -939,9 +939,9 @@ ACE_Log_Msg::log (ACE_Log_Priority log_priority, va_start (argp, format_str); - ssize_t result = this->log (format_str, - log_priority, - argp); + ssize_t const result = this->log (format_str, + log_priority, + argp); va_end (argp); return result; @@ -963,9 +963,9 @@ ACE_Log_Msg::log (ACE_Log_Priority log_priority, va_start (argp, format_str); - ssize_t result = this->log (ACE_TEXT_ANTI_TO_TCHAR (format_str), - log_priority, - argp); + ssize_t const result = this->log (ACE_TEXT_ANTI_TO_TCHAR (format_str), + log_priority, + argp); va_end (argp); return result; @@ -1012,6 +1012,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, ACE_Log_Record log_record (log_priority, ACE_OS::gettimeofday (), this->getpid ()); + // bp is pointer to where to put next part of logged message. // bspace is the number of characters remaining in msg_. ACE_TCHAR *bp = const_cast<ACE_TCHAR *> (this->msg ()); @@ -1025,9 +1026,9 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, // compile time. Instead, do a quick check now; if we get a -1 return, // the platform doesn't support the length-limiting capability. ACE_TCHAR test[2]; - int can_check = ACE_OS::snprintf (test, 1, ACE_LIB_TEXT ("x")) != -1; + bool can_check = ACE_OS::snprintf (test, 1, ACE_LIB_TEXT ("x")) != -1; - int abort_prog = 0; + bool abort_prog = false; int exit_value = 0; if (ACE_BIT_ENABLED (ACE_Log_Msg::flags_, ACE_Log_Msg::VERBOSE)) @@ -1172,7 +1173,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, break; case 'a': // Abort program after handling all of format string. - abort_prog = 1; + abort_prog = true; exit_value = va_arg (argp, int); ACE_OS::strsncpy (bp, abort_str, bspace); if (bspace > ACE_OS::strlen (abort_str)) @@ -1987,7 +1988,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, // anymore because all our members could be corrupted. if (bp >= (this->msg_ + ACE_MAXLOGMSGLEN+1)) { - abort_prog = 1; + abort_prog = true; ACE_OS::fprintf (stderr, "The following logged message is too long!\n"); } |