Opened 7 years ago

Closed 7 weeks ago

Last modified 7 weeks ago

#4309 closed defect (fixed)

wxListCtrlCompare should take wxUIntPtr instead of long

Reported by: dgchurchill Owned by: VZ
Priority: normal Milestone:
Component: GUI-generic Version:
Keywords: Cc: dgchurchill
Blocked By: Blocking:
Patch: no

Description

The typedef of wxListCtrlCompare (the compare function for wxListCtrl::SortItems) currently specifies the user data parameter types as long which is inconsistent with the use of wxUIntPtr elsewhere and may cause problems when wxUIntPtr becomes bigger than a long.

Attachments (2)

ticket4309_windows_fix.patch download (3.8 KB) - added by dshmelev 3 years ago.
partial fix for windows OS
ticket4309_windows_fix_2.patch download (519 bytes) - added by ghostvoodooman 7 weeks ago.
fix unit test (GUI)

Download all attachments as: .zip

Change History (7)

Changed 3 years ago by dshmelev

partial fix for windows OS

comment:1 Changed 3 years ago by dshmelev

I am attaching a partial (windows only) patch - someone else will need to port to other operating systems, which I currently don’t have access to. Changes are simple and straightforward.

comment:2 Changed 3 years ago by VZ

  • Resolution set to fixed
  • Status changed from new to closed

(In [67733]) Make wxListCtrl sort function take wxIntPtr, not long, arguments.

As the arguments to the sort function contain the client data associated with
the items, they may be pointers and hence of greater size than long in Win64
builds. Use wxIntPtr instead of long everywhere to fix this.

Notice that this doesn't break compatibility for 32 bit code where long can
still be used as it is the same as wxIntPtr there after the previous commit.

Closes #4309.

Changed 7 weeks ago by ghostvoodooman

fix unit test (GUI)

comment:3 Changed 7 weeks ago by ghostvoodooman

  • Resolution fixed deleted
  • Status changed from closed to reopened

there is another problem in unit tests for GUI, the patch "ticket4309_windows_fix_2.patch" is attached.

comment:4 Changed 7 weeks ago by VZ

  • Owner set to VZ
  • Resolution set to fixed
  • Status changed from reopened to closed

In 76994:

Fix wxListCtrl sort callback signature in the test under Win64.

Use wxIntPtr instead of long which is not big enough to hold a pointer in
Win64 builds.

Closes #4309.

comment:5 Changed 7 weeks ago by VZ

In 76995:

Fix wxListCtrl sort callback signature in the test under Win64.

Use wxIntPtr instead of long which is not big enough to hold a pointer in
Win64 builds.

Closes #4309.

Note: See TracTickets for help on using tickets.