March 24, 2005
No changes needed over and above those for recls and b64, apart from in a couple of the Open-RJ test files.

Compiles/builds/executes fine.



March 27, 2005
WinSock.h

#define INVALID_SOCKET  (SOCKET)(~0)

=>

#ifdef __cplusplus
# define INVALID_SOCKET  static_cast<SOCKET>(~0)
#else /* ? __cplusplus */
# define INVALID_SOCKET  (SOCKET)(~0)
#endif /* __cplusplus */



wtypes.h

#define VARIANT_TRUE ((VARIANT_BOOL)0xffff)
#define VARIANT_FALSE ((VARIANT_BOOL)0)

=>

#ifdef __cplusplus
# define VARIANT_TRUE static_cast<VARIANT_BOOL>(0xffff)
# define VARIANT_FALSE static_cast<VARIANT_BOOL>(0)
#else /* ? __cplusplus */
# define VARIANT_TRUE ((VARIANT_BOOL)0xffff)
# define VARIANT_FALSE ((VARIANT_BOOL)0)
#endif /* __cplusplus */


March 27, 2005
WinError.h


#if __cplusplus
# define SUCCEEDED(Status)   (static_cast<HRESULT>(Status) >= 0)
#else /* ? __cplusplus */
# define SUCCEEDED(Status)  ((HRESULT)(Status) >= 0)
#endif /* __cplusplus */

#if __cplusplus
# define FAILED(Status)   (static_cast<HRESULT>(Status) < 0)
#else /* ? __cplusplus */
# define FAILED(Status)   ((HRESULT)(Status) < 0)
#endif /* __cplusplus */


March 27, 2005
I'm now working through compilation of all the Synesis Software headers. This stuff's been around since the early 90s, and I'm finding a huge number of C-style casts in the C++ code.

Some of these are plain bugs, others, once sorted, are enormously helpful in clearing up long forgotten nuances of well-established classes that one has to be careful not to alter except with great care.




It's easy to fix them, since I've used the following cast macros for many years:

#ifdef __cplusplus
# define SyCastStatic(_type, _var)                   static_cast<_type>(_var)
# define SyCastDynamic(_type, _var)                  dynamic_cast<_type>(_var)
# define SyCastConst(_type, _var)                    const_cast<_type>(_var)
# define SyCastVolatile(_type, _var)                 const_cast<_type>(_var)
# define SyCastRaw(_type, _var)                      reinterpret_cast<_type>(_var)
#else /* ? __cplusplus */
# define SyCastStatic(_type, _var)                   ((_type)(_var))
# define SyCastDynamic(_type, _var)                  ((_type)(_var))
# define SyCastConst(_type, _var)                    ((_type)(_var))
# define SyCastVolatile(_type, _var)                 ((_type)(_var))
# define SyCastRaw(_type, _var)                      ((_type)(_var))
#endif /* __cplusplus */

If DMC++ takes up this header update seriously, I'd suggest doing something similar.



March 27, 2005
"Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:d2638f$1u8m$1@digitaldaemon.com...
> WinError.h
>
>
> #if __cplusplus
> # define SUCCEEDED(Status)   (static_cast<HRESULT>(Status) >= 0)
> #else /* ? __cplusplus */
> # define SUCCEEDED(Status)  ((HRESULT)(Status) >= 0)
> #endif /* __cplusplus */
>
> #if __cplusplus
> # define FAILED(Status)   (static_cast<HRESULT>(Status) < 0)
> #else /* ? __cplusplus */
> # define FAILED(Status)   ((HRESULT)(Status) < 0)
> #endif /* __cplusplus */

Also

#ifdef RC_INVOKED
# define _HRESULT_TYPEDEF_(_sc)  _sc
#else // RC_INVOKED
# if __cplusplus
#  define _HRESULT_TYPEDEF_(_sc)  static_cast<HRESULT>(sc)
# else /* ? __cplusplus */
#  define _HRESULT_TYPEDEF_(_sc)  ((HRESULT)_sc)
# endif /* __cplusplus */
#endif // RC_INVOKED


March 27, 2005
"Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:d264kq$2062$1@digitaldaemon.com...
>
> "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:d2638f$1u8m$1@digitaldaemon.com...
>> WinError.h
>>
>>
>> #if __cplusplus
>> # define SUCCEEDED(Status)   (static_cast<HRESULT>(Status) >= 0)
>> #else /* ? __cplusplus */
>> # define SUCCEEDED(Status)  ((HRESULT)(Status) >= 0)
>> #endif /* __cplusplus */
>>
>> #if __cplusplus
>> # define FAILED(Status)   (static_cast<HRESULT>(Status) < 0)
>> #else /* ? __cplusplus */
>> # define FAILED(Status)   ((HRESULT)(Status) < 0)
>> #endif /* __cplusplus */
>
> Also
>
> #ifdef RC_INVOKED
> # define _HRESULT_TYPEDEF_(_sc)  _sc
> #else // RC_INVOKED
> # if __cplusplus
> #  define _HRESULT_TYPEDEF_(_sc)  static_cast<HRESULT>(sc)
> # else /* ? __cplusplus */
> #  define _HRESULT_TYPEDEF_(_sc)  ((HRESULT)_sc)
> # endif /* __cplusplus */
> #endif // RC_INVOKED

Spoke too soon. The sc in "#  define _HRESULT_TYPEDEF_(_sc)  static_cast<HRESULT>(sc)" needs an underscore. :-)


March 27, 2005
"Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:d2638f$1u8m$1@digitaldaemon.com...
> WinError.h
>
>
> #if __cplusplus
> # define SUCCEEDED(Status)   (static_cast<HRESULT>(Status) >= 0)
> #else /* ? __cplusplus */
> # define SUCCEEDED(Status)  ((HRESULT)(Status) >= 0)
> #endif /* __cplusplus */
>
> #if __cplusplus
> # define FAILED(Status)   (static_cast<HRESULT>(Status) < 0)
> #else /* ? __cplusplus */
> # define FAILED(Status)   ((HRESULT)(Status) < 0)
> #endif /* __cplusplus */

More:

#if __cplusplus
# define S_OK                                  static_cast<HRESULT>(0x00000000L)
# define S_FALSE                               static_cast<HRESULT>(0x00000001L)
#else /* ? __cplusplus */
# define S_OK                                  ((HRESULT)0x00000000L)
# define S_FALSE                               ((HRESULT)0x00000001L)
#endif /* __cplusplus */


1 2 3 4 5
Next ›   Last »