[omniORB] Patch: removed const_cast warnings

Gary Duzan gduzan@bbn.com
Thu Jan 9 15:48:02 2003


In Message <45893.212.103.147.201.1042119352.squirrel@vmail1.volja.net> ,
   <matejkenda@volja.net> wrote:

=>Hi,
=>
=>I am making a switch from omniORB 3.0.5 to omniORB 4.0.0.
=>
=>I have noticed that omniORB's include files make some warnings when -Wcast-qual
=>option is used (g++ 3.2 on Linux).
=>
=>Please find attached a patch which removes warnings.
=>
=>Best regards,
=>
=>Matej

   You might consider using a macro, instead. Something like:

#ifdef HAS_Cplusplus_const_cast
#define CONST_CAST(t,v) const_cast<t>(v)
#else
#define CONST_CAST(t,v) (t)v
#endif

Then:

       arg_0((char*)a_0) {}

becomes:

       arg_0(CONST_CAST(char*,a_0)) {}

I'm not a big macro fan in general, but this is straightforward, and it
reduces the number of #ifdef blocks in the middle of the code.

					Gary Duzan
					BBN Technologies
					A Verizon Company