OSDN Git Service

[ 671037 ] Changes to common for MSVC.NET
authorChristian List <list1974@hotmail.com>
Tue, 21 Jan 2003 22:27:53 +0000 (22:27 +0000)
committerChristian List <list1974@hotmail.com>
Tue, 21 Jan 2003 22:27:53 +0000 (22:27 +0000)
Src/Common/textfile.cpp
Src/Common/textfile.h
Src/DirActions.cpp
Src/readme.txt

index 951569d..8982e43 100644 (file)
@@ -214,9 +214,9 @@ CString CTextFile::FindDSCCommentString(LPCTSTR szStringToFind, LPCTSTR pszEndOn
        return CString(_T(""));
 }
 
-DWORD CTextFile::GetPosition() const
+CTextFile::POSOFFSET CTextFile::GetPosition() const
 {
-       DWORD pos = CFile::GetPosition();
+       POSOFFSET pos = CFile::GetPosition();
        pos -= tcssubptr(m_pBuf, m_endBuf);
        return pos;
 }
@@ -274,7 +274,7 @@ void CTextFile::Reset()
        m_cntBuf = 0;
 }
 
-LONG CTextFile::Seek( LONG lOff, UINT nFrom )
+CTextFile::SEEKOFFSET CTextFile::Seek( SEEKOFFSET lOff, UINT nFrom )
 {
        if (nFrom == CFile::current)
        {
index 244f2f8..39929b1 100644 (file)
 #define XML_BOOL7(bVal, name) ((bVal)? (_T("\t\t\t\t\t\t\t<") _T(#name) _T("/>\r\n")):_T(""))
 #define XML_BOOL8(bVal, name) ((bVal)? (_T("\t\t\t\t\t\t\t\t<") _T(#name) _T("/>\r\n")):_T(""))
 
-class CTextFile : public CFile
+
+class CTextFile : protected CFile
 {
-  TCHAR *m_pBuf, *m_endBuf, m_buf[TEXTFILE_BUFSIZE], m_bufParse[TEXTFILE_BUFSIZE];
+
+// CFile::Seek(...) and CFile::GetPosition() are 32-bit in MSVC6 but 64-bit in MSVC7
+#if _MSC_VER < 1300
+       typedef LONG SEEKOFFSET;
+       typedef DWORD POSOFFSET;
+#else
+       typedef ULONGLONG SEEKOFFSET;
+       typedef ULONGLONG POSOFFSET;
+#endif
+       
+       
+       TCHAR *m_pBuf, *m_endBuf, m_buf[TEXTFILE_BUFSIZE], m_bufParse[TEXTFILE_BUFSIZE];
   int m_cntBuf;
   
   void Reset();
@@ -64,11 +76,10 @@ public:
        CString FindString(LPCTSTR szStringToFind, UINT nFrom = CFile::begin, DWORD dwOffset = 0);
        CString FindDSCCommentString(LPCTSTR szStringToFind, LPCTSTR pszEndOn =_T("%%EndComments"), UINT nFrom = CFile::begin, DWORD dwOffset = 0);
        BOOL IsOpen() const { return m_hFile != CFile::hFileNull; }
-       virtual LONG Seek( LONG lOff, UINT nFrom );
+       virtual SEEKOFFSET Seek( SEEKOFFSET lOff, UINT nFrom );
        void SeekToBegin( );
        void SeekToEnd( );
-       virtual DWORD GetPosition( ) const;
-       
+       virtual POSOFFSET GetPosition( ) const;
        virtual BOOL ParseXMLValue(LPTSTR pszResult, DWORD dwMax, LPCTSTR pszEndTag);
 
        template <class T> BOOL ParseXMLValue(T& value, LPCTSTR pszEndTag)
index 37e9109..fa95dba 100644 (file)
@@ -211,7 +211,7 @@ BOOL CDirView::ConfirmActionList(const ActionList & actionList)
        case ACT_COPY:
                if (actionList.GetCount()==1)
                {
-                       action & act = actionList.actions.GetHead();
+                       const action & act = actionList.actions.GetHead();
                        if (!ConfirmSingleCopy(act.src, act.dest))
                                return FALSE;
                }
@@ -224,7 +224,7 @@ BOOL CDirView::ConfirmActionList(const ActionList & actionList)
        default: // deletes
                if (actionList.GetCount()==1 && actionList.atype!=ACT_DEL_BOTH)
                {
-                       action & act = actionList.actions.GetHead();
+                       const action & act = actionList.actions.GetHead();
                        if (!ConfirmSingleDelete(act.src))
                                return FALSE;
                }
index 49b3cd6..768dadf 100644 (file)
@@ -1,3 +1,6 @@
+2003-01-21
+ [ 671037 ] Changes for MSVC.NET
+
 2003-01-20
  [ 671034 ] operator precedence bug in SplitterWndEx.cpp