March 24, 2005
stlport/stl/_string.h

Line 193

  static const size_t npos = ~static_cast<size_t>(0);


"Walter" <newshound@digitalmars.com> wrote in message news:cvvt4t$fot$2@digitaldaemon.com...
>
> "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cvtkn4$12j7$1@digitaldaemon.com...
>> > I'd rather not. Switches to turn warnings on, pragmas to turn them
>> > off - I
>> > don't think there's much to be gained here that's worth the
>> > complexity.
>>
>> Ok. The alternative is to fix the C-style casts in the DMC++ headers. Are you amenable to adopting fixes, should I be motivated, from time to time, to detect and effect them?
>
> Sure.
>
> 


March 24, 2005
assert.h

Was (lines 39-41):

    #define assert(ignore) ((void) 0)
#else
    #define assert(e) ((void)((e) || (_assert(#e,__FILE__,__LINE__),1)))


Now (lines 39-49):

# if defined(__cplusplus)
    #define assert(ignore) (static_cast<void>(0))
# else /* ? __cplusplus */
    #define assert(ignore) ((void) 0)
# endif /* __cplusplus */
#else
# if defined(__cplusplus)
    #define assert(e) (static_cast<void>((e) || (_assert(#e,__FILE__,__LINE__),1)))
# else /* ? __cplusplus */
    #define assert(e) ((void)((e) || (_assert(#e,__FILE__,__LINE__),1)))
# endif /* __cplusplus */


March 24, 2005
stlport/stl/_ios_base.h

Line 175:

  operator void*() const { return !fail() ? static_cast<void*>(__CONST_CAST(ios_base*,this)) : static_cast<void*>(0); }

"Walter" <newshound@digitalmars.com> wrote in message news:cvvt4t$fot$2@digitaldaemon.com...
>
> "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cvtkn4$12j7$1@digitaldaemon.com...
>> > I'd rather not. Switches to turn warnings on, pragmas to turn them
>> > off - I
>> > don't think there's much to be gained here that's worth the
>> > complexity.
>>
>> Ok. The alternative is to fix the C-style casts in the DMC++ headers. Are you amenable to adopting fixes, should I be motivated, from time to time, to detect and effect them?
>
> Sure.
>
> 


March 24, 2005
stlport/stl/_string.c

Line 301:

  size_type __len = static_cast<size_type>(__last - __first);


