Skip to content

Commit aa04330

Browse files
committed
Fixed merge
2 parents 372e143 + ffa2efd commit aa04330

8 files changed

Lines changed: 62 additions & 85 deletions

File tree

ACE/ace/CDR_Base.h

Lines changed: 41 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -63,54 +63,44 @@ class ACE_Export ACE_CDR
6363
{
6464
public:
6565
// = Constants defined by the CDR protocol.
66-
// By defining as many of these constants as possible as enums we
67-
// ensure they get inlined and avoid pointless static memory
68-
// allocations.
6966

70-
enum
71-
{
72-
// Note that some of these get reused as part of the standard
73-
// binary format: unsigned is the same size as its signed cousin,
74-
// float is LONG_SIZE, and double is LONGLONG_SIZE.
75-
76-
OCTET_SIZE = 1,
77-
SHORT_SIZE = 2,
78-
LONG_SIZE = 4,
79-
LONGLONG_SIZE = 8,
80-
LONGDOUBLE_SIZE = 16,
81-
82-
OCTET_ALIGN = 1,
83-
SHORT_ALIGN = 2,
84-
LONG_ALIGN = 4,
85-
LONGLONG_ALIGN = 8,
86-
/// @note the CORBA LongDouble alignment requirements do not
87-
/// match its size...
88-
LONGDOUBLE_ALIGN = 8,
89-
90-
/// Maximal CDR 1.1 alignment: "quad precision" FP (i.e. "CDR::Long
91-
/// double", size as above).
92-
MAX_ALIGNMENT = 8,
93-
94-
/// The default buffer size.
95-
/**
96-
* @todo We want to add options to control this
97-
* default value, so this constant should be read as the default
98-
* default value ;-)
99-
*/
100-
DEFAULT_BUFSIZE = ACE_DEFAULT_CDR_BUFSIZE,
101-
102-
/// The buffer size grows exponentially until it reaches this size;
103-
/// afterwards it grows linearly using the next constant
104-
EXP_GROWTH_MAX = ACE_DEFAULT_CDR_EXP_GROWTH_MAX,
105-
106-
/// Once exponential growth is ruled out the buffer size increases
107-
/// in chunks of this size, note that this constants have the same
108-
/// value right now, but it does not need to be so.
109-
LINEAR_GROWTH_CHUNK = ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK
110-
};
67+
static constexpr size_t OCTET_SIZE = 1;
68+
static constexpr size_t SHORT_SIZE = 2;
69+
static constexpr size_t LONG_SIZE = 4;
70+
static constexpr size_t LONGLONG_SIZE = 8;
71+
static constexpr size_t LONGDOUBLE_SIZE = 16;
72+
73+
static constexpr size_t OCTET_ALIGN = 1;
74+
static constexpr size_t SHORT_ALIGN = 2;
75+
static constexpr size_t LONG_ALIGN = 4;
76+
static constexpr size_t LONGLONG_ALIGN = 8;
77+
/// @note the CORBA LongDouble alignment requirements do not
78+
/// match its size...
79+
static constexpr size_t LONGDOUBLE_ALIGN = 8;
80+
81+
/// Maximal CDR 1.1 alignment: "quad precision" FP (i.e. "CDR::Long
82+
/// double", size as above).
83+
static constexpr size_t MAX_ALIGNMENT = 8;
84+
85+
/// The default buffer size.
86+
/**
87+
* @todo We want to add options to control this
88+
* default value, so this constant should be read as the default
89+
* default value ;-)
90+
*/
91+
static constexpr size_t DEFAULT_BUFSIZE = ACE_DEFAULT_CDR_BUFSIZE;
92+
93+
/// The buffer size grows exponentially until it reaches this size;
94+
/// afterwards it grows linearly using the next constant
95+
static constexpr size_t EXP_GROWTH_MAX = ACE_DEFAULT_CDR_EXP_GROWTH_MAX;
96+
97+
/// Once exponential growth is ruled out the buffer size increases
98+
/// in chunks of this size, note that this constants have the same
99+
/// value right now, but it does not need to be so.
100+
static constexpr size_t LINEAR_GROWTH_CHUNK = ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK;
111101

112102
/**
113-
* @enum Byte_Order
103+
* @class Byte_Order
114104
*
115105
* Defines values for the byte_order argument to ACE_OutputCDR and
116106
* ACE_InputCDR.
@@ -135,18 +125,10 @@ class ACE_Export ACE_CDR
135125
static void swap_4 (char const *orig, char *target);
136126
static void swap_8 (char const *orig, char *target);
137127
static void swap_16 (char const *orig, char *target);
138-
static void swap_2_array (char const *orig,
139-
char *target,
140-
size_t length);
141-
static void swap_4_array (char const *orig,
142-
char *target,
143-
size_t length);
144-
static void swap_8_array (char const *orig,
145-
char *target,
146-
size_t length);
147-
static void swap_16_array (char const *orig,
148-
char *target,
149-
size_t length);
128+
static void swap_2_array (char const *orig, char *target, size_t length);
129+
static void swap_4_array (char const *orig, char *target, size_t length);
130+
static void swap_8_array (char const *orig, char *target, size_t length);
131+
static void swap_16_array (char const *orig, char *target, size_t length);
150132

151133
/// Align the message block to ACE_CDR::MAX_ALIGNMENT,
152134
/// set by the CORBA spec at 8 bytes.
@@ -184,11 +166,9 @@ class ACE_Export ACE_CDR
184166
* @retval -1 Failure
185167
* @retval 0 Success.
186168
*/
187-
static int consolidate (ACE_Message_Block *dst,
188-
const ACE_Message_Block *src);
169+
static int consolidate (ACE_Message_Block *dst, const ACE_Message_Block *src);
189170

190-
static size_t total_length (const ACE_Message_Block *begin,
191-
const ACE_Message_Block *end);
171+
static size_t total_length (const ACE_Message_Block *begin, const ACE_Message_Block *end);
192172

193173
/**
194174
* @name Basic OMG IDL Types

ACE/apps/JAWS/server/HTTP_Server.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515

1616
namespace JAWS
1717
{
18-
static constexpr size_t JAWS_POOL = 0;
19-
static constexpr size_t JAWS_PER_REQUEST = 1;
18+
static constexpr int JAWS_POOL = 0;
19+
static constexpr int JAWS_PER_REQUEST = 1;
2020

21-
static constexpr size_t JAWS_SYNCH = 0;
22-
static constexpr size_t JAWS_ASYNCH = 2;
21+
static constexpr int JAWS_SYNCH = 0;
22+
static constexpr int JAWS_ASYNCH = 2;
2323
}
2424

2525
void

ACE/tests/Bug_3943_Regression_Test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ namespace {
7272
const char START_CHAR = '0';
7373
bool server_complete = false;
7474
bool client_complete = false;
75-
volatile int expected_num_messages = 0;
75+
int expected_num_messages = 0;
7676

7777
char nextChar(const char current)
7878
{

TAO/orbsvcs/ImplRepo_Service/Locator_Loader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ImR_Locator_ORB_Runner : public ACE_Task_Base
2020
ImR_Locator_Loader& service_;
2121
};
2222

23-
ImR_Locator_Loader::ImR_Locator_Loader()
23+
ImR_Locator_Loader::~ImR_Locator_Loader()
2424
{
2525
}
2626

TAO/orbsvcs/ImplRepo_Service/Locator_Loader.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ class ImR_Locator_ORB_Runner;
1717
class Locator_Export ImR_Locator_Loader : public TAO_Object_Loader
1818
{
1919
public:
20-
ImR_Locator_Loader();
20+
ImR_Locator_Loader() = default;
21+
~ImR_Locator_Loader();
2122

22-
virtual int init (int argc, ACE_TCHAR *argv[]);
23+
int init (int argc, ACE_TCHAR *argv[]) override;
2324

24-
virtual int fini ();
25+
int fini () override;
2526

26-
virtual CORBA::Object_ptr create_object (CORBA::ORB_ptr orb,
27-
int argc,
28-
ACE_TCHAR *argv[]);
27+
CORBA::Object_ptr create_object (CORBA::ORB_ptr orb,
28+
int argc,
29+
ACE_TCHAR *argv[]) override;
2930

3031
// Unlike other service objects, we have our own orb.
3132
int run();

TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Receiver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ TAO_ECG_CDR_Message_Receiver::handle_input (
275275
0);
276276
}
277277

278-
if (n < TAO_ECG_CDR_Message_Sender::ECG_HEADER_SIZE)
278+
if (n < static_cast<ssize_t>(TAO_ECG_CDR_Message_Sender::ECG_HEADER_SIZE))
279279
{
280280
ORBSVCS_ERROR_RETURN ((LM_ERROR, "Trying to read mcast fragment: "
281281
"# of bytes read < mcast header size.\n"),

TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Sender.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,14 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL
7373
class TAO_RTEvent_Serv_Export TAO_ECG_CDR_Message_Sender
7474
{
7575
public:
76-
enum {
77-
ECG_HEADER_SIZE = 32,
78-
ECG_MIN_MTU = 32 + 8,
79-
ECG_MAX_MTU = 65536, // Really optimistic...
80-
ECG_DEFAULT_MTU = 1024
81-
};
76+
static constexpr size_t ECG_HEADER_SIZE = 32;
77+
static constexpr size_t ECG_MIN_MTU = 32 + 8;
78+
static constexpr size_t ECG_MAX_MTU = 65536; // Really optimistic...
79+
static constexpr size_t ECG_DEFAULT_MTU = 1024;
8280

8381
/// Initialization and termination methods.
8482
//@{
85-
TAO_ECG_CDR_Message_Sender (CORBA::Boolean crc = 0);
83+
TAO_ECG_CDR_Message_Sender (CORBA::Boolean crc = false);
8684

8785
/// Set the endpoint for sending messages.
8886
/**

TAO/tao/GIOP_Message_Generator_Parser_10.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,8 @@ TAO_GIOP_Message_Generator_Parser_10::write_reply_header (
199199
if (reply.is_dsi_ == true)
200200
{
201201
// @@ Much of this code is GIOP 1.1 specific and should be
202-
ptrdiff_t target = reply.dsi_nvlist_align_;
203-
204-
ptrdiff_t const current =
205-
ptrdiff_t (output.current_alignment ()) % ACE_CDR::MAX_ALIGNMENT;
202+
size_t const target = static_cast<size_t>(reply.dsi_nvlist_align_);
203+
size_t const current = output.current_alignment () % ACE_CDR::MAX_ALIGNMENT;
206204

207205
CORBA::ULong pad = 0;
208206

0 commit comments

Comments
 (0)