lmi
[Top][All Lists]
Advanced

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

[lmi] Casting to wxUIntPtr


From: Greg Chicares
Subject: [lmi] Casting to wxUIntPtr
Date: Fri, 27 Jun 2008 01:52:38 +0000
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

In trying to address any mention of boost::numeric_cast that
seems suspicious, I came across two similar comments in
'multidimgrid_any.cpp' (quoted below). Looking in 'wx/defs.h',
I see wxPtrToUInt() and wxUIntToPtr(); should we be using one
of those? Should MultiDimGrid::GetGridAxisSelection() return
a wxUIntPtr? Or should we indeed be using boost::numeric_cast
here, perhaps to ensure that this is 64-bit clean?

int MultiDimGrid::GetGridAxisSelection(enum_axis_x_or_y x_or_y)
{
...
// TODO ?? Isn't this cast suspicious? Should boost::numeric_cast be
// used to convert the wxUIntPtr to an int? Is the return value really
// a pointer, or is it really an integer?
    return reinterpret_cast<wxUIntPtr>(choice.GetClientData(oldSel));
}

void MultiDimGrid::DoSetGridAxisSelection(enum_axis_x_or_y x_or_y, int axis)
{
...
// TODO ?? Isn't this cast suspicious? Should boost::numeric_cast be
// used to convert the wxUIntPtr to an int?
            int cdata = reinterpret_cast<wxUIntPtr>(choice.GetClientData(i));




reply via email to

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