Line 343:

      _STLP_STD::search(static_cast<const _CharT*>(this->_M_start) + __pos, static_cast<const _CharT*>(this->_M_finish),

Line 356:

      _STLP_STD::find_if(static_cast<const _CharT*>(this->_M_start) + __pos, static_cast<const
_CharT*>(this->_M_finish),

Line 373:

    const_pointer __result = _STLP_STD::find_end(static_cast<const_pointer>(this->_M_start), __last,

Lines 435-438:

    const_pointer __result = _STLP_STD::find_if(static_cast<const _CharT*>(this->_M_start) + __pos,
          static_cast<const _CharT*>(this->_M_finish),
                                _Not_within_traits<_Traits>(static_cast<const _CharType*>(__s),
           static_cast<const _CharType*>(__s) + __n));

Line 449:

    const_pointer __result = _STLP_STD::find_if(static_cast<const _CharT*>(this->_M_start) + __pos, static_cast<const
_CharT*>(this->_M_finish),

Lines 469-470:

    _Not_within_traits<_Traits>(static_cast<const _CharType*>(__s),
           static_cast<const _CharType*>(__s) + __n));

I'm getting very unimpressed with STLport as a result of all this.

As can be imagined, knowing what type of cast to apply is not immediately obvious in all cases. This, in and of itself, is clear demonstration why C++ casts should have been used in the first place!!

"Walter" <newshound@digitalmars.com> wrote in message news:cvvt4t$fot$2@digitaldaemon.com...
>
> "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cvtkn4$12j7$1@digitaldaemon.com...
>> > I'd rather not. Switches to turn warnings on, pragmas to turn them
>> > off - I
>> > don't think there's much to be gained here that's worth the
>> > complexity.
>>
>> Ok. The alternative is to fix the C-style casts in the DMC++ headers. Are you amenable to adopting fixes, should I be motivated, from time to time, to detect and effect them?
>
> Sure.
>
> 


March 24, 2005
stddef.h


NOTE: This one's not just to be thrown in, as it's sufficiently complex to need some more eyes on it.


Was (Line 66):

#define offsetof(t,i) ((size_t)((char *)&((t *)0)->i - (char *)0))

Now (Lines 66-70):

#ifdef __cplusplus
# define offsetof(t,i) (static_cast<size_t>(reinterpret_cast<char*>(&(static_cast<t*>(0))->i) - static_cast<char*>(0)))
#else /* ? __cplusplus */
# define offsetof(t,i) ((size_t)((char *)&((t *)0)->i - (char *)0))
#endif /* __cplusplus */


"Walter" <newshound@digitalmars.com> wrote in message news:cvvt4t$fot$2@digitaldaemon.com...
>
> "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cvtkn4$12j7$1@digitaldaemon.com...
>> > I'd rather not. Switches to turn warnings on, pragmas to turn them
>> > off - I
>> > don't think there's much to be gained here that's worth the
>> > complexity.
>>
>> Ok. The alternative is to fix the C-style casts in the DMC++ headers. Are you amenable to adopting fixes, should I be motivated, from time to time, to detect and effect them?
>
> Sure.
>
> 


March 24, 2005
stlport/stl/_iterator_base.h

Lines 76-77:

#   define _STLP_VALUE_TYPE(_It, _Tp)        static_cast<typename iterator_traits< _Tp >::value_type*>(0)
#   define _STLP_DISTANCE_TYPE(_It, _Tp)     static_cast<typename iterator_traits< _Tp >::difference_type*>(0)


"Walter" <newshound@digitalmars.com> wrote in message news:cvvt4t$fot$2@digitaldaemon.com...
>
> "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cvtkn4$12j7$1@digitaldaemon.com...
>> > I'd rather not. Switches to turn warnings on, pragmas to turn them
>> > off - I
>> > don't think there's much to be gained here that's worth the
>> > complexity.
>>
>> Ok. The alternative is to fix the C-style casts in the DMC++ headers. Are you amenable to adopting fixes, should I be motivated, from time to time, to detect and effect them?
>
> Sure.
>
> 


March 24, 2005
stlport/stl/_algobase.h

Line 197:

  return static_cast<_OutputIter>(__copy_trivial(__first, __last, __result));




"Walter" <newshound@digitalmars.com> wrote in message news:cvvt4t$fot$2@digitaldaemon.com...
>
> "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cvtkn4$12j7$1@digitaldaemon.com...
>> > I'd rather not. Switches to turn warnings on, pragmas to turn them
>> > off - I
>> > don't think there's much to be gained here that's worth the
>> > complexity.
>>
>> Ok. The alternative is to fix the C-style casts in the DMC++ headers. Are you amenable to adopting fixes, should I be motivated, from time to time, to detect and effect them?
>
> Sure.
>
> 


March 24, 2005
stlport/stl/_alloc.h

Line 360:

      if (__p != 0) __sgi_alloc::deallocate(static_cast<void*>(__p), __n * sizeof(value_type));

"Walter" <newshound@digitalmars.com> wrote in message news:cvvt4t$fot$2@digitaldaemon.com...
>
> "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cvtkn4$12j7$1@digitaldaemon.com...
>> > I'd rather not. Switches to turn warnings on, pragmas to turn them
>> > off - I
>> > don't think there's much to be gained here that's worth the
>> > complexity.
>>
>> Ok. The alternative is to fix the C-style casts in the DMC++ headers. Are you amenable to adopting fixes, should I be motivated, from time to time, to detect and effect them?
>
> Sure.
>
> 


March 24, 2005
stlport/stl/char_traits.h

Line 166:

    return (_Sz == 0 ? __s1 : static_cast<_CharT*>(memmove(__s1, __s2, _Sz * sizeof(_CharT))));


Line 171:

     static_cast<_CharT*>(memcpy(__s1, __s2, __n * sizeof(_CharT))));


Anyone getting a nervous feeling about STLport yet? :-(



"Walter" <newshound@digitalmars.com> wrote in message news:cvvt4t$fot$2@digitaldaemon.com...
>
> "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cvtkn4$12j7$1@digitaldaemon.com...
>> > I'd rather not. Switches to turn warnings on, pragmas to turn them
>> > off - I
>> > don't think there's much to be gained here that's worth the
>> > complexity.
>>
>> Ok. The alternative is to fix the C-style casts in the DMC++ headers. Are you amenable to adopting fixes, should I be motivated, from time to time, to detect and effect them?
>
> Sure.
>
> 


March 24, 2005
stlport/stl/_string.h

Lines 98-99:

    return find_if(static_cast<_CharT*>(_M_first), static_cast<_CharT*>(_M_last),
                   _Eq_char_bound<_Traits>(__x)) == static_cast<_CharT*>(_M_last);


"Walter" <newshound@digitalmars.com> wrote in message news:cvvt4t$fot$2@digitaldaemon.com...
>
> "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cvtkn4$12j7$1@digitaldaemon.com...
>> > I'd rather not. Switches to turn warnings on, pragmas to turn them
>> > off - I
>> > don't think there's much to be gained here that's worth the
>> > complexity.
>>
>> Ok. The alternative is to fix the C-style casts in the DMC++ headers. Are you amenable to adopting fixes, should I be motivated, from time to time, to detect and effect them?
>
> Sure.
>
>