summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2002-07-23 17:15:42 +0000
committerSteve Huston <shuston@riverace.com>2002-07-23 17:15:42 +0000
commit9fc7fa3560cb8fbb2e64c1641b435a6650dc7496 (patch)
tree641821fa4e9603f676bedb1cf454a7a209e2a8d4
parent95012577892211d4b2f033aa982333f29116d8c2 (diff)
downloadATCD-9fc7fa3560cb8fbb2e64c1641b435a6650dc7496.tar.gz
ChangeLogTag:Tue Jul 23 13:08:27 2002 Steve Huston <shuston@riverace.com>
-rw-r--r--ChangeLog7
-rw-r--r--ChangeLogs/ChangeLog-03a7
-rw-r--r--ace/ACE.cpp18
-rw-r--r--ace/ACE.h4
-rw-r--r--ace/Log_Msg.cpp10
-rw-r--r--ace/Log_Msg.h2
6 files changed, 31 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index cb6e92fe0f7..f21f2ca1884 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jul 23 13:08:27 2002 Steve Huston <shuston@riverace.com>
+
+ * ace/Log_Msg.{h cpp} (log_hexdump):
+ * ace/ACE.{h cpp} (format_hexdump): Change size arguments from int
+ to size_t. Change format_hexdump()'s return from int to size_t.
+
Tue Jul 23 09:48:15 2002 Chad Elliott <elliott_c@ociweb.com>
* bin/MakeProjectCreator/modules/Driver.pm:
@@ -13,6 +19,7 @@ Tue Jul 23 09:48:15 2002 Chad Elliott <elliott_c@ociweb.com>
Only add LIB and SHLIB assignments if we are generating a Makefile
for libraries.
+
Mon Jul 22 22:30:53 2002 Nanbor Wang <nanbor@cs.wustl.edu>
* ACEXML/common/XML_Common.dsp: Added the macro definition
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index cb6e92fe0f7..f21f2ca1884 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,3 +1,9 @@
+Tue Jul 23 13:08:27 2002 Steve Huston <shuston@riverace.com>
+
+ * ace/Log_Msg.{h cpp} (log_hexdump):
+ * ace/ACE.{h cpp} (format_hexdump): Change size arguments from int
+ to size_t. Change format_hexdump()'s return from int to size_t.
+
Tue Jul 23 09:48:15 2002 Chad Elliott <elliott_c@ociweb.com>
* bin/MakeProjectCreator/modules/Driver.pm:
@@ -13,6 +19,7 @@ Tue Jul 23 09:48:15 2002 Chad Elliott <elliott_c@ociweb.com>
Only add LIB and SHLIB assignments if we are generating a Makefile
for libraries.
+
Mon Jul 22 22:30:53 2002 Nanbor Wang <nanbor@cs.wustl.edu>
* ACEXML/common/XML_Common.dsp: Added the macro definition
diff --git a/ace/ACE.cpp b/ace/ACE.cpp
index 2ae61ece33d..b18afca2ca6 100644
--- a/ace/ACE.cpp
+++ b/ace/ACE.cpp
@@ -2450,31 +2450,33 @@ ACE::restore_non_blocking_mode (ACE_HANDLE handle,
// Portions taken from mdump by J.P. Knight (J.P.Knight@lut.ac.uk)
// Modifications by Todd Montgomery.
-int
+size_t
ACE::format_hexdump (const char *buffer,
- int size,
+ size_t size,
ACE_TCHAR *obuf,
- int obuf_sz)
+ size_t obuf_sz)
{
ACE_TRACE ("ACE::format_hexdump");
u_char c;
ACE_TCHAR textver[16 + 1];
- int maxlen = (obuf_sz / 68) * 16;
+ // We can fit 16 bytes output in text mode per line, 4 chars per byte.
+ size_t maxlen = (obuf_sz / 68) * 16;
if (size > maxlen)
size = maxlen;
- int i;
+ size_t i;
- for (i = 0; i < (size >> 4); i++)
+ size_t lines = size / 16;
+ for (i = 0; i < lines; i++)
{
- int j;
+ size_t j;
for (j = 0 ; j < 16; j++)
{
- c = (u_char) buffer[(i << 4) + j];
+ c = (u_char) buffer[(i << 4) + j]; // or, buffer[i*16+j]
ACE_OS::sprintf (obuf,
ACE_LIB_TEXT ("%02x "),
c);
diff --git a/ace/ACE.h b/ace/ACE.h
index fd98e2fc190..1e81d958328 100644
--- a/ace/ACE.h
+++ b/ace/ACE.h
@@ -469,8 +469,8 @@ public:
// @@ UNICODE what about buffer?
/// Format buffer into printable format. This is useful for
/// debugging.
- static int format_hexdump (const char *buffer, int size,
- ACE_TCHAR *obuf, int obuf_sz);
+ static size_t format_hexdump (const char *buffer, size_t size,
+ ACE_TCHAR *obuf, size_t obuf_sz);
/// Computes the hash value of <str> using the "Hash PJW" routine.
static u_long hash_pjw (const char *str);
diff --git a/ace/Log_Msg.cpp b/ace/Log_Msg.cpp
index 1a2a06aa84c..a6d833432bf 100644
--- a/ace/Log_Msg.cpp
+++ b/ace/Log_Msg.cpp
@@ -1774,7 +1774,7 @@ ACE_Log_Msg::log (ACE_Log_Record &log_record,
int
ACE_Log_Msg::log_hexdump (ACE_Log_Priority log_priority,
const char *buffer,
- int size,
+ size_t size,
const ACE_TCHAR *text)
{
ACE_TCHAR buf[ACE_Log_Record::MAXLOGMSGLEN -
@@ -1782,17 +1782,15 @@ ACE_Log_Msg::log_hexdump (ACE_Log_Priority log_priority,
// 58 for the HEXDUMP header;
ACE_TCHAR *msg_buf;
- size_t text_sz = text ? ACE_OS::strlen(text) : 0;
+ size_t text_sz = text ? ACE_OS_String::strlen(text) : 0;
ACE_NEW_RETURN (msg_buf,
ACE_TCHAR[text_sz + 58],
-1);
buf[0] = 0; // in case size = 0
- int len = ACE::format_hexdump (buffer,
- size,
- buf,
- sizeof (buf) / sizeof (ACE_TCHAR) - text_sz);
+ size_t len = ACE::format_hexdump
+ (buffer, size, buf, sizeof (buf) / sizeof (ACE_TCHAR) - text_sz);
int sz = 0;
diff --git a/ace/Log_Msg.h b/ace/Log_Msg.h
index acc3e2160d8..a3926869fb1 100644
--- a/ace/Log_Msg.h
+++ b/ace/Log_Msg.h
@@ -536,7 +536,7 @@ public:
*/
int log_hexdump (ACE_Log_Priority log_priority,
const char *buffer,
- int size,
+ size_t size,
const ACE_TCHAR *text = 0);
static void init_hook (ACE_OS_Log_Msg_Attributes &attributes