Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ACE/ace/ARGV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ ACE_ARGV_T<CHAR_TYPE>::create_buf_from_queue (void)
-1);
#else
ACE_NEW_RETURN (this->buf_,
CHAR_TYPE[this->length_ + this->argc_],
CHAR_TYPE[this->length_ + static_cast<unsigned int> (this->argc_)],
-1);
#endif /* ACE_HAS_ALLOC_HOOKS */

Expand Down
2 changes: 1 addition & 1 deletion ACE/ace/Acceptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ template <typename SVC_HANDLER, typename PEER_ACCEPTOR>
ACE_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::operator PEER_ACCEPTOR & () const
{
ACE_TRACE ("ACE_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::operator PEER_ACCEPTOR &");
return (PEER_ACCEPTOR &) this->peer_acceptor_;
return const_cast<PEER_ACCEPTOR &> (this->peer_acceptor_);
}

template <typename SVC_HANDLER, typename PEER_ACCEPTOR> PEER_ACCEPTOR &
Expand Down
40 changes: 20 additions & 20 deletions ACE/ace/Arg_Shifter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL

template <typename CHAR_TYPE>
ACE_Arg_Shifter_T<CHAR_TYPE>::ACE_Arg_Shifter_T (int& argc,
const CHAR_TYPE** argv,
const CHAR_TYPE** temp)
ACE_Arg_Shifter_T<CHAR_TYPE>::ACE_Arg_Shifter_T (int &argc,
CHAR_TYPE const **argv,
CHAR_TYPE const **temp)
: argc_ (argc),
total_size_ (argc),
temp_ (temp),
argv_ (argv),
temp_ (const_cast<CHAR_TYPE **> (temp)),
argv_ (const_cast<CHAR_TYPE **> (argv)),
current_index_ (0),
back_ (argc - 1),
front_ (0)
Expand All @@ -28,13 +28,13 @@ ACE_Arg_Shifter_T<CHAR_TYPE>::ACE_Arg_Shifter_T (int& argc,
}

template <typename CHAR_TYPE>
ACE_Arg_Shifter_T<CHAR_TYPE>::ACE_Arg_Shifter_T (int& argc,
CHAR_TYPE** argv,
CHAR_TYPE** temp)
ACE_Arg_Shifter_T<CHAR_TYPE>::ACE_Arg_Shifter_T (int &argc,
CHAR_TYPE **argv,
CHAR_TYPE **temp)
: argc_ (argc),
total_size_ (argc),
temp_ ((const CHAR_TYPE **) temp),
argv_ ((const CHAR_TYPE **) argv),
temp_ (temp),
argv_ (argv),
current_index_ (0),
back_ (argc - 1),
front_ (0)
Expand All @@ -49,11 +49,11 @@ ACE_Arg_Shifter_T<CHAR_TYPE>::init (void)
// If not provided with one, allocate a temporary array.
if (this->temp_ == 0)
#if defined (ACE_HAS_ALLOC_HOOKS)
this->temp_ = reinterpret_cast<const CHAR_TYPE **>
this->temp_ = reinterpret_cast<CHAR_TYPE **>
(ACE_Allocator::instance ()->malloc (sizeof (CHAR_TYPE*) * this->total_size_));
#else
ACE_NEW (this->temp_,
const CHAR_TYPE *[this->total_size_]);
CHAR_TYPE *[this->total_size_]);
#endif /* ACE_HAS_ALLOC_HOOKS */
if (this->temp_ != 0)
{
Expand Down Expand Up @@ -86,20 +86,20 @@ ACE_Arg_Shifter_T<CHAR_TYPE>::~ACE_Arg_Shifter_T (void)
}

template <typename CHAR_TYPE>
const CHAR_TYPE *
CHAR_TYPE const *
ACE_Arg_Shifter_T<CHAR_TYPE>::get_current (void) const
{
const CHAR_TYPE * retval = 0;
CHAR_TYPE const *retval = 0;

if (this->is_anything_left ())
retval = this->temp_[current_index_];
retval = this->temp_[current_index_];

return retval;
}

