lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Casting to wxUIntPtr


From: Vadim Zeitlin
Subject: Re: [lmi] Casting to wxUIntPtr
Date: Fri, 27 Jun 2008 11:31:02 +0200

On Fri, 27 Jun 2008 01:52:38 +0000 Greg Chicares <address@hidden> wrote:

GC> In trying to address any mention of boost::numeric_cast that
GC> seems suspicious, I came across two similar comments in
GC> 'multidimgrid_any.cpp' (quoted below). Looking in 'wx/defs.h',
GC> I see wxPtrToUInt() and wxUIntToPtr(); should we be using one
GC> of those?

 Yes, definitely.

GC> Should MultiDimGrid::GetGridAxisSelection() return
GC> a wxUIntPtr?

 I don't think so, the case is needed only because the wxChoice client data
is always a pointer internally -- but MultiDimGrid axis selection is always
an integer so it's correct to hide this case inside the class.

GC> Or should we indeed be using boost::numeric_cast
GC> here, perhaps to ensure that this is 64-bit clean?

 I'm not sure that using boost::numeric_cast wouldn't result in compiler
warnings (with both g++ and MSVC) in 64-bit builds. This is not a numeric
cast at all after all, it's a special kind of reinterpret_cast.

 Regards,
VZ





reply via email to

[Prev in Thread] Current Thread [Next in Thread]