Skip to content

Commit f18aa97

Browse files
authored
Merge pull request #2403 from jwillemsen/jwi-throw_stub_exception
Removed throw_stub_exception, not used anymore, use nullptr in some p…
2 parents 59cdd1a + 5b1bfbb commit f18aa97

4 files changed

Lines changed: 27 additions & 73 deletions

File tree

TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connector_Impl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ namespace TAO
5252
/// Constructor. @a arg parameter is used to pass any special
5353
/// state/info to the service handler upon creation. Currently used
5454
/// by HTIOP to pass protocol configuration properties.
55-
Connect_Creation_Strategy (ACE_Thread_Manager * = 0,
56-
TAO_ORB_Core* orb_core = 0,
57-
void *arg = 0,
58-
CORBA::Boolean flag = 0);
55+
Connect_Creation_Strategy (ACE_Thread_Manager * = nullptr,
56+
TAO_ORB_Core* orb_core = nullptr,
57+
void *arg = nullptr,
58+
CORBA::Boolean flag = false);
5959

6060
/// Makes HTIOP_Client_Connection_Handlers
6161
virtual int make_svc_handler (SVC_HANDLER *&sh);

TAO/tao/CDR.cpp

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -182,28 +182,6 @@ TAO_OutputCDR::TAO_OutputCDR (ACE_Data_Block *data_block,
182182
ACE_FUNCTION_TIMEPROBE (TAO_OUTPUT_CDR_CTOR5_ENTER);
183183
}
184184

