OSDN Git Service

Fix casting a pointer type to DWORD (not 64-bit compatible)
authorKimmo Varis <kimmov@gmail.com>
Fri, 20 Oct 2006 21:10:25 +0000 (21:10 +0000)
committerKimmo Varis <kimmov@gmail.com>
Fri, 20 Oct 2006 21:10:25 +0000 (21:10 +0000)
Src/Changes.txt
Src/DirView.cpp
Src/DirView.h

index 8cbb0f2..6cd5215 100644 (file)
@@ -7,6 +7,8 @@ Add new items to top.
   Src: MainFrm.cpp
  Remove unused function, fix inproper pointer usage
   Src: FileFilterHelper.cpp
+ Fix casting a pointer type to DWORD (not 64-bit compatible)
+  Src: DirView.cpp DirView.h
 
 2006-10-19 Kimmo
  PATCH: [ 1578419 ] Fix creating WinMerge folder to MyFolders always
index 137bbf9..df3d386 100644 (file)
@@ -633,8 +633,11 @@ void CDirView::HeaderContextMenu(CPoint point, int /*i*/)
                AfxGetMainWnd());
 }      
 
-/** @brief Convert number to string, with commas
-between digits in locale-appropriate manner */
+/**
+ * @brief Convert number to string.
+ * Converts number to string, with commas between digits in
+ * locale-appropriate manner.
+*/
 CString NumToStr(int n)
 {
        CString s = locality::NumToLocaleStr(n);
@@ -815,7 +818,7 @@ void CDirView::SortColumnsAppropriately()
        m_ctlSortHeader.SetSortImage(ColLogToPhys(sortCol), bSortAscending);
        //sort using static CompareFunc comparison function
        CompareState cs(this, sortCol, bSortAscending);
-       GetListCtrl().SortItems(cs.CompareFunc, reinterpret_cast<DWORD>(&cs));
+       GetListCtrl().SortItems(cs.CompareFunc, reinterpret_cast<DWORD_PTR>(&cs));
 }
 
 /// Do any last minute work as view closes
@@ -1340,8 +1343,9 @@ void CDirView::OnUpdateCtxtDirCopyRightTo(CCmdUI* pCmdUI)
 }
 
 /**
- * @brief Get keydata associated with item in given index
- * @param idx Item's index to list in UI
+ * @brief Get keydata associated with item in given index.
+ * @param [in] idx Item's index to list in UI.
+ * @return Key for item in given index.
  */
 POSITION CDirView::GetItemKey(int idx) const
 {
@@ -1350,13 +1354,23 @@ POSITION CDirView::GetItemKey(int idx) const
 
 // SetItemKey & GetItemKey encapsulate how the display list items
 // are mapped to DiffItems, which in turn are DiffContext keys to the actual DIFFITEM data
-POSITION CDirView::GetItemKeyFromData(DWORD dw) const
+
+/**
+ * @brief Convert item's data to item's key.
+ * Use this function to get item's key when item's data is known.
+ * @param [in] dw Item's data.
+ * @return Item's key.
+ */
+POSITION CDirView::GetItemKeyFromData(DWORD_PTR dw) const
 {
        return (POSITION)dw;
 }
 
 /**
- * Given index in list control, get its associated DIFFITEM data
+ * @brief Get DIFFITEM data for item.
+ * This function returns DIFFITEM data for item in given index in GUI.
+ * @param [in] sel Item's index in folder compare GUI list.
+ * @return DIFFITEM for item.
  */
 DIFFITEM CDirView::GetDiffItem(int sel) const
 {
index d00d27b..40b9eb7 100644 (file)
@@ -396,7 +396,7 @@ private:
        void DoUpdateCtxtDirCopyRightTo(CCmdUI* pCmdUI);
        void DoUpdateCtxtDirMoveLeftTo(CCmdUI* pCmdUI);
        void DoUpdateCtxtDirMoveRightTo(CCmdUI* pCmdUI);
-       POSITION GetItemKeyFromData(DWORD dw) const;
+       POSITION GetItemKeyFromData(DWORD_PTR dw) const;
        DIFFITEM GetDiffItem(int sel) const;
        DIFFITEM & GetDiffItemRef(int sel);
        const DIFFITEM & GetDiffItemConstRef(int sel) const;