summaryrefslogtreecommitdiff
path: root/ace
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1997-03-19 21:37:17 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1997-03-19 21:37:17 +0000
commit0bf81aee053629851cba34c8f0a6b4a8adcc74a2 (patch)
tree11a5f38947db04d37824c6e1e218ef159e9460ae /ace
parent1ff65fbfc3e021092d3ecf3832ef75cd5f28fddf (diff)
downloadATCD-0bf81aee053629851cba34c8f0a6b4a8adcc74a2.tar.gz
*** empty log message ***
Diffstat (limited to 'ace')
-rw-r--r--ace/Handle_Set.cpp16
-rw-r--r--ace/Handle_Set.h1
-rw-r--r--ace/Log_Msg.cpp4
-rw-r--r--ace/OS.cpp10
-rw-r--r--ace/OS.h6
-rw-r--r--ace/README1
-rw-r--r--ace/config-sunos4-g++.h2
-rw-r--r--ace/config-sunos4-lucid3.2.h2
-rw-r--r--ace/config-sunos4-sun3.x.h2
-rw-r--r--ace/config-sunos4-sun4.1.4.h2
-rw-r--r--ace/config-sunos4-sun4.x-orbix.h3
-rw-r--r--ace/config-sunos4-sun4.x.h3
12 files changed, 38 insertions, 14 deletions
diff --git a/ace/Handle_Set.cpp b/ace/Handle_Set.cpp
index c21378380cb..3eeb6032da5 100644
--- a/ace/Handle_Set.cpp
+++ b/ace/Handle_Set.cpp
@@ -204,14 +204,20 @@ ACE_Handle_Set_Iterator::ACE_Handle_Set_Iterator (const ACE_Handle_Set &f)
{
ACE_TRACE ("ACE_Handle_Set_Iterator::ACE_Handle_Set_Iterator");
#if !defined(ACE_WIN32)
+ // Loop until we've found the first non-zero bit or we run off the
+ // end of the bitset.
for (;
- this->handles_.mask_.fds_bits[this->index_] == 0;
+ this->handles_.mask_.fds_bits[this->index_] == 0
+ && this->num_ < ACE_Handle_Set::MAXSIZE
this->index_++)
this->num_ += ACE_Handle_Set::WORDSIZE;
- for (this->val_ = this->handles_.mask_.fds_bits[this->index_];
- (ACE_BIT_DISABLED (this->val_, 1)) && this->num_ < ACE_Handle_Set::MAXSIZE;
- this->num_++)
- this->val_ = (this->val_ >> 1) & MSB_MASK;
+ if (this->num_ >= ACE_Handle_Set::MAXSIZE)
+ this->num_ = this->handles_.max_handle + 1;
+ else
+ for (this->val_ = this->handles_.mask_.fds_bits[this->index_];
+ (ACE_BIT_DISABLED (this->val_, 1)) && this->num_ < ACE_Handle_Set::MAXSIZE;
+ this->num_++)
+ this->val_ = (this->val_ >> 1) & MSB_MASK;
#endif /* !ACE_WIN32 */
}
diff --git a/ace/Handle_Set.h b/ace/Handle_Set.h
index 8789ddde300..ea2751419d2 100644
--- a/ace/Handle_Set.h
+++ b/ace/Handle_Set.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ============================================================================
//
// = LIBRARY
diff --git a/ace/Log_Msg.cpp b/ace/Log_Msg.cpp
index 58fa7159698..84bfa67056b 100644
--- a/ace/Log_Msg.cpp
+++ b/ace/Log_Msg.cpp
@@ -769,9 +769,9 @@ ACE_Log_Msg::log_hexdump (ACE_Log_Priority log_priority,
int sz = 0;
if (text)
- sz = ::sprintf (msg_buf, "%s - ", text);
+ sz = ACE_OS::sprintf (msg_buf, "%s - ", text);
- sz += ::sprintf (msg_buf + sz, "HEXDUMP %d bytes", size);
+ sz += ACE_OS::sprintf (msg_buf + sz, "HEXDUMP %d bytes", size);
if (len < size)
::sprintf (msg_buf + sz, " (showing first %d bytes)", len);
diff --git a/ace/OS.cpp b/ace/OS.cpp
index 4b2b0e42705..eb297daff8b 100644
--- a/ace/OS.cpp
+++ b/ace/OS.cpp
@@ -421,10 +421,10 @@ ACE_OS::inet_ntoa (const struct in_addr addr)
// the following storage is not thread-specific!
static char buf[32];
// assumes that addr is already in network byte order
- sprintf (buf, "%d.%d.%d.%d", addr.s_addr / (256*256*256) & 255,
- addr.s_addr / (256*256) & 255,
- addr.s_addr / 256 & 255,
- addr.s_addr & 255);
+ ::sprintf (buf, "%d.%d.%d.%d", addr.s_addr / (256*256*256) & 255,
+ addr.s_addr / (256*256) & 255,
+ addr.s_addr / 256 & 255,
+ addr.s_addr & 255);
return buf;
}
#endif /* VXWORKS */
@@ -497,7 +497,7 @@ ACE_OS::sprintf (char *buf, const char *format, ...)
int result;
va_list ap;
va_start (ap, format);
- ACE_OSCALL (::vsprintf (buf, format, ap), int, -1, result);
+ ACE_OSCALL (ACE_SPRINTF_ADAPTER (::vsprintf (buf, format, ap)), int, -1, result);
va_end (ap);
return result;
}
diff --git a/ace/OS.h b/ace/OS.h
index 9148ab79c57..ab28c4e2f12 100644
--- a/ace/OS.h
+++ b/ace/OS.h
@@ -190,6 +190,12 @@ typedef int key_t;
// configuration file (e.g., config-sunos5-sunc++-4.x.h).
#include "ace/config.h"
+#if defined (ACE_HAS_CHARPTR_SPRINTF)
+#define ACE_SPRINTF_ADAPTER(X) ::strlen (X)
+#else
+#define ACE_SPRINTF_ADAPTER(X) X
+#endif /* ACE_HAS_CHARPTR_SPRINTF */
+
#if defined (__ACE_INLINE__)
#define ACE_INLINE inline
#if !defined (ACE_HAS_INLINED_OSCALLS)
diff --git a/ace/README b/ace/README
index da41027f7f9..2605b871992 100644
--- a/ace/README
+++ b/ace/README
@@ -34,6 +34,7 @@ ACE_HAS_BSTRING Platform has <bstring.h> (which contains bzero() prototype)
ACE_HAS_CANCEL_IO Platform supports the Win32 CancelIO() function (WinNT 4.0 and beyond).
ACE_HAS_CHARPTR_DL OS/platform uses char * for dlopen/dlsym args, rather than const char *.
ACE_HAS_CHARPTR_SOCKOPT OS/platform uses char * for sockopt, rather than const char *
+ACE_HAS_CHARPTR_SPRINTF sprintf() returns char * rather than int (e.g., SunOS 4.x)
ACE_HAS_CLOCK_GETTIME Platform supports POSIX 1.b clock_gettime ()
ACE_HAS_COMPLEX_LOCK Platform supports non-standard readers/writer locks...
ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES Prototypes for both signal() and struct sigaction are consistent.
diff --git a/ace/config-sunos4-g++.h b/ace/config-sunos4-g++.h
index 60248926373..0f26b15e23b 100644
--- a/ace/config-sunos4-g++.h
+++ b/ace/config-sunos4-g++.h
@@ -11,6 +11,8 @@
#endif /* ! __ACE_INLINE__ */
#define ACE_NEEDS_SYSTIME_H
+#define ACE_HAS_CHARPTR_SPRINTF
+#define ACE_HAS_UNION_WAIT
// Must specialize templates due to G++'s lame parameterized type
// support...
diff --git a/ace/config-sunos4-lucid3.2.h b/ace/config-sunos4-lucid3.2.h
index fb8dcf90207..5ecf46eaf69 100644
--- a/ace/config-sunos4-lucid3.2.h
+++ b/ace/config-sunos4-lucid3.2.h
@@ -8,6 +8,8 @@
#define ACE_CONFIG_H
#define ACE_HAS_SYS_ERRLIST
+#define ACE_HAS_CHARPTR_SPRINTF
+#define ACE_HAS_UNION_WAIT
// Platform supports System V IPC (most versions of UNIX, but not Win32)
#define ACE_HAS_SYSV_IPC
diff --git a/ace/config-sunos4-sun3.x.h b/ace/config-sunos4-sun3.x.h
index 76979b4c7c0..84607a9520c 100644
--- a/ace/config-sunos4-sun3.x.h
+++ b/ace/config-sunos4-sun3.x.h
@@ -11,7 +11,7 @@
#define ACE_HAS_SYSV_SPRINTF
#define ACE_CONFIG_H
-
+#define ACE_HAS_CHARPTR_SPRINTF
#define ACE_HAS_SYS_ERRLIST
// Platform supports System V IPC (most versions of UNIX, but not Win32)
diff --git a/ace/config-sunos4-sun4.1.4.h b/ace/config-sunos4-sun4.1.4.h
index 2a27eff54ce..9701883d107 100644
--- a/ace/config-sunos4-sun4.1.4.h
+++ b/ace/config-sunos4-sun4.1.4.h
@@ -7,7 +7,9 @@
#if !defined (ACE_CONFIG_H)
#define ACE_CONFIG_H
+#define ACE_HAS_CHARPTR_SPRINTF
#define ACE_NEEDS_SYSTIME_H
+#define ACE_HAS_UNION_WAIT
// Special addition to handle sunOS 4.1 which is unable to
// handle POSIX Prototypes !
diff --git a/ace/config-sunos4-sun4.x-orbix.h b/ace/config-sunos4-sun4.x-orbix.h
index 5b3dff64382..66c3f559adc 100644
--- a/ace/config-sunos4-sun4.x-orbix.h
+++ b/ace/config-sunos4-sun4.x-orbix.h
@@ -7,6 +7,9 @@
#if !defined (ACE_CONFIG_H)
#define ACE_CONFIG_H
+#define ACE_HAS_CHARPTR_SPRINTF
+#define ACE_HAS_UNION_WAIT
+
// Platform supports System V IPC (most versions of UNIX, but not Win32)
#define ACE_HAS_SYSV_IPC
diff --git a/ace/config-sunos4-sun4.x.h b/ace/config-sunos4-sun4.x.h
index a901f01f35b..74c1f7bd554 100644
--- a/ace/config-sunos4-sun4.x.h
+++ b/ace/config-sunos4-sun4.x.h
@@ -7,6 +7,9 @@
#if !defined (ACE_CONFIG_H)
#define ACE_CONFIG_H
+#define ACE_HAS_CHARPTR_SPRINTF
+#define ACE_HAS_UNION_WAIT
+
// Platform supports System V IPC (most versions of UNIX, but not Win32)
#define ACE_HAS_SYSV_IPC