185-
void
186-
TAO_OutputCDR::throw_stub_exception (int error_num)
187-
{
188-
switch (error_num)
189-
{
190-
case EINVAL : // wchar from a GIOP 1.0
191-
throw ::CORBA::MARSHAL (CORBA::OMGVMCID | 5, CORBA::COMPLETED_NO);
192-
ACE_NOTREACHED (break);
193-
#if (ERANGE != EINVAL)
194-
case ERANGE : // untranslatable character
195-
throw ::CORBA::DATA_CONVERSION (CORBA::OMGVMCID | 1,
196-
CORBA::COMPLETED_NO);
197-
ACE_NOTREACHED (break);
198-
#endif
199-
case EACCES : // wchar but no codeset
200-
throw ::CORBA::INV_OBJREF (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO);
201-
ACE_NOTREACHED (break);
202-
default :
203-
throw ::CORBA::MARSHAL ();
204-
}
205-
}
206-
207185
void
208186
TAO_OutputCDR::throw_skel_exception (int error_num )
209187
{
@@ -302,27 +280,6 @@ TAO_InputCDR::TAO_InputCDR (const TAO_OutputCDR& rhs,
302280
{
303281
}
304282

305-
void
306-
TAO_InputCDR::throw_stub_exception (int error_num )
307-
{
308-
switch (error_num)
309-
{
310-
case EINVAL : // wchar from a GIOP 1.0
311-
throw ::CORBA::MARSHAL (CORBA::OMGVMCID | 6, CORBA::COMPLETED_YES);
312-
ACE_NOTREACHED(break);
313-
#if (ERANGE != EINVAL)
314-
case ERANGE : // untranslatable character
315-
throw ::CORBA::DATA_CONVERSION (CORBA::OMGVMCID | 1, CORBA::COMPLETED_YES);
316-
ACE_NOTREACHED(break);
317-
#endif
318-
case EACCES : // wchar but no codeset
319-
throw ::CORBA::INV_OBJREF (CORBA::OMGVMCID | 2, CORBA::COMPLETED_YES);
320-
ACE_NOTREACHED(break);
321-
default :
322-
throw ::CORBA::MARSHAL (0, CORBA::COMPLETED_YES);
323-
}
324-
}
325-
326283
void
327284
TAO_InputCDR::throw_skel_exception (int error_num )
328285
{

TAO/tao/CDR.h

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ class TAO_Export TAO_OutputCDR : public ACE_OutputCDR
111111
/// buffer, if @a size == 0 it allocates the default size.
112112
TAO_OutputCDR (size_t size = 0,
113113
int byte_order = ACE_CDR_BYTE_ORDER,
114-
ACE_Allocator* buffer_allocator = 0,
115-
ACE_Allocator* data_block_allocator = 0,
116-
ACE_Allocator* message_block_allocator = 0,
114+
ACE_Allocator* buffer_allocator = nullptr,
115+
ACE_Allocator* data_block_allocator = nullptr,
116+
ACE_Allocator* message_block_allocator = nullptr,
117117
size_t memcpy_tradeoff = 0,
118118
ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
119119
ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR);
@@ -123,9 +123,9 @@ class TAO_Export TAO_OutputCDR : public ACE_OutputCDR
123123
TAO_OutputCDR (char *data,
124124
size_t size,
125125
int byte_order = ACE_CDR_BYTE_ORDER,
126-
ACE_Allocator* buffer_allocator = 0,
127-
ACE_Allocator* data_block_allocator = 0,
128-
ACE_Allocator* message_block_allocator = 0,
126+
ACE_Allocator* buffer_allocator = nullptr,
127+
ACE_Allocator* data_block_allocator = nullptr,
128+
ACE_Allocator* message_block_allocator = nullptr,
129129
size_t memcpy_tradeoff = 0,
130130
ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
131131
ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR);
@@ -156,9 +156,9 @@ class TAO_Export TAO_OutputCDR : public ACE_OutputCDR
156156
/// @a data, since it did not allocated it.
157157
TAO_OutputCDR (ACE_Data_Block *data,
158158
int byte_order = ACE_CDR_BYTE_ORDER,
159-
ACE_Allocator* message_block_allocator = 0,
159+
ACE_Allocator* message_block_allocator = nullptr,
160160
size_t memcpy_tradeoff = 0,
161-
TAO_GIOP_Fragmentation_Strategy * fs = 0,
161+
TAO_GIOP_Fragmentation_Strategy * fs = nullptr,
162162
ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
163163
ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR);
164164

@@ -169,7 +169,6 @@ class TAO_Export TAO_OutputCDR : public ACE_OutputCDR
169169
// strings and wstrings?
170170

171171
// = TAO specific methods.
172-
static void throw_stub_exception (int error_num);
173172
static void throw_skel_exception (int error_num);
174173

175174
void get_version (TAO_GIOP_Message_Version& giop_version);
@@ -329,22 +328,22 @@ class TAO_Export TAO_InputCDR : public ACE_InputCDR
329328
int byte_order = ACE_CDR_BYTE_ORDER,
330329
ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
331330
ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR,
332-
TAO_ORB_Core* orb_core = 0);
331+
TAO_ORB_Core* orb_core = nullptr);
333332

334333
/// Create an empty input stream. The caller is responsible for
335334
/// putting the right data and providing the right alignment.
336335
TAO_InputCDR (size_t bufsiz,
337336
int byte_order = ACE_CDR_BYTE_ORDER,
338337
ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
339338
ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR,
340-
TAO_ORB_Core* orb_core = 0);
339+
TAO_ORB_Core* orb_core = nullptr);
341340

342341
/// Create an input stream from an ACE_Message_Block
343342
TAO_InputCDR (const ACE_Message_Block *data,
344343
int byte_order = ACE_CDR_BYTE_ORDER,
345344
ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
346345
ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR,
347-
TAO_ORB_Core* orb_core = 0);
346+
TAO_ORB_Core* orb_core = nullptr);
348347

349348
/// Create an input stream from an ACE_Message_Block with an optional lock
350349
/// used to protect the data.
@@ -353,7 +352,7 @@ class TAO_Export TAO_InputCDR : public ACE_InputCDR
353352
int byte_order = ACE_CDR_BYTE_ORDER,
354353
ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
355354
ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR,
356-
TAO_ORB_Core* orb_core = 0);
355+
TAO_ORB_Core* orb_core = nullptr);
357356

358357

