- wxEVT_GRID_CELL_CHANGE event renamed to wxEVT_GRID_CELL_CHANGED and shouldn't
   be vetoed any more, use the new wxEVT_GRID_CELL_CHANGING event to do it.
 
+- wxListCtrlCompare function used with wxListCtrl::SortItems() must now declare
+  its third parameter as wxUIntPtr and not long (this allows passing pointers
+  to it under 64 bit platforms too).
+
 - Global wxPendingEvents and wxPendingEventsLocker objects were removed.
   You may use wxEventLoopBase::SuspendProcessingOfPendingEvents instead of
   locking wxPendingEventsLocker now.
 
     long InsertColumn( long col, const wxString& heading,
                        int format = wxLIST_FORMAT_LEFT, int width = -1 );
     bool ScrollList( int dx, int dy );
-    bool SortItems( wxListCtrlCompare fn, long data );
+    bool SortItems( wxListCtrlCompare fn, wxUIntPtr data );
     bool Update( long item );
     // Must provide overload to avoid hiding it (and warnings about it)
     virtual void Update() { wxControl::Update(); }
 
     void InsertItem( wxListItem &item );
     void InsertColumn( long col, wxListItem &item );
     int GetItemWidthWithImage(wxListItem * item);
-    void SortItems( wxListCtrlCompare fn, long data );
+    void SortItems( wxListCtrlCompare fn, wxUIntPtr data );
 
     size_t GetItemCount() const;
     bool IsEmpty() const { return GetItemCount() == 0; }
 
 // ----------------------------------------------------------------------------
 
 // type of compare function for wxListCtrl sort operation
-typedef int (wxCALLBACK *wxListCtrlCompare)(long item1, long item2, long sortData);
+typedef
+int (wxCALLBACK *wxListCtrlCompare)(long item1, long item2, wxUIntPtr sortData);
 
 // ----------------------------------------------------------------------------
 // wxListCtrl constants
 
     // or zero if the two items are equivalent.
 
     // data is arbitrary data to be passed to the sort function.
-    bool SortItems(wxListCtrlCompare fn, long data);
+    bool SortItems(wxListCtrlCompare fn, wxUIntPtr data);
 
     // IMPLEMENTATION
     virtual bool MSWCommand(WXUINT param, WXWORD id);
 
   // or zero if the two items are equivalent.
 
   // data is arbitrary data to be passed to the sort function.
-  bool SortItems(wxListCtrlCompare fn, long data);
+  bool SortItems(wxListCtrlCompare fn, wxUIntPtr data);
 
   wxMacDataBrowserListCtrlControl* GetListPeer() const;
 
   void Command(wxCommandEvent& event) { ProcessCommand(event); };
 
   wxListCtrlCompare GetCompareFunc() { return m_compareFunc; };
-  long GetCompareFuncData() { return m_compareFuncData; };
+  wxUIntPtr GetCompareFuncData() { return m_compareFuncData; };
 
 
   // public overrides needed for pimpl approach
   void*  m_macListCtrlEventHandler;
   void*  m_cgContext;
   wxListCtrlCompare m_compareFunc;
-  long m_compareFuncData;
+  wxUIntPtr m_compareFuncData;
 
   wxTextCtrl*       m_textCtrl;        // The control used for editing a label
   wxImageList *     m_imageListNormal; // The image list for normal icons
 
         using the specified @a fnSortCallBack function. This function must have the
         following prototype:
         @code
-        int wxCALLBACK wxListCompareFunction(long item1, long item2, long sortData)
+        int wxCALLBACK wxListCompareFunction(long item1, long item2, wxUIntPtr sortData)
         @endcode
 
         It is called each time when the two items must be compared and should return 0
 
         Please see the @ref page_samples_listctrl for an example of using this function.
     */
-    bool SortItems(wxListCtrlCompare fnSortCallBack, long data);
+    bool SortItems(wxListCtrlCompare fnSortCallBack, wxUIntPtr data);
 
 protected:
 
 
 // number of items in icon/small icon view
 static const int NUM_ICONS = 9;
 