template <typename CHAR_TYPE>
const CHAR_TYPE *
ACE_Arg_Shifter_T<CHAR_TYPE>::get_the_parameter (const CHAR_TYPE *flag)
CHAR_TYPE const *
ACE_Arg_Shifter_T<CHAR_TYPE>::get_the_parameter (CHAR_TYPE const *flag)
{
// the return 0's abound because this method
// would otherwise be a deep if { } else { }
Expand Down Expand Up @@ -128,13 +128,13 @@ ACE_Arg_Shifter_T<CHAR_TYPE>::get_the_parameter (const CHAR_TYPE *flag)

template <typename CHAR_TYPE>
int
ACE_Arg_Shifter_T<CHAR_TYPE>::cur_arg_strncasecmp (const CHAR_TYPE *flag)
ACE_Arg_Shifter_T<CHAR_TYPE>::cur_arg_strncasecmp (CHAR_TYPE const *flag)
{
if (!this->is_anything_left ())
return -1;

const size_t flag_length = ACE_OS::strlen (flag);
const CHAR_TYPE *arg = this->temp_[this->current_index_];
CHAR_TYPE const *arg = this->temp_[this->current_index_];

if (ACE_OS::strncasecmp (arg, flag, flag_length) != 0)
return -1;
Expand Down Expand Up @@ -220,4 +220,4 @@ ACE_Arg_Shifter_T<CHAR_TYPE>::num_ignored_args (void) const

ACE_END_VERSIONED_NAMESPACE_DECL

#endif /* ACE_ATOMIC_OP_T_CPP */
#endif
12 changes: 6 additions & 6 deletions ACE/ace/Arg_Shifter.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class ACE_Arg_Shifter_T
* vector transparently.
*/
ACE_Arg_Shifter_T (int &argc,
const CHAR_TYPE **argv,
const CHAR_TYPE **temp = 0);
CHAR_TYPE const **argv,
CHAR_TYPE const **temp = 0);

/// Same behavior as the preceding constructor, but without the
/// "const" qualifier.
Expand Down Expand Up @@ -122,7 +122,7 @@ class ACE_Arg_Shifter_T
* together '-foobarflagVALUE', the flag is NOT consumed
* and the cur arg is left pointing to the entire flag/value pair
*/
const CHAR_TYPE *get_the_parameter (const CHAR_TYPE *flag);
CHAR_TYPE const *get_the_parameter (CHAR_TYPE const *flag);

/**
* Check if the current argument matches (case insensitive) @a flag
Expand Down Expand Up @@ -161,7 +161,7 @@ class ACE_Arg_Shifter_T
* Case C: If neither of Case A or B is met (no match)
* then -1 is returned
*/
int cur_arg_strncasecmp (const CHAR_TYPE *flag);
int cur_arg_strncasecmp (CHAR_TYPE const *flag);

/// Consume @a number argument(s) by sticking them/it on the end of
/// the vector.
Expand Down Expand Up @@ -202,10 +202,10 @@ class ACE_Arg_Shifter_T
int total_size_;

/// The temporary array over which we traverse.
const CHAR_TYPE **temp_;
CHAR_TYPE **temp_;

/// The array in which the arguments are reordered.
const CHAR_TYPE **argv_;
CHAR_TYPE **argv_;

/// The element in <temp_> we're currently examining.
int current_index_;
Expand Down
5 changes: 2 additions & 3 deletions ACE/ace/Based_Pointer_T.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ ACE_Based_Pointer_Basic<CONCRETE>::dump (void) const
ACELIB_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntarget_ = %d\n"), this->target_));
ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("base_offset_ = %d\n"), this->base_offset_));
ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("computed pointer = %x\n"),
(CONCRETE *)(ACE_COMPUTE_BASED_POINTER (this))));
ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("computed pointer = %x\n"), ACE_Based_Pointer_Basic::based (this)));
ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP));
#endif /* ACE_HAS_DUMP */
}
Expand Down Expand Up @@ -72,7 +71,7 @@ ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic (const void *base_add
base_offset_ (0)
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic");
this->base_offset_ = (char *) this - (char *) base_addr;
this->base_offset_ = (const char *) this - (const char *) base_addr;
}