359358
/// Create an input stream from an ACE_Data_Block
@@ -362,7 +361,7 @@ class TAO_Export TAO_InputCDR : public ACE_InputCDR
362361
int byte_order = ACE_CDR_BYTE_ORDER,
363362
ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
364363
ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR,
365-
TAO_ORB_Core* orb_core = 0);
364+
TAO_ORB_Core* orb_core = nullptr);
366365

367366
/// Create an input stream from an ACE_Data_Block
368367
TAO_InputCDR (ACE_Data_Block *data,
@@ -372,7 +371,7 @@ class TAO_Export TAO_InputCDR : public ACE_InputCDR
372371
int byte_order = ACE_CDR_BYTE_ORDER,
373372
ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
374373
ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR,
375-
TAO_ORB_Core* orb_core = 0);
374+
TAO_ORB_Core* orb_core = nullptr);
376375

377376
/**
378377
* Make a copy of the current stream state, but does not copy the
@@ -389,7 +388,7 @@ class TAO_Export TAO_InputCDR : public ACE_InputCDR
389388
/**
390389
* This creates an encapsulated stream, the first byte must be (per
391390
* the spec) the byte order of the encapsulation. The default
392-
* values for the allocators in this constructor are not 0, but are
391+
* values for the allocators in this constructor are not nullptr, but are
393392
* generated by the ORB. Refer to the constructor body in CDR.cpp
394393
* for the code that supplies these values to the base class
395394
* constructor.
@@ -399,15 +398,15 @@ class TAO_Export TAO_InputCDR : public ACE_InputCDR
399398

400399
/// Create an input CDR from an output CDR.
401400
TAO_InputCDR (const TAO_OutputCDR& rhs,
402-
ACE_Allocator* buffer_allocator = 0,
403-
ACE_Allocator* data_block_allocator = 0,
404-
ACE_Allocator* message_block_allocator = 0,
405-
TAO_ORB_Core* orb_core = 0);
401+
ACE_Allocator* buffer_allocator = nullptr,
402+
ACE_Allocator* data_block_allocator = nullptr,
403+
ACE_Allocator* message_block_allocator = nullptr,
404+
TAO_ORB_Core* orb_core = nullptr);
406405

407406
/// Initialize the contents of one CDR from another, without data
408407
/// copying and with minimum locking overhead.
409408
TAO_InputCDR (ACE_InputCDR::Transfer_Contents rhs,
410-
TAO_ORB_Core* orb_core = 0);
409+
TAO_ORB_Core* orb_core = nullptr);
411410

412411
TAO_InputCDR& operator= (const TAO_InputCDR&) = default;
413412

@@ -419,11 +418,9 @@ class TAO_Export TAO_InputCDR : public ACE_InputCDR
419418
/// Accessor
420419
TAO_ORB_Core *orb_core () const;
421420

422-
ACE_Message_Block::Message_Flags
423-
clr_mb_flags( ACE_Message_Block::Message_Flags less_flags );
421+
ACE_Message_Block::Message_Flags clr_mb_flags(ACE_Message_Block::Message_Flags less_flags);
424422

425423
// = TAO specific methods.
426-
static void throw_stub_exception (int error_num);
427424
static void throw_skel_exception (int error_num);
428425

429426
/// These methods are used by valuetype indirection support.

TAO/tao/Connector_Impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ class TAO_Connect_Creation_Strategy : public ACE_Creation_Strategy<SVC_HANDLER>
4545
{
4646
public:
4747
/// Constructor.
48-
TAO_Connect_Creation_Strategy (ACE_Thread_Manager * = 0,
49-
TAO_ORB_Core* orb_core = 0);
48+
TAO_Connect_Creation_Strategy (ACE_Thread_Manager * = nullptr,
49+
TAO_ORB_Core* orb_core = nullptr);
5050

5151
/// Makes TAO_*_Client_Connection_Handlers
5252
virtual int make_svc_handler (SVC_HANDLER *&sh);

0 commit comments

Comments
 (0)