-int wxCALLBACK MyCompareFunction(long item1, long item2, long WXUNUSED(sortData))
+int wxCALLBACK
+MyCompareFunction(long item1, long item2, wxUIntPtr WXUNUSED(sortData))
 {
     // inverse the order
     if (item1 < item2)
 
 // ----------------------------------------------------------------------------
 
 static
-int wxCALLBACK wxFileDataNameCompare( long data1, long data2, long sortOrder)
+int wxCALLBACK wxFileDataNameCompare( long data1, long data2, wxUIntPtr sortOrder)
 {
      wxFileData *fd1 = (wxFileData *)wxUIntToPtr(data1);
      wxFileData *fd2 = (wxFileData *)wxUIntToPtr(data2);
 }
 
 static
-int wxCALLBACK wxFileDataSizeCompare(long data1, long data2, long sortOrder)
+int wxCALLBACK wxFileDataSizeCompare(long data1, long data2, wxUIntPtr sortOrder)
 {
      wxFileData *fd1 = (wxFileData *)wxUIntToPtr(data1);
      wxFileData *fd2 = (wxFileData *)wxUIntToPtr(data2);
 }
 
 static
-int wxCALLBACK wxFileDataTypeCompare(long data1, long data2, long sortOrder)
+int wxCALLBACK wxFileDataTypeCompare(long data1, long data2, wxUIntPtr sortOrder)
 {
      wxFileData *fd1 = (wxFileData *)wxUIntToPtr(data1);
      wxFileData *fd2 = (wxFileData *)wxUIntToPtr(data2);
 }
 
 static
-int wxCALLBACK wxFileDataTimeCompare(long data1, long data2, long sortOrder)
+int wxCALLBACK wxFileDataTimeCompare(long data1, long data2, wxUIntPtr sortOrder)
 {
      wxFileData *fd1 = (wxFileData *)wxUIntToPtr(data1);
      wxFileData *fd2 = (wxFileData *)wxUIntToPtr(data2);
 
 // ----------------------------------------------------------------------------
 
 static wxListCtrlCompare list_ctrl_compare_func_2;
-static long              list_ctrl_compare_data;
+static wxUIntPtr         list_ctrl_compare_data;
 
 int LINKAGEMODE list_ctrl_compare_func_1( wxListLineData **arg1, wxListLineData **arg2 )
 {
     return list_ctrl_compare_func_2( data1, data2, list_ctrl_compare_data );
 }
 
-void wxListMainWindow::SortItems( wxListCtrlCompare fn, long data )
+void wxListMainWindow::SortItems( wxListCtrlCompare fn, wxUIntPtr data )
 {
     // selections won't make sense any more after sorting the items so reset
     // them
 // or zero if the two items are equivalent.
 // data is arbitrary data to be passed to the sort function.
 
-bool wxGenericListCtrl::SortItems( wxListCtrlCompare fn, long data )
+bool wxGenericListCtrl::SortItems( wxListCtrlCompare fn, wxUIntPtr data )
 {
     m_mainWin->SortItems( fn, data );
     return true;
 
 struct wxInternalDataSort
 {
     wxListCtrlCompare user_fn;
-    long data;
+    wxUIntPtr data;
 };
 
 int CALLBACK wxInternalDataCompareFunc(LPARAM lParam1, LPARAM lParam2,  LPARAM lParamSort)
 {
-    struct wxInternalDataSort *internalData = (struct wxInternalDataSort *) lParamSort;
+    wxInternalDataSort * const internalData = (wxInternalDataSort *) lParamSort;
 
     wxListItemInternalData *data1 = (wxListItemInternalData *) lParam1;
     wxListItemInternalData *data2 = (wxListItemInternalData *) lParam2;
 
 }
 
-bool wxListCtrl::SortItems(wxListCtrlCompare fn, long data)
+bool wxListCtrl::SortItems(wxListCtrlCompare fn, wxUIntPtr data)
 {
-    struct wxInternalDataSort internalData;
+    wxInternalDataSort internalData;
     internalData.user_fn = fn;
     internalData.data = data;
 
 
 }
 
 
-bool wxListCtrl::SortItems(wxListCtrlCompare fn, long data)
+bool wxListCtrl::SortItems(wxListCtrlCompare fn, wxUIntPtr data)
 {
     if (m_genericImpl)
         return m_genericImpl->SortItems(fn, data);