template <class CONCRETE>
Expand Down
6 changes: 6 additions & 0 deletions ACE/ace/Based_Pointer_T.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ class ACE_Based_Pointer_Basic

/// Keep track of our offset from the base pointer.
ptrdiff_t base_offset_;

/// Convert input pointer to CONCRETE using the base_offset_ and target_ adjustments
static CONCRETE *based (ACE_Based_Pointer_Basic *p);

/// Convert input pointer to CONCRETE using the base_offset_ and target_ adjustments
static CONCRETE const *based (ACE_Based_Pointer_Basic const *p);
};

/**
Expand Down
35 changes: 22 additions & 13 deletions ACE/ace/Based_Pointer_T.inl
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
// -*- C++ -*-
#define ACE_COMPUTE_BASED_POINTER(P) (((char *) (P) - (P)->base_offset_) + (P)->target_)
#include "ace/Global_Macros.h"

ACE_BEGIN_VERSIONED_NAMESPACE_DECL

template <class CONCRETE> ACE_INLINE CONCRETE *
ACE_Based_Pointer<CONCRETE>::operator->(void)
ACE_Based_Pointer_Basic<CONCRETE>::based (ACE_Based_Pointer_Basic *p)
{
return reinterpret_cast<CONCRETE *> (reinterpret_cast<char *> (p) - p->base_offset_ + p->target_);
}

template <class CONCRETE> ACE_INLINE CONCRETE const *
ACE_Based_Pointer_Basic<CONCRETE>::based (ACE_Based_Pointer_Basic const *p)
{
return reinterpret_cast<CONCRETE const *> (reinterpret_cast<const char *> (p) - p->base_offset_ + p->target_);
}

template <class CONCRETE> ACE_INLINE CONCRETE *
ACE_Based_Pointer<CONCRETE>::operator-> ()
{
ACE_TRACE ("ACE_Based_Pointer<CONCRETE>::operator->");
return reinterpret_cast<CONCRETE *> (ACE_COMPUTE_BASED_POINTER (this));
return ACE_Based_Pointer::based (this);
}

template <class CONCRETE> ACE_INLINE void
Expand Down Expand Up @@ -39,7 +50,7 @@ template <class CONCRETE> ACE_INLINE CONCRETE
ACE_Based_Pointer_Basic<CONCRETE>::operator *(void) const
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator *");
return *reinterpret_cast<CONCRETE *> (ACE_COMPUTE_BASED_POINTER (this));
return *ACE_Based_Pointer_Basic::based (this);
}

template <class CONCRETE> ACE_INLINE CONCRETE *
Expand All @@ -50,7 +61,7 @@ ACE_Based_Pointer_Basic<CONCRETE>::addr (void) const
if (this->target_ == -1)
return 0;
else
return reinterpret_cast<CONCRETE *> (ACE_COMPUTE_BASED_POINTER (this));
return const_cast<CONCRETE *> (ACE_Based_Pointer_Basic::based (this));
}

template <class CONCRETE> ACE_INLINE
Expand All @@ -65,9 +76,7 @@ template <class CONCRETE> ACE_INLINE CONCRETE
ACE_Based_Pointer_Basic<CONCRETE>::operator [] (int index) const
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator []");
CONCRETE *c =
reinterpret_cast<CONCRETE *> (ACE_COMPUTE_BASED_POINTER (this));
return c[index];
return ACE_Based_Pointer_Basic::based (this)[index];
}

template <class CONCRETE> ACE_INLINE void
Expand All @@ -81,7 +90,7 @@ template <class CONCRETE> ACE_INLINE bool
ACE_Based_Pointer_Basic<CONCRETE>::operator == (const ACE_Based_Pointer_Basic<CONCRETE> &rhs) const
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator ==");
return ACE_COMPUTE_BASED_POINTER (this) == ACE_COMPUTE_BASED_POINTER (&rhs);
return ACE_Based_Pointer_Basic::based (this) == ACE_Based_Pointer_Basic::based (&rhs);
}

template <class CONCRETE> ACE_INLINE bool
Expand All @@ -95,28 +104,28 @@ template <class CONCRETE> ACE_INLINE bool
ACE_Based_Pointer_Basic<CONCRETE>::operator < (const ACE_Based_Pointer_Basic<CONCRETE> &rhs) const
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator <");
return ACE_COMPUTE_BASED_POINTER (this) < ACE_COMPUTE_BASED_POINTER (&rhs);
return ACE_Based_Pointer_Basic::based (this) < ACE_Based_Pointer_Basic::based (&rhs);
}

template <class CONCRETE> ACE_INLINE bool
ACE_Based_Pointer_Basic<CONCRETE>::operator <= (const ACE_Based_Pointer_Basic<CONCRETE> &rhs) const
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator <=");
return ACE_COMPUTE_BASED_POINTER (this) <= ACE_COMPUTE_BASED_POINTER (&rhs);
return ACE_Based_Pointer_Basic::based (this) <= ACE_Based_Pointer_Basic::based (&rhs);
}

template <class CONCRETE> ACE_INLINE bool
ACE_Based_Pointer_Basic<CONCRETE>::operator > (const ACE_Based_Pointer_Basic<CONCRETE> &rhs) const
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator >");
return ACE_COMPUTE_BASED_POINTER (this) > ACE_COMPUTE_BASED_POINTER (&rhs);
return ACE_Based_Pointer_Basic::based (this) > ACE_Based_Pointer_Basic::based (&rhs);
}

template <class CONCRETE> ACE_INLINE bool
ACE_Based_Pointer_Basic<CONCRETE>::operator >= (const ACE_Based_Pointer_Basic<CONCRETE> &rhs) const
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator >=");
return ACE_COMPUTE_BASED_POINTER (this) >= ACE_COMPUTE_BASED_POINTER (&rhs);
return ACE_Based_Pointer_Basic::based (this) >= ACE_Based_Pointer_Basic::based (&rhs);
}

template <class CONCRETE> ACE_INLINE void
Expand Down
2 changes: 1 addition & 1 deletion ACE/ace/CDR_Stream.inl
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ ACE_OutputCDR::write_fixed (const ACE_CDR::Fixed &x)
{
int n;
const ACE_CDR::Octet *arr = x.to_octets (n);
return this->write_array (arr, ACE_CDR::OCTET_SIZE, ACE_CDR::OCTET_ALIGN, n);
return this->write_array (arr, ACE_CDR::OCTET_SIZE, ACE_CDR::OCTET_ALIGN, static_cast<ACE_CDR::ULong> (n));
}

ACE_INLINE ACE_CDR::Boolean
Expand Down
6 changes: 3 additions & 3 deletions ACE/ace/Dynamic_Message_Strategy.inl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ACE_Dynamic_Message_Strategy::dynamic_priority_max (unsigned long ul)
// dynamic_priority_max_ is initialized or changes, and is stored
// as a class member rather than being a derived value.
dynamic_priority_max_ = ul;
pending_shift_ = ACE_Time_Value (0, ul);
pending_shift_ = ACE_Time_Value (0, static_cast<suseconds_t> (ul));
}
// set maximum supported priority value

Expand All @@ -64,8 +64,8 @@ ACE_Dynamic_Message_Strategy::dynamic_priority_offset (unsigned long ul)
// initialized or changes, and are stored as a class member rather
// than being derived each time one of their values is needed.
dynamic_priority_offset_ = ul;
max_late_ = ACE_Time_Value (0, ul - 1);
min_pending_ = ACE_Time_Value (0, ul);
max_late_ = ACE_Time_Value (0, static_cast<suseconds_t> (ul - 1));
min_pending_ = ACE_Time_Value (0, static_cast<suseconds_t> (ul));
}
// set offset for boundary between signed range and unsigned range

Expand Down
2 changes: 1 addition & 1 deletion ACE/ace/Env_Value_T.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
template <> inline void
ACE_Convert (const ACE_TCHAR *s, ACE_TCHAR *&v)
{
v = (ACE_TCHAR *) s;
v = const_cast<ACE_TCHAR *> (s);
}

template <> inline void
Expand Down
6 changes: 3 additions & 3 deletions ACE/ace/Functor.inl
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@ ACE_Command_Base::ACE_Command_Base (void)
ACE_INLINE unsigned long
ACE_Hash<char>::operator () (char t) const
{
return t;
return static_cast<unsigned long> (t);
}

#if defined (ACE_HAS_WCHAR) && ! defined (ACE_LACKS_NATIVE_WCHAR_T)
ACE_INLINE unsigned long
ACE_Hash<wchar_t>::operator () (wchar_t t) const
{
return t;
return static_cast<unsigned long> (t);
}
#endif /* ACE_HAS_WCHAR && ! ACE_LACKS_NATIVE_WCHAR_T */

ACE_INLINE unsigned long
ACE_Hash<signed char>::operator () (signed char t) const
{
return t;
return static_cast<unsigned long> (t);
}

ACE_INLINE unsigned long
Expand Down
2 changes: 1 addition & 1 deletion ACE/ace/High_Res_Timer.inl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ACE_High_Res_Timer::hrtime_to_tv (ACE_Time_Value &tv,
// That first term will be lossy, so factor out global_scale_factor_:
// tv.usec = (hrt - tv.sec * ACE_ONE_SECOND_IN_USECS * global_scale_factor_)/
// global_scale_factor
ACE_hrtime_t tmp = tv.sec ();
ACE_hrtime_t tmp = static_cast<ACE_hrtime_t> (tv.sec ());
tmp *= ((ACE_UINT32) ACE_HR_SCALE_CONVERSION * global_scale_factor ());
tv.usec ((suseconds_t) ((hrt - tmp) / global_scale_factor ()));
#else
Expand Down
6 changes: 3 additions & 3 deletions ACE/ace/INET_Addr.inl
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ ACE_INET_Addr::ip_addr_pointer (void) const
{
#if defined (ACE_HAS_IPV6)
if (this->get_type () == PF_INET)
return (void*)&this->inet_addr_.in4_.sin_addr;
return const_cast<in_addr *> (&this->inet_addr_.in4_.sin_addr);
else
return (void*)&this->inet_addr_.in6_.sin6_addr;
return const_cast<in6_addr *> (&this->inet_addr_.in6_.sin6_addr);
#else
return (void*)&this->inet_addr_.in4_.sin_addr;
return const_cast<in_addr *> (&this->inet_addr_.in4_.sin_addr);
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion ACE/ace/IO_SAP.inl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ACE_INLINE int
ACE_IO_SAP::control (int cmd, void *arg) const
{
ACE_TRACE ("ACE_IO_SAP::control");
return ACE_OS::ioctl (this->handle_, cmd, arg);
return ACE_OS::ioctl (this->handle_, static_cast<ACE_IOCTL_TYPE_ARG2> (cmd), arg);
}

ACE_END_VERSIONED_NAMESPACE_DECL
2 changes: 1 addition & 1 deletion ACE/ace/IPC_SAP.inl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ACE_INLINE int
ACE_IPC_SAP::control (int cmd, void *arg) const
{
ACE_TRACE ("ACE_IPC_SAP::control");
return ACE_OS::ioctl (this->handle_, cmd, arg);
return ACE_OS::ioctl (this->handle_, static_cast<ACE_IOCTL_TYPE_ARG2> (cmd), arg);
}

ACE_END_VERSIONED_NAMESPACE_DECL
Loading