OSDN Git Service

Use std::int64_t instead of Poco::Int64
authorsdottaka <sdottaka@users.sourceforge.net>
Sat, 29 Nov 2014 04:09:47 +0000 (13:09 +0900)
committersdottaka <sdottaka@users.sourceforge.net>
Sat, 29 Nov 2014 04:09:47 +0000 (13:09 +0900)
--HG--
branch : stable

32 files changed:
Src/Common/UniFile.cpp
Src/Common/UniFile.h
Src/Common/multiformatText.cpp
Src/Common/unicoder.cpp
Src/Common/unicoder.h
Src/CompareEngines/ByteComparator.cpp
Src/CompareEngines/ByteComparator.h
Src/CompareEngines/ByteCompare.cpp
Src/CompareEngines/TimeSizeCompare.cpp
Src/Diff3.h
Src/DiffContext.cpp
Src/DiffContext.h
Src/DiffItemList.cpp
Src/DiffItemList.h
Src/DiffTextBuffer.cpp
Src/DiffThread.h
Src/DirDoc.cpp
Src/DirDoc.h
Src/DirItem.h
Src/DirScan.cpp
Src/DirScan.h
Src/DirTravel.cpp
Src/DirView.cpp
Src/DirView.h
Src/DirViewColHandler.cpp
Src/DirViewColItems.cpp
Src/FileTextStats.h
Src/ImgMergeFrm.cpp
Src/MergeDoc.cpp
Src/locality.cpp
Src/locality.h
Src/markdown.cpp

index 3d4f976..283c9aa 100644 (file)
@@ -33,9 +33,10 @@ THE SOFTWARE.
 #include "UniFile.h"
 #include <cstdio>
 #include <cassert>
+#include <memory>
+#include <cstdint>
 #include <Poco/SharedMemory.h>
 #include <Poco/Exception.h>
-#include <memory>
 #include "UnicodeString.h"
 #include "unicoder.h"
 #include "paths.h" // paths_GetLongbPath()
@@ -44,7 +45,6 @@ THE SOFTWARE.
 #include <windows.h>
 #endif
 
-using Poco::Int64;
 using Poco::SharedMemory;
 using Poco::Exception;
 
@@ -141,7 +141,7 @@ bool UniLocalFile::DoGetFileStatus()
                        DWORD dwFileSizeLow, dwFileSizeHigh;
                        dwFileSizeLow = GetCompressedFileSize(m_filepath.c_str(), &dwFileSizeHigh);
                        if (GetLastError() == 0)
-                               m_filesize = ((Int64)dwFileSizeHigh << 32) + dwFileSizeLow;
+                               m_filesize = ((int64_t)dwFileSizeHigh << 32) + dwFileSizeLow;
                }
 #endif
                m_statusFetched = 1;
@@ -422,7 +422,7 @@ static void Append(String &strBuffer, const TCHAR *pchTail,
 /**
  * @brief Record occurrence of binary zero to stats
  */
-static void RecordZero(UniFile::txtstats & txstats, Int64 offset)
+static void RecordZero(UniFile::txtstats & txstats, int64_t offset)
 {
        ++txstats.nzeros;
 }
@@ -453,7 +453,7 @@ bool UniMemFile::ReadString(String & line, String & eol, bool * lossy)
                while (m_current - m_base + 1 < m_filesize)
                {
                        wchar_t wch = *(wchar_t *)m_current;
-                       Int64 wch_offset = (m_current - m_base);
+                       int64_t wch_offset = (m_current - m_base);
                        m_current += 2;
                        if (wch == '\n' || wch == '\r')
                        {
@@ -553,7 +553,7 @@ bool UniMemFile::ReadString(String & line, String & eol, bool * lossy)
                        }
                        if (*eolptr == 0)
                        {
-                               Int64 offset = (eolptr - m_base);
+                               int64_t offset = (eolptr - m_base);
                                RecordZero(m_txtstats, offset);
                        }
                }
@@ -669,7 +669,7 @@ bool UniMemFile::ReadString(String & line, String & eol, bool * lossy)
                }
                else if (!ch)
                {
-                       Int64 offset = (m_current - m_base);
+                       int64_t offset = (m_current - m_base);
                        RecordZero(m_txtstats, offset);
                }
                // always advance to next character
@@ -961,7 +961,7 @@ bool UniStdioFile::WriteString(const String & line)
        return true;
 }
 
-Int64 UniStdioFile::GetPosition() const
+int64_t UniStdioFile::GetPosition() const
 {
        if (!IsOpen()) return 0;
        return ftell(m_fp);
index b29db83..1748042 100644 (file)
@@ -13,8 +13,7 @@
 #define UniFile_h_included
 
 #include "unicoder.h"
-#define POCO_NO_UNWINDOWS 1
-#include <Poco/Types.h>
+#include <cstdint>
 
 namespace Poco { class SharedMemory; }
 
@@ -60,7 +59,7 @@ public:
        virtual bool ReadString(String & line, bool * lossy) = 0;
        virtual bool ReadString(String & line, String & eol, bool * lossy) = 0;
        virtual int GetLineNumber() const = 0;
-       virtual Poco::Int64 GetPosition() const = 0;
+       virtual int64_t GetPosition() const = 0;
        virtual bool WriteString(const String & line) = 0;
 
        struct txtstats
@@ -127,7 +126,7 @@ protected:
 
 protected:
        int m_statusFetched; // 0 not fetched, -1 error, +1 success
-       Poco::Int64 m_filesize;
+       int64_t m_filesize;
        String m_filepath;
        String m_filename;
        int m_lineno; // current 0-based line of m_current
@@ -172,7 +171,7 @@ public:
 public:
        virtual bool ReadString(String & line, bool * lossy);
        virtual bool ReadString(String & line, String & eol, bool * lossy);
-       virtual Poco::Int64 GetPosition() const { return m_current - m_base; }
+       virtual int64_t GetPosition() const { return m_current - m_base; }
        virtual bool WriteString(const String & line);
 
 // Implementation methods
@@ -217,7 +216,7 @@ protected:
        virtual bool ReadString(String & line, String & eol, bool * lossy);
 
 public:
-       virtual Poco::Int64 GetPosition() const;
+       virtual int64_t GetPosition() const;
 
        virtual int WriteBom();
        virtual bool WriteString(const String & line);
@@ -230,7 +229,7 @@ protected:
 // Implementation data
 private:
        FILE * m_fp;
-       Poco::Int64 m_data; // offset after any initial BOM
+       int64_t m_data; // offset after any initial BOM
        ucr::buffer m_ucrbuff;
 };
 
index 5257ed8..5f73880 100644 (file)
@@ -35,6 +35,7 @@
 #include <cstring>
 #include <cassert>
 #include <memory>
+#include <cstdint>
 #include <Poco/SharedMemory.h>
 #include <Poco/FileStream.h>
 #include <Poco/ByteOrder.h>
@@ -55,7 +56,6 @@ using Poco::FileOutputStream;
 using Poco::ByteOrder;
 using Poco::Exception;
 using Poco::Buffer;
-using Poco::Int64;
 
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -611,7 +611,7 @@ bool AnyCodepageToUTF8(int codepage, const String& filepath, const String& filep
                // create the destination file
                FileOutputStream fout(ucr::toUTF8(filepathDst), std::ios::out|std::ios::binary|std::ios::trunc);
                Buffer<char> obuf(minbufsize);
-               Int64 pos = nSizeOldBOM;
+               int64_t pos = nSizeOldBOM;
 
                // write BOM
                if (bWriteBOM)
index edfe9e8..32d8c7e 100644 (file)
@@ -21,6 +21,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 #include <tchar.h>
 #include <cassert>
 #include <memory>
+#include <cstdint>
 #include <Poco/UnicodeConverter.h>
 #include "UnicodeString.h"
 #include "ExConverter.h"
@@ -31,7 +32,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 #endif
 
 using Poco::UnicodeConverter;
-using Poco::UInt64;
 
 namespace ucr
 {
@@ -1233,7 +1233,7 @@ bool CheckForInvalidUtf8(const char *pBuffer, size_t size)
  * FF FE 00 00 UTF-32, little endian
  * 00 00 FE FF UTF-32, big-endian
  */
-UNICODESET DetermineEncoding(const unsigned char *pBuffer, UInt64 size, bool * pBom)
+UNICODESET DetermineEncoding(const unsigned char *pBuffer, uint64_t size, bool * pBom)
 {
        UNICODESET unicoding = NONE;
        *pBom = false;
index bdfdceb..f2192b6 100644 (file)
@@ -14,8 +14,7 @@
 
 #include "UnicodeString.h"
 #include "codepage.h"
-#define POCO_NO_UNWINDOWS 1
-#include <Poco/Types.h>
+#include <cstdint>
 
 namespace ucr
 {
@@ -112,7 +111,7 @@ String CrossConvertToStringA(const char* src, unsigned srclen, int cpin, int cpo
 
 bool CheckForInvalidUtf8(const char *pBuffer, size_t size);
 
-UNICODESET DetermineEncoding(const unsigned char *pBuffer, Poco::UInt64 size, bool * pBom);
+UNICODESET DetermineEncoding(const unsigned char *pBuffer, uint64_t size, bool * pBom);
 
 int getDefaultCodepage();
 void setDefaultCodepage(int cp);
index 0ad1eaf..4f9662f 100644 (file)
@@ -8,13 +8,11 @@
 
 #include "ByteComparator.h"
 #include <cassert>
-#include <Poco/Types.h>
+#include <cstdint>
 #include "UnicodeString.h"
 #include "FileTextStats.h"
 #include "CompareOptions.h"
 
-using Poco::Int64;
-
 /**
  * @brief Returns if given char is EOL byte.
  * @param [in] ch Char to test.
@@ -48,7 +46,7 @@ static inline bool iswsch(TCHAR ch)
  * @param [in] offset Byte offset in whole file (among several buffers).
  */
 static void TextScan(FileTextStats & stats, const char *ptr, const char *end, bool eof,
-               bool crflag, Int64 offset)
+               bool crflag, int64_t offset)
 {
        const char *start = ptr; // remember for recording zero-byte offsets
 
@@ -159,7 +157,7 @@ ByteComparator::ByteComparator(const QuickCompareOptions * options)
  */
 ByteComparator::COMP_RESULT ByteComparator::CompareBuffers(
        FileTextStats & stats0, FileTextStats & stats1, const char* &ptr0, const char* &ptr1,
-       const char* end0, const char* end1, bool eof0, bool eof1, Int64 offset0, Int64 offset1)
+       const char* end0, const char* end1, bool eof0, bool eof1, int64_t offset0, int64_t offset1)
 {
        ByteComparator::COMP_RESULT result = RESULT_SAME;
 
index 5bf85d8..129f7cd 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef ByteComparator_h_included
 #define ByteComparator_h_included
 
-#include <Poco/Types.h>
+#include <cstdint>
 
 class QuickCompareOptions;
 struct FileTextStats;
@@ -44,7 +44,7 @@ public:
 
        COMP_RESULT CompareBuffers(FileTextStats & stats0, FileTextStats & stats1,
                        const char* &ptr0, const char* &ptr1, const char* end0, const char* end1,
-                       bool eof0, bool eof1, Poco::Int64 offset0, Poco::Int64 offset1);
+                       bool eof0, bool eof1, int64_t offset0, int64_t offset1);
 
 protected:
        void HandleSide0Eol(char **ptr, const char *end, bool eof);
index ad73bce..73a76d5 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "ByteCompare.h"
 #include <cassert>
-#include <Poco/Types.h>
+#include <cstdint>
 #ifdef _WIN32
 #include <io.h>
 #else
@@ -23,8 +23,6 @@
 #include "diff.h"
 #include "ByteComparator.h"
 
-using Poco::Int64;
-
 namespace CompareEngines
 {
 
@@ -115,8 +113,8 @@ int ByteCompare::CompareFiles(FileLocation *location)
        unsigned diffcode = 0;
 
        // area of buffer currently holding data
-       Int64 bfstart[2]; // offset into buff[i] where current data resides
-       Int64 bfend[2]; // past-the-end pointer into buff[i], giving end of current data
+       int64_t bfstart[2]; // offset into buff[i] where current data resides
+       int64_t bfend[2]; // past-the-end pointer into buff[i], giving end of current data
        // buff[0] has bytes to process from buff[0][bfstart[0]] to buff[0][bfend[0]-1]
 
        bool eof[2]; // if we've finished file
@@ -180,8 +178,8 @@ int ByteCompare::CompareFiles(FileLocation *location)
                const char* end0 = &buff[0][bfend[0]];
                const char* end1 = &buff[1][bfend[1]];
 
-               Int64 offset0 = (ptr0 - &buff[0][0]);
-               Int64 offset1 = (ptr1 - &buff[1][0]);
+               int64_t offset0 = (ptr0 - &buff[0][0]);
+               int64_t offset1 = (ptr1 - &buff[1][0]);
 
                // are these two buffers the same?
                result = comparator.CompareBuffers(m_textStats[0], m_textStats[1],
index ab95f18..f606c90 100644 (file)
@@ -9,12 +9,12 @@
 #include "TimeSizeCompare.h"
 #include <cstdlib>
 #include <vector>
-#include <Poco/Types.h>
+#include <cstdint>
+#
 #include <Poco/Timestamp.h>
 #include "DiffItem.h"
 #include "DiffWrapper.h"
 
-using Poco::Int64;
 using Poco::Timestamp;
 
 namespace CompareEngines
@@ -53,7 +53,7 @@ int TimeSizeCompare::CompareFiles(int compMethod, const DIFFITEM &di) const
                // Check that we have both filetimes
                if (di.diffFileInfo[0].mtime != 0 && di.diffFileInfo[1].mtime != 0)
                {
-                       Int64 nTimeDiff = di.diffFileInfo[0].mtime - di.diffFileInfo[1].mtime;
+                       int64_t nTimeDiff = di.diffFileInfo[0].mtime - di.diffFileInfo[1].mtime;
                        if (nTimeDiff < 0) nTimeDiff *= -1;
                        if (m_ignoreSmallDiff)
                        {
index ddbf4d2..9d12f70 100644 (file)
@@ -4,6 +4,7 @@
 #include <vector>\r
 #include <algorithm>\r
 #ifdef _DEBUG\r
+#  define POCO_NO_UNWINDOWS 1
 #  include <Poco/Debugger.h>\r
 #  include <Poco/Format.h>\r
 #endif\r
index 0d9774c..fa86031 100644 (file)
@@ -40,7 +40,6 @@
 #include "IAbortable.h"
 #include "DiffWrapper.h"
 
-using Poco::UIntPtr;
 using Poco::FastMutex;
 
 //////////////////////////////////////////////////////////////////////
@@ -92,7 +91,7 @@ CDiffContext::~CDiffContext()
  * @param [in] bLeft Update left-side info.
  * @param [in] bRight Update right-side info.
  */
-void CDiffContext::UpdateStatusFromDisk(UIntPtr diffpos, bool bLeft, bool bRight)
+void CDiffContext::UpdateStatusFromDisk(uintptr_t diffpos, bool bLeft, bool bRight)
 {
        DIFFITEM &di = GetDiffRefAt(diffpos);
        if (bLeft)
index fb368f8..d07871b 100644 (file)
@@ -13,6 +13,7 @@
 #include <Poco/Mutex.h>
 #include <Poco/ThreadLocal.h>
 #include <memory>
+#include <cstdint>
 #include "PathContext.h"
 #include "DiffFileInfo.h"
 #include "DiffItemList.h"
@@ -112,8 +113,8 @@ public:
 
        // change an existing difference
        bool UpdateInfoFromDiskHalf(DIFFITEM & di, int nIndex);
-       void UpdateStatusFromDisk(Poco::UIntPtr diffpos, bool bLeft, bool bRight);
-       void UpdateStatusFromDisk(Poco::UIntPtr diffpos, bool bLeft, bool bMiddle, bool bRight);
+       void UpdateStatusFromDisk(uintptr_t diffpos, bool bLeft, bool bRight);
+       void UpdateStatusFromDisk(uintptr_t diffpos, bool bLeft, bool bMiddle, bool bRight);
 
        bool CreateCompareOptions(int compareMethod, const DIFFOPTIONS & options);
        CompareOptions * GetCompareOptions(int compareMethod);
index 7c23b59..ae5021a 100644 (file)
@@ -9,8 +9,6 @@
 #include "DiffItemList.h"
 #include <cassert>
 
-using Poco::UIntPtr;
-
 /**
  * @brief Constructor
  */
@@ -46,7 +44,7 @@ DIFFITEM* DiffItemList::AddDiff(DIFFITEM *parent)
  * @brief Remove diffitem from structured DIFFITEM tree
  * @param diffpos position of item to remove
  */
-void DiffItemList::RemoveDiff(UIntPtr diffpos)
+void DiffItemList::RemoveDiff(uintptr_t diffpos)
 {
        DIFFITEM *p = (DIFFITEM *)diffpos;
        p->RemoveSelf();
@@ -59,15 +57,15 @@ void DiffItemList::RemoveDiff(UIntPtr diffpos)
 void DiffItemList::RemoveAll()
 {
        while (m_root.IsSibling(m_root.Flink))
-               RemoveDiff((UIntPtr)m_root.Flink);
+               RemoveDiff((uintptr_t)m_root.Flink);
 }
 
 /**
  * @brief Get position of first item in structured DIFFITEM tree
  */
-UIntPtr DiffItemList::GetFirstDiffPosition() const
+uintptr_t DiffItemList::GetFirstDiffPosition() const
 {
-       return (UIntPtr)m_root.IsSibling(m_root.Flink);
+       return (uintptr_t)m_root.IsSibling(m_root.Flink);
 }
 
 /**
@@ -75,13 +73,13 @@ UIntPtr DiffItemList::GetFirstDiffPosition() const
  * @param  parentdiffpos [in] Position of parent diff item 
  * @return Position of first child item
  */
-UIntPtr DiffItemList::GetFirstChildDiffPosition(UIntPtr parentdiffpos) const
+uintptr_t DiffItemList::GetFirstChildDiffPosition(uintptr_t parentdiffpos) const
 {
        DIFFITEM *parent = (DIFFITEM *)parentdiffpos;
        if (parent)
-               return (UIntPtr)parent->children.IsSibling(parent->children.Flink);
+               return (uintptr_t)parent->children.IsSibling(parent->children.Flink);
        else
-               return (UIntPtr)m_root.IsSibling(m_root.Flink);
+               return (uintptr_t)m_root.IsSibling(m_root.Flink);
 }
 
 /**
@@ -89,7 +87,7 @@ UIntPtr DiffItemList::GetFirstChildDiffPosition(UIntPtr parentdiffpos) const
  * @param diffpos position of current item, updated to next item position
  * @return Diff Item in current position
  */
-const DIFFITEM &DiffItemList::GetNextDiffPosition(UIntPtr & diffpos) const
+const DIFFITEM &DiffItemList::GetNextDiffPosition(uintptr_t & diffpos) const
 {
        DIFFITEM *p = (DIFFITEM *)diffpos;
        if (p->HasChildren())
@@ -102,9 +100,9 @@ const DIFFITEM &DiffItemList::GetNextDiffPosition(UIntPtr & diffpos) const
                do
                {
                        if (cur->parent)
-                               diffpos = (UIntPtr)cur->parent->children.IsSibling(cur->Flink);
+                               diffpos = (uintptr_t)cur->parent->children.IsSibling(cur->Flink);
                        else
-                               diffpos = (UIntPtr)m_root.IsSibling(cur->Flink);
+                               diffpos = (uintptr_t)m_root.IsSibling(cur->Flink);
                        cur = cur->parent;
                } while (!diffpos && cur);
        }
@@ -116,7 +114,7 @@ const DIFFITEM &DiffItemList::GetNextDiffPosition(UIntPtr & diffpos) const
  * @param diffpos position of current item, updated to next item position
  * @return Diff Item (by reference) in current position
  */
-DIFFITEM &DiffItemList::GetNextDiffRefPosition(UIntPtr & diffpos)
+DIFFITEM &DiffItemList::GetNextDiffRefPosition(uintptr_t & diffpos)
 {
        return (DIFFITEM &)GetNextDiffPosition(diffpos);
 }
@@ -126,13 +124,13 @@ DIFFITEM &DiffItemList::GetNextDiffRefPosition(UIntPtr & diffpos)
  * @param diffpos position of current item, updated to next sibling item position
  * @return Diff Item in current position
  */
-const DIFFITEM &DiffItemList::GetNextSiblingDiffPosition(UIntPtr & diffpos) const
+const DIFFITEM &DiffItemList::GetNextSiblingDiffPosition(uintptr_t & diffpos) const
 {
        DIFFITEM *p = (DIFFITEM *)diffpos;
        if (p->parent)
-               diffpos = (UIntPtr)p->parent->children.IsSibling(p->Flink);
+               diffpos = (uintptr_t)p->parent->children.IsSibling(p->Flink);
        else
-               diffpos = (UIntPtr)m_root.IsSibling(p->Flink);
+               diffpos = (uintptr_t)m_root.IsSibling(p->Flink);
        return *p;
 }
 
@@ -141,7 +139,7 @@ const DIFFITEM &DiffItemList::GetNextSiblingDiffPosition(UIntPtr & diffpos) cons
  * @param diffpos position of current item, updated to next sibling item position
  * @return Diff Item (by reference) in current position
  */
-DIFFITEM &DiffItemList::GetNextSiblingDiffRefPosition(UIntPtr & diffpos)
+DIFFITEM &DiffItemList::GetNextSiblingDiffRefPosition(uintptr_t & diffpos)
 {
        return (DIFFITEM &)GetNextSiblingDiffPosition(diffpos);
 }
@@ -159,7 +157,7 @@ DIFFITEM &DiffItemList::GetNextSiblingDiffRefPosition(UIntPtr & diffpos)
  * SetDiffStatusCode(pos, DIFFCODE::SAME+DIFFCODE::BOTH, DIFFCODE::COMPAREFLAGS+DIFFCODE::SIDEFLAG);
  *  changes the comparison result to be the same and the side status to be both
  */
-void DiffItemList::SetDiffStatusCode(UIntPtr diffpos, unsigned diffcode, unsigned mask)
+void DiffItemList::SetDiffStatusCode(uintptr_t diffpos, unsigned diffcode, unsigned mask)
 {
        assert(diffpos);
        DIFFITEM & di = GetDiffRefAt(diffpos);
@@ -171,7 +169,7 @@ void DiffItemList::SetDiffStatusCode(UIntPtr diffpos, unsigned diffcode, unsigne
 /**
  * @brief Update difference counts.
  */
-void DiffItemList::SetDiffCounts(UIntPtr diffpos, unsigned diffs, unsigned ignored)
+void DiffItemList::SetDiffCounts(uintptr_t diffpos, unsigned diffs, unsigned ignored)
 {
        assert(diffpos);
        DIFFITEM & di = GetDiffRefAt(diffpos);
@@ -184,7 +182,7 @@ void DiffItemList::SetDiffCounts(UIntPtr diffpos, unsigned diffs, unsigned ignor
  * @param [in] diffpos Position of item.
  * @return Custom flags from item.
  */
-unsigned DiffItemList::GetCustomFlags1(UIntPtr diffpos) const
+unsigned DiffItemList::GetCustomFlags1(uintptr_t diffpos) const
 {
        assert(diffpos);
        const DIFFITEM & di = GetDiffAt(diffpos);
@@ -196,7 +194,7 @@ unsigned DiffItemList::GetCustomFlags1(UIntPtr diffpos) const
  * @param [in] diffpos Position of item.
  * @param [in] flag Value of flag to set.
  */
-void DiffItemList::SetCustomFlags1(UIntPtr diffpos, unsigned flag)
+void DiffItemList::SetCustomFlags1(uintptr_t diffpos, unsigned flag)
 {
        assert(diffpos);
        DIFFITEM & di = GetDiffRefAt(diffpos);
index 673c998..4c3a311 100644 (file)
@@ -10,8 +10,7 @@
 #define _DIFF_ITEM_LIST_H_
 
 #include "DiffItem.h"
-#define POCO_NO_UNWINDOWS 1
-#include <Poco/Types.h>
+#include <cstdint>
 
 /**
  * @brief List of DIFFITEMs in folder compare.
@@ -27,23 +26,23 @@ public:
        ~DiffItemList();
        // add & remove differences
        DIFFITEM *AddDiff(DIFFITEM *parent);
-       void RemoveDiff(Poco::UIntPtr diffpos);
+       void RemoveDiff(uintptr_t diffpos);
        void RemoveAll();
 
        // to iterate over all differences on list
-       Poco::UIntPtr GetFirstDiffPosition() const;
-       Poco::UIntPtr GetFirstChildDiffPosition(Poco::UIntPtr parentdiffpos) const;
-       const DIFFITEM & GetNextDiffPosition(Poco::UIntPtr & diffpos) const;
-       DIFFITEM & GetNextDiffRefPosition(Poco::UIntPtr & diffpos);
-       const DIFFITEM & GetNextSiblingDiffPosition(Poco::UIntPtr & diffpos) const;
-       DIFFITEM &GetNextSiblingDiffRefPosition(Poco::UIntPtr & diffpos);
-       const DIFFITEM & GetDiffAt(Poco::UIntPtr diffpos) const;
-       DIFFITEM & GetDiffRefAt(Poco::UIntPtr diffpos);
+       uintptr_t GetFirstDiffPosition() const;
+       uintptr_t GetFirstChildDiffPosition(uintptr_t parentdiffpos) const;
+       const DIFFITEM & GetNextDiffPosition(uintptr_t & diffpos) const;
+       DIFFITEM & GetNextDiffRefPosition(uintptr_t & diffpos);
+       const DIFFITEM & GetNextSiblingDiffPosition(uintptr_t & diffpos) const;
+       DIFFITEM &GetNextSiblingDiffRefPosition(uintptr_t & diffpos);
+       const DIFFITEM & GetDiffAt(uintptr_t diffpos) const;
+       DIFFITEM & GetDiffRefAt(uintptr_t diffpos);
 
-       void SetDiffStatusCode(Poco::UIntPtr diffpos, unsigned diffcode, unsigned mask);
-       void SetDiffCounts(Poco::UIntPtr diffpos, unsigned diffs, unsigned ignored);
-       unsigned GetCustomFlags1(Poco::UIntPtr diffpos) const;
-       void SetCustomFlags1(Poco::UIntPtr diffpos, unsigned flag);
+       void SetDiffStatusCode(uintptr_t diffpos, unsigned diffcode, unsigned mask);
+       void SetDiffCounts(uintptr_t diffpos, unsigned diffs, unsigned ignored);
+       unsigned GetCustomFlags1(uintptr_t diffpos) const;
+       void SetCustomFlags1(uintptr_t diffpos, unsigned flag);
 
 protected:
        ListEntry m_root; /**< Root of list of diffitems */
@@ -53,7 +52,7 @@ protected:
  * @brief Get copy of Diff Item at given position in difflist.
  * @param diffpos position of item to return
  */
-inline const DIFFITEM & DiffItemList::GetDiffAt(Poco::UIntPtr diffpos) const
+inline const DIFFITEM & DiffItemList::GetDiffAt(uintptr_t diffpos) const
 {
        return *reinterpret_cast<DIFFITEM *>(diffpos);
 }
@@ -62,7 +61,7 @@ inline const DIFFITEM & DiffItemList::GetDiffAt(Poco::UIntPtr diffpos) const
  * @brief Get Diff Item (by reference) at given position in difflist.
  * @param diffpos position of item to return
  */
-inline DIFFITEM & DiffItemList::GetDiffRefAt(Poco::UIntPtr diffpos)
+inline DIFFITEM & DiffItemList::GetDiffRefAt(uintptr_t diffpos)
 {
        return *reinterpret_cast<DIFFITEM *>(diffpos);
 }
index 198bc94..7921c52 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "StdAfx.h"
 #include "DiffTextBuffer.h"
+#include <cstdint>
 #include <Poco/Exception.h>
 #include "UniFile.h"
 #include "files.h"
@@ -35,7 +36,7 @@ static char THIS_FILE[] = __FILE__;
 #endif
 
 static bool IsTextFileStylePure(const UniMemFile::txtstats & stats);
-static CString GetLineByteTimeReport(UINT lines, __int64 bytes,
+static CString GetLineByteTimeReport(UINT lines, int64_t bytes,
        const COleDateTime & start);
 static void EscapeControlChars(String &s);
 static CRLFSTYLE GetTextFileStyle(const UniMemFile::txtstats & stats);
@@ -64,7 +65,7 @@ static bool IsTextFileStylePure(const UniMemFile::txtstats & stats)
  * @param [in] start Time used.
  * @return Formatted string.
  */
-static CString GetLineByteTimeReport(UINT lines, __int64 bytes,
+static CString GetLineByteTimeReport(UINT lines, int64_t bytes,
        const COleDateTime & start)
 {
        String sLines = locality::NumToLocaleStr((int)lines);
@@ -437,7 +438,7 @@ int CDiffTextBuffer::LoadFromFile(LPCTSTR pszFileNameInit,
                        // (at 100, 500, 1000, 5000, etc)
                        if (lineno == next_line_report)
                        {
-                               __int64 dwBytesRead = pufile->GetPosition();
+                               int64_t dwBytesRead = pufile->GetPosition();
                                COleDateTimeSpan duration = COleDateTime::GetCurrentTime() - start;
                                if (duration.GetTotalMinutes() > 0)
                                {
@@ -456,7 +457,7 @@ int CDiffTextBuffer::LoadFromFile(LPCTSTR pszFileNameInit,
                COleDateTimeSpan duration = end - start;
                if (duration.GetTotalMinutes() > 0)
                {
-                       __int64 dwBytesRead = pufile->GetPosition();
+                       int64_t dwBytesRead = pufile->GetPosition();
                        CString strace = GetLineByteTimeReport(lineno, dwBytesRead, start);
                        TRACE(_T("%s\n"), (LPCTSTR)strace);
                }
index efed9c4..8ee4c87 100644 (file)
@@ -26,6 +26,7 @@
 #define _DIFFTHREAD_H
 
 #include <memory>
+#define POCO_NO_UNWINDOWS 1
 #include <Poco/Thread.h>
 #include <Poco/BasicEvent.h>
 #include <Poco/Delegate.h>
index b7d44e0..724e268 100644 (file)
@@ -59,7 +59,6 @@ static char THIS_FILE[] = __FILE__;
 #endif
 
 using Poco::StringTokenizer;
-using Poco::UIntPtr;
 
 int CDirDoc::m_nDirsTemp = 2;
 
@@ -501,7 +500,7 @@ CDirView * CDirDoc::GetMainView() const
  * @param [in] bLeft If TRUE left-side item is updated.
  * @param [in] bRight If TRUE right-side item is updated.
  */
-void CDirDoc::UpdateStatusFromDisk(UIntPtr diffPos, bool bLeft, bool bRight)
+void CDirDoc::UpdateStatusFromDisk(uintptr_t diffPos, bool bLeft, bool bRight)
 {
        m_pCtxt->UpdateStatusFromDisk(diffPos, bLeft, bRight);
 }
@@ -515,7 +514,7 @@ void CDirDoc::UpdateStatusFromDisk(UIntPtr diffPos, bool bLeft, bool bRight)
  * calls slow DirView functions to get item position and to update GUI.
  * Use UpdateStatusFromDisk() function instead.
  */
-void CDirDoc::ReloadItemStatus(UIntPtr diffPos, bool bLeft, bool bRight)
+void CDirDoc::ReloadItemStatus(uintptr_t diffPos, bool bLeft, bool bRight)
 {
        // in case just copied (into existence) or modified
        UpdateStatusFromDisk(diffPos, bLeft, bRight);
@@ -551,7 +550,7 @@ void CDirDoc::UpdateResources()
  * @return POSITION to item, NULL if not found.
  * @note Filenames must be same, if they differ NULL is returned.
  */
-UIntPtr CDirDoc::FindItemFromPaths(const String& pathLeft, const String& pathRight)
+uintptr_t CDirDoc::FindItemFromPaths(const String& pathLeft, const String& pathRight)
 {
        String file1 = paths_FindFileName(pathLeft);
        String file2 = paths_FindFileName(pathRight);
@@ -582,8 +581,8 @@ UIntPtr CDirDoc::FindItemFromPaths(const String& pathLeft, const String& pathRig
        if (String::size_type length = path2.length())
                path2.resize(length - 1); // remove trailing backslash
 
-       UIntPtr pos = m_pCtxt->GetFirstDiffPosition();
-       while (UIntPtr currentPos = pos) // Save our current pos before getting next
+       uintptr_t pos = m_pCtxt->GetFirstDiffPosition();
+       while (uintptr_t currentPos = pos) // Save our current pos before getting next
        {
                const DIFFITEM &di = m_pCtxt->GetNextDiffPosition(pos);
                if (di.diffFileInfo[0].path == path1 &&
@@ -703,7 +702,7 @@ BOOL CDirDoc::ReusingDirDoc()
 void CDirDoc::UpdateChangedItem(PathContext &paths,
        UINT nDiffs, UINT nTrivialDiffs, BOOL bIdentical)
 {
-       UIntPtr pos = FindItemFromPaths(paths.GetLeft(), paths.GetRight());
+       uintptr_t pos = FindItemFromPaths(paths.GetLeft(), paths.GetRight());
        // If we failed files could have been swapped so lets try again
        if (!pos)
                pos = FindItemFromPaths(paths.GetRight(), paths.GetLeft());
@@ -795,7 +794,7 @@ void CDirDoc::SetDiffCompare(UINT diffcode, int idx)
 void CDirDoc::SetDiffStatus(UINT diffcode, UINT mask, int idx)
 {
        // Get position of item in DiffContext 
-       UIntPtr diffpos = m_pDirView->GetItemKey(idx);
+       uintptr_t diffpos = m_pDirView->GetItemKey(idx);
 
        // TODO: Why is the update broken into these pieces ?
        // Someone could figure out these pieces and probably simplify this.
@@ -921,7 +920,7 @@ void CDirDoc::FetchPluginInfos(const String& filteredFilenames,
 void CDirDoc::SetDiffCounts(UINT diffs, UINT ignored, int idx)
 {
        // Get position of item in DiffContext 
-       UIntPtr diffpos = m_pDirView->GetItemKey(idx);
+       uintptr_t diffpos = m_pDirView->GetItemKey(idx);
 
        // Update diff counts
        m_pCtxt->SetDiffCounts(diffpos, diffs, ignored);
@@ -933,7 +932,7 @@ void CDirDoc::SetDiffCounts(UINT diffs, UINT ignored, int idx)
  * @param [in] act Action that was done.
  * @param [in] pos List position for DIFFITEM affected.
  */
-void CDirDoc::UpdateDiffAfterOperation(const FileActionItem & act, UIntPtr pos)
+void CDirDoc::UpdateDiffAfterOperation(const FileActionItem & act, uintptr_t pos)
 {
        ASSERT(pos != NULL);
        const DIFFITEM &di = GetDiffByKey(pos);
@@ -1031,7 +1030,7 @@ void CDirDoc::SetTitle(LPCTSTR lpszTitle)
  * @param [in] flag Flag value to set.
  * @param [in] mask Mask for possible flag values.
  */
-void CDirDoc::SetItemViewFlag(UIntPtr key, UINT flag, UINT mask)
+void CDirDoc::SetItemViewFlag(uintptr_t key, UINT flag, UINT mask)
 {
        UINT curFlags = m_pCtxt->GetCustomFlags1(key);
        curFlags &= ~mask; // Zero bits masked
@@ -1046,7 +1045,7 @@ void CDirDoc::SetItemViewFlag(UIntPtr key, UINT flag, UINT mask)
  */
 void CDirDoc::SetItemViewFlag(UINT flag, UINT mask)
 {
-       UIntPtr pos = m_pCtxt->GetFirstDiffPosition();
+       uintptr_t pos = m_pCtxt->GetFirstDiffPosition();
 
        while (pos != NULL)
        {
index 414a620..aff1faf 100644 (file)
@@ -31,6 +31,7 @@
 #pragma once
 
 #include <memory>
+#include <cstdint>
 #include "DiffThread.h"
 #include "PluginManager.h"
 
@@ -96,13 +97,13 @@ public:
        void CompareReady();
        void UpdateChangedItem(PathContext & paths,
                UINT nDiffs, UINT nTrivialDiffs, BOOL bIdentical);
-       Poco::UIntPtr FindItemFromPaths(const String& pathLeft, const String& pathRight);
+       uintptr_t FindItemFromPaths(const String& pathLeft, const String& pathRight);
        void SetDiffSide(UINT diffcode, int idx);
        void SetDiffCompare(UINT diffcode, int idx);
        void UpdateResources();
        void InitStatusStrings();
-       void UpdateStatusFromDisk(Poco::UIntPtr diffPos, bool bLeft, bool bRight);
-       void ReloadItemStatus(Poco::UIntPtr diffPos, bool bLeft, bool bRight);
+       void UpdateStatusFromDisk(uintptr_t diffPos, bool bLeft, bool bRight);
+       void ReloadItemStatus(uintptr_t diffPos, bool bLeft, bool bRight);
        void Redisplay();
        virtual ~CDirDoc();
        void SetDirView( CDirView *newView ); // TODO Perry
@@ -111,7 +112,7 @@ public:
        CDiffThread m_diffThread;
        void SetDiffStatus(UINT diffcode, UINT mask, int idx);
        void SetDiffCounts(UINT diffs, UINT ignored, int idx);
-       void UpdateDiffAfterOperation(const FileActionItem & act, Poco::UIntPtr pos);
+       void UpdateDiffAfterOperation(const FileActionItem & act, uintptr_t pos);
        void UpdateHeaderPath(BOOL bLeft);
        void AbortCurrentScan();
        bool IsCurrentScanAbortable() const;
@@ -127,12 +128,12 @@ public:
 
        bool HasDiffs() const { return m_pCtxt != NULL; }
        const CDiffContext & GetDiffContext() const { return *m_pCtxt; }
-       const DIFFITEM & GetDiffByKey(Poco::UIntPtr key) const { return m_pCtxt->GetDiffAt(key); }
-       DIFFITEM & GetDiffRefByKey(Poco::UIntPtr key) { return m_pCtxt->GetDiffRefAt(key); }
+       const DIFFITEM & GetDiffByKey(uintptr_t key) const { return m_pCtxt->GetDiffAt(key); }
+       DIFFITEM & GetDiffRefByKey(uintptr_t key) { return m_pCtxt->GetDiffRefAt(key); }
        String GetLeftBasePath() const { return m_pCtxt->GetNormalizedLeft(); }
        String GetRightBasePath() const { return m_pCtxt->GetNormalizedRight(); }
        String GetBasePath(int nIndex) const { return m_pCtxt->GetNormalizedPath(nIndex); }
-       void RemoveDiffByKey(Poco::UIntPtr key) { m_pCtxt->RemoveDiff(key); }
+       void RemoveDiffByKey(uintptr_t key) { m_pCtxt->RemoveDiff(key); }
        void SetMarkedRescan() {m_bMarkedRescan = TRUE; }
        struct AllowUpwardDirectory
        {
@@ -145,7 +146,7 @@ public:
                };
        };
        AllowUpwardDirectory::ReturnCode AllowUpwardDirectory(PathContext &paths);
-       void SetItemViewFlag(Poco::UIntPtr key, UINT flag, UINT mask);
+       void SetItemViewFlag(uintptr_t key, UINT flag, UINT mask);
        void SetItemViewFlag(UINT flag, UINT mask);
        const CompareStats * GetCompareStats() const { return m_pCompareStats.get(); };
        bool IsArchiveFolders() const;
index a850193..6379d41 100644 (file)
@@ -26,7 +26,6 @@
 #define _DIR_ITEM_H_INCLUDED
 
 #define POCO_NO_UNWINDOWS 1
-#include <Poco/Types.h>
 #include <Poco/File.h>
 #include <Poco/Timestamp.h>
 #include <boost/flyweight.hpp>
index 7757a67..0e152bd 100644 (file)
@@ -9,6 +9,7 @@
 #include "DirScan.h"
 #include <cassert>
 #include <memory>
+#include <cstdint>
 #define POCO_NO_UNWINDOWS 1
 #include <Poco/Semaphore.h>
 #include <Poco/Notification.h>
@@ -36,7 +37,6 @@
 #include "Plugins.h"
 #include "MergeApp.h"
 
-using Poco::UIntPtr;
 using Poco::NotificationQueue;
 using Poco::Notification;
 using Poco::AutoPtr;
@@ -55,7 +55,7 @@ static DIFFITEM *AddToList(const String& sLeftDir, const String& sRightDir, cons
 static DIFFITEM *AddToList(const String& sLeftDir, const String& sMiddleDir, const String& sRightDir, const DirItem * lent, const DirItem * ment, const DirItem * rent,
        unsigned code, DiffFuncStruct *myStruct, DIFFITEM *parent);
 static void UpdateDiffItem(DIFFITEM & di, bool & bExists, CDiffContext *pCtxt);
-static int CompareItems(NotificationQueue& queue, DiffFuncStruct *myStruct, UIntPtr parentdiffpos);
+static int CompareItems(NotificationQueue& queue, DiffFuncStruct *myStruct, uintptr_t parentdiffpos);
 
 class WorkNotification: public Poco::Notification
 {
@@ -552,7 +552,7 @@ OutputDebugString(buf);
  * @param parentdiffpos [in] Position of parent diff item 
  * @return >= 0 number of diff items, -1 if compare was aborted
  */
-int DirScan_CompareItems(DiffFuncStruct *myStruct, UIntPtr parentdiffpos)
+int DirScan_CompareItems(DiffFuncStruct *myStruct, uintptr_t parentdiffpos)
 {
        ThreadPool threadPool;
        std::vector<DiffWorkerPtr> workers;
@@ -575,7 +575,7 @@ int DirScan_CompareItems(DiffFuncStruct *myStruct, UIntPtr parentdiffpos)
        return res;
 }
 
-static int CompareItems(NotificationQueue& queue, DiffFuncStruct *myStruct, UIntPtr parentdiffpos)
+static int CompareItems(NotificationQueue& queue, DiffFuncStruct *myStruct, uintptr_t parentdiffpos)
 {
        NotificationQueue queueResult;
        Stopwatch stopwatch;
@@ -585,7 +585,7 @@ static int CompareItems(NotificationQueue& queue, DiffFuncStruct *myStruct, UInt
        if (!parentdiffpos)
                myStruct->pSemaphore->wait();
        stopwatch.start();
-       UIntPtr pos = pCtxt->GetFirstChildDiffPosition(parentdiffpos);
+       uintptr_t pos = pCtxt->GetFirstChildDiffPosition(parentdiffpos);
        while (pos)
        {
                if (pCtxt->ShouldAbort())
@@ -598,7 +598,7 @@ static int CompareItems(NotificationQueue& queue, DiffFuncStruct *myStruct, UInt
                        stopwatch.restart();
                }
                myStruct->pSemaphore->wait();
-               UIntPtr curpos = pos;
+               uintptr_t curpos = pos;
                DIFFITEM &di = pCtxt->GetNextSiblingDiffRefPosition(pos);
                bool existsalldirs = ((pCtxt->GetCompareDirs() == 2 && di.diffcode.isSideBoth()) || (pCtxt->GetCompareDirs() == 3 && di.diffcode.isSideAll()));
                if (di.diffcode.isDirectory() && pCtxt->m_bRecursive)
@@ -652,11 +652,11 @@ static int CompareItems(NotificationQueue& queue, DiffFuncStruct *myStruct, UInt
  * @param parentdiffpos [in] Position of parent diff item 
  * @return >= 0 number of diff items, -1 if compare was aborted
  */
-int DirScan_CompareRequestedItems(DiffFuncStruct *myStruct, UIntPtr parentdiffpos)
+int DirScan_CompareRequestedItems(DiffFuncStruct *myStruct, uintptr_t parentdiffpos)
 {
        CDiffContext *pCtxt = myStruct->context;
        int res = 0;
-       UIntPtr pos = pCtxt->GetFirstChildDiffPosition(parentdiffpos);
+       uintptr_t pos = pCtxt->GetFirstChildDiffPosition(parentdiffpos);
        
        while (pos != NULL)
        {
@@ -666,7 +666,7 @@ int DirScan_CompareRequestedItems(DiffFuncStruct *myStruct, UIntPtr parentdiffpo
                        break;
                }
 
-               UIntPtr curpos = pos;
+               uintptr_t curpos = pos;
                DIFFITEM &di = pCtxt->GetNextSiblingDiffRefPosition(pos);
                bool existsalldirs = ((pCtxt->GetCompareDirs() == 2 && di.diffcode.isSideBoth()) || (pCtxt->GetCompareDirs() == 3 && di.diffcode.isSideAll()));
                if (di.diffcode.isDirectory() && pCtxt->m_bRecursive)
index f7b3825..1084a66 100644 (file)
@@ -10,8 +10,7 @@
 #define DirScan_h_included
 
 #include "UnicodeString.h"
-#define POCO_NO_UNWINDOWS 1
-#include <Poco/Types.h>
+#include <cstdint>
 
 class CDiffContext;
 class DiffItemList;
@@ -23,7 +22,7 @@ struct DiffFuncStruct;
 int DirScan_GetItems(const PathContext &paths, const String subdir[], DiffFuncStruct *myStruct,
                bool casesensitive, int depth, DIFFITEM *parent, bool bUniques);
 
-int DirScan_CompareItems(DiffFuncStruct *, Poco::UIntPtr parentdiffpos);
-int DirScan_CompareRequestedItems(DiffFuncStruct *, Poco::UIntPtr parentdiffpos);
+int DirScan_CompareItems(DiffFuncStruct *, uintptr_t parentdiffpos);
+int DirScan_CompareRequestedItems(DiffFuncStruct *, uintptr_t parentdiffpos);
 
 #endif // DirScan_h_included
index 45163ee..c069afb 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "DirTravel.h"
 #include <algorithm>
+#include <cstdint>
 #include <Poco/DirectoryIterator.h>
 #include <Poco/Timestamp.h>
 #include <windows.h>
@@ -20,7 +21,6 @@
 
 using Poco::DirectoryIterator;
 using Poco::Timestamp;
-using Poco::Int64;
 
 static void LoadFiles(const String& sDir, DirItemArray * dirs, DirItemArray * files);
 static void Sort(DirItemArray * dirs, bool casesensitive);
@@ -122,7 +122,7 @@ static void LoadFiles(const String& sDir, DirItemArray * dirs, DirItemArray * fi
                                ent.size = -1;  // No size for directories
                        else
                        {
-                               ent.size = ((Int64)ff.nFileSizeHigh << 32) + ff.nFileSizeLow;
+                               ent.size = ((int64_t)ff.nFileSizeHigh << 32) + ff.nFileSizeLow;
                        }
 
                        ent.path = dir;
index 2f0b71d..8183777 100644 (file)
@@ -63,7 +63,6 @@ static char THIS_FILE[] = __FILE__;
 #endif
 
 using std::swap;
-using Poco::UIntPtr;
 
 /**
  * @brief Location for folder compare specific help to open.
@@ -530,13 +529,13 @@ void CDirView::ReloadColumns()
  * @param [in,out] index Index of the item to be inserted.
  * @param [in,out] alldiffs Number of different items
  */
-void CDirView::RedisplayChildren(UIntPtr diffpos, int level, UINT &index, int &alldiffs)
+void CDirView::RedisplayChildren(uintptr_t diffpos, int level, UINT &index, int &alldiffs)
 {
        CDirDoc *pDoc = GetDocument();
        const CDiffContext &ctxt = pDoc->GetDiffContext();
        while (diffpos)
        {
-               UIntPtr curdiffpos = diffpos;
+               uintptr_t curdiffpos = diffpos;
                const DIFFITEM &di = ctxt.GetNextSiblingDiffPosition(diffpos);
 
                if (di.diffcode.isResultDiff() || (!di.diffcode.existAll(pDoc->m_nDirs) && !di.diffcode.isResultFiltered()))
@@ -599,7 +598,7 @@ void CDirView::Redisplay()
        }
 
        int alldiffs = 0;
-       UIntPtr diffpos = ctxt.GetFirstDiffPosition();
+       uintptr_t diffpos = ctxt.GetFirstDiffPosition();
        RedisplayChildren(diffpos, 0, cnt, alldiffs);
        if (pDoc->m_diffThread.GetThreadState() == CDiffThread::THREAD_COMPLETED)
                GetParentFrame()->SetLastCompareResult(alldiffs);
@@ -1252,7 +1251,7 @@ void CDirView::ExpandSubdir(int sel, bool bRecursive)
        CDiffContext &ctxt = const_cast<CDiffContext &>(pDoc->GetDiffContext());
        if (bRecursive)
        {
-               UIntPtr diffpos = ctxt.GetFirstChildDiffPosition(GetItemKey(sel));
+               uintptr_t diffpos = ctxt.GetFirstChildDiffPosition(GetItemKey(sel));
                while (diffpos)
                {
                        DIFFITEM &di = ctxt.GetNextDiffRefPosition(diffpos);
@@ -1263,7 +1262,7 @@ void CDirView::ExpandSubdir(int sel, bool bRecursive)
                }
        }
 
-       UIntPtr diffpos = ctxt.GetFirstChildDiffPosition(GetItemKey(sel));
+       uintptr_t diffpos = ctxt.GetFirstChildDiffPosition(GetItemKey(sel));
        UINT indext = sel + 1;
        int alldiffs;
        RedisplayChildren(diffpos, dip.GetDepth() + 1, indext, alldiffs);
@@ -1326,7 +1325,7 @@ bool CDirView::GetSelectedItems(int * sel1, int * sel2, int * sel3)
  * @param [in] pos1 First item position.
  * @param [in] pos2 Second item position.
  */
-void CDirView::OpenSpecialItems(UIntPtr pos1, UIntPtr pos2, UIntPtr pos3)
+void CDirView::OpenSpecialItems(uintptr_t pos1, uintptr_t pos2, uintptr_t pos3)
 {
        if (!pos2 && !pos3)
        {
@@ -1397,7 +1396,7 @@ bool CDirView::CreateFoldersPair(DIFFITEM & di, bool side1, String &newFolder)
  * @param [in,out] isDir Is item folder?
  * return false if there was error or item was completely processed.
  */
-bool CDirView::OpenOneItem(UIntPtr pos1, DIFFITEM **di1, DIFFITEM **di2, DIFFITEM **di3,
+bool CDirView::OpenOneItem(uintptr_t pos1, DIFFITEM **di1, DIFFITEM **di2, DIFFITEM **di3,
                PathContext & paths, int & sel1, bool & isdir)
 {
        CDirDoc * pDoc = GetDocument();
@@ -1474,7 +1473,7 @@ bool CDirView::OpenOneItem(UIntPtr pos1, DIFFITEM **di1, DIFFITEM **di2, DIFFITE
  * @param [in,out] isDir Is item folder?
  * return false if there was error or item was completely processed.
  */
-bool CDirView::OpenTwoItems(SELECTIONTYPE selectionType, UIntPtr pos1, UIntPtr pos2, DIFFITEM **di1, DIFFITEM **di2,
+bool CDirView::OpenTwoItems(SELECTIONTYPE selectionType, uintptr_t pos1, uintptr_t pos2, DIFFITEM **di1, DIFFITEM **di2,
                PathContext & paths, int & sel1, int & sel2, bool & isDir)
 {
        String pathLeft, pathRight;
@@ -1558,7 +1557,7 @@ bool CDirView::OpenTwoItems(SELECTIONTYPE selectionType, UIntPtr pos1, UIntPtr p
  * @param [in,out] isDir Is item folder?
  * return false if there was error or item was completely processed.
  */
-bool CDirView::OpenThreeItems(UIntPtr pos1, UIntPtr pos2, UIntPtr pos3, DIFFITEM **di1, DIFFITEM **di2, DIFFITEM **di3,
+bool CDirView::OpenThreeItems(uintptr_t pos1, uintptr_t pos2, uintptr_t pos3, DIFFITEM **di1, DIFFITEM **di2, DIFFITEM **di3,
                PathContext & paths, int & sel1, int & sel2, int & sel3, bool & isDir)
 {
        String pathLeft, pathMiddle, pathRight;
@@ -1705,7 +1704,7 @@ void CDirView::OpenSelection(SELECTIONTYPE selectionType /*= SELECTIONTYPE_NORMA
        CDirDoc * pDoc = GetDocument();
 
        // First, figure out what was selected (store into pos1 & pos2)
-       UIntPtr pos1 = NULL, pos2 = NULL, pos3 = NULL;
+       uintptr_t pos1 = NULL, pos2 = NULL, pos3 = NULL;
        int sel1 = -1, sel2 = -1, sel3 = -1;
        if (!GetSelectedItems(&sel1, &sel2, &sel3))
        {
@@ -1846,7 +1845,7 @@ void CDirView::OpenSelectionHex()
        CDirDoc * pDoc = GetDocument();
 
        // First, figure out what was selected (store into pos1 & pos2)
-       UIntPtr pos1 = NULL, pos2 = NULL;
+       uintptr_t pos1 = NULL, pos2 = NULL;
        int sel1 = -1, sel2 = -1, sel3 = -1;
        if (!GetSelectedItems(&sel1, &sel2, &sel3))
        {
@@ -2140,9 +2139,9 @@ void CDirView::OnUpdateCtxtDirCopyRightTo(CCmdUI* pCmdUI)
  * @param [in] idx Item's index to list in UI.
  * @return Key for item in given index.
  */
-UIntPtr CDirView::GetItemKey(int idx) const
+uintptr_t CDirView::GetItemKey(int idx) const
 {
-       return (UIntPtr) m_pList->GetItemData(idx);
+       return (uintptr_t) m_pList->GetItemData(idx);
 }
 
 // SetItemKey & GetItemKey encapsulate how the display list items
@@ -2165,7 +2164,7 @@ const DIFFITEM &CDirView::GetDiffItem(int sel) const
  */
 DIFFITEM & CDirView::GetDiffItemRef(int sel)
 {
-       UIntPtr diffpos = GetItemKey(sel);
+       uintptr_t diffpos = GetItemKey(sel);
 
        // If it is special item, return empty DIFFITEM
        if (diffpos == SPECIAL_ITEM_POS)
@@ -2190,7 +2189,7 @@ void CDirView::DeleteAllDisplayItems()
  * @brief Given key, get index of item which has it stored.
  * This function searches from list in UI.
  */
-int CDirView::GetItemIndex(UIntPtr key)
+int CDirView::GetItemIndex(uintptr_t key)
 {
        LVFINDINFO findInfo;
 
@@ -2807,7 +2806,7 @@ BOOL CDirView::PreTranslateMessage(MSG* pMsg)
                                        const DIFFITEM& di = GetDiffItem(sel);
                                        if (di.parent != NULL)
                                        {
-                                               int i = GetItemIndex((UIntPtr)di.parent);
+                                               int i = GetItemIndex((uintptr_t)di.parent);
                                                if (i >= 0)
                                                        MoveFocus(sel, i, GetSelectedCount());
                                        }
@@ -3491,7 +3490,7 @@ void CDirView::OnSelectAll()
                for (int i = 0; i < selCount; i++)
                {
                        // Don't select special items (SPECIAL_ITEM_POS)
-                       UIntPtr diffpos = GetItemKey(i);
+                       uintptr_t diffpos = GetItemKey(i);
                        if (diffpos != SPECIAL_ITEM_POS)
                                m_pList->SetItemState(i, LVIS_SELECTED, LVIS_SELECTED);
                }
@@ -3771,8 +3770,8 @@ void CDirView::OnHideFilenames()
        m_pList->SetRedraw(FALSE);      // Turn off updating (better performance)
        while ((sel = m_pList->GetNextItem(sel, LVNI_SELECTED)) != -1)
        {
-               UIntPtr pos = GetItemKey(sel);
-               if (pos == (UIntPtr) SPECIAL_ITEM_POS)
+               uintptr_t pos = GetItemKey(sel);
+               if (pos == (uintptr_t) SPECIAL_ITEM_POS)
                        continue;
                pDoc->SetItemViewFlag(pos, ViewCustomFlags::HIDDEN, ViewCustomFlags::VISIBILITY);
                const DIFFITEM &di = GetDiffItem(sel);
@@ -3989,7 +3988,7 @@ void CDirView::OnUpdateStatusNum(CCmdUI* pCmdUI)
        else
        {
                // Don't show number to special items
-               UIntPtr pos = GetItemKey(focusItem);
+               uintptr_t pos = GetItemKey(focusItem);
                if (pos != SPECIAL_ITEM_POS)
                {
                        // If compare is non-recursive reduce special items count
@@ -4052,7 +4051,7 @@ void CDirView::OnViewExpandAllSubdirs()
 {
        CDirDoc *pDoc = GetDocument();
        CDiffContext &ctxt = (CDiffContext &)pDoc->GetDiffContext();
-       UIntPtr diffpos = ctxt.GetFirstDiffPosition();
+       uintptr_t diffpos = ctxt.GetFirstDiffPosition();
        while (diffpos)
        {
                DIFFITEM &di = ctxt.GetNextDiffRefPosition(diffpos);
@@ -4076,7 +4075,7 @@ void CDirView::OnViewCollapseAllSubdirs()
 {
        CDirDoc *pDoc = GetDocument();
        CDiffContext &ctxt = (CDiffContext &)pDoc->GetDiffContext();
-       UIntPtr diffpos = ctxt.GetFirstDiffPosition();
+       uintptr_t diffpos = ctxt.GetFirstDiffPosition();
        while (diffpos)
        {
                DIFFITEM &di = ctxt.GetNextDiffRefPosition(diffpos);
@@ -4412,7 +4411,7 @@ DirViewTreeState *CDirView::SaveTreeState()
 {
        DirViewTreeState *pTreeState = new DirViewTreeState();
        CDiffContext &ctxt = const_cast<CDiffContext &>(GetDocument()->GetDiffContext());
-       UIntPtr diffpos = ctxt.GetFirstDiffPosition();
+       uintptr_t diffpos = ctxt.GetFirstDiffPosition();
        while (diffpos)
        {
                DIFFITEM &di = ctxt.GetNextDiffRefPosition(diffpos);
@@ -4428,7 +4427,7 @@ DirViewTreeState *CDirView::SaveTreeState()
 void CDirView::RestoreTreeState(DirViewTreeState *pTreeState)
 {
        CDiffContext &ctxt = const_cast<CDiffContext &>(GetDocument()->GetDiffContext());
-       UIntPtr diffpos = ctxt.GetFirstDiffPosition();
+       uintptr_t diffpos = ctxt.GetFirstDiffPosition();
        while (diffpos)
        {
                DIFFITEM &di = ctxt.GetNextDiffRefPosition(diffpos);
@@ -4452,7 +4451,7 @@ void CDirView::OnSearch()
        int nRows = m_pList->GetItemCount();
        for (int currRow = nRows - 1; currRow >= 0; currRow--)
        {
-               UIntPtr pos = GetItemKey(currRow);
+               uintptr_t pos = GetItemKey(currRow);
                if (pos == SPECIAL_ITEM_POS)
                        continue;
 
index 75077ab..773fa82 100644 (file)
@@ -34,8 +34,6 @@
 #include <afxcview.h>
 #include <map>
 #include <memory>
-#define POCO_NO_UNWINDOWS 1
-#include <Poco/Types.h>
 #include "OptionsDiffColors.h"
 #include "SortHeaderCtrl.h"
 #include "UnicodeString.h"
@@ -77,7 +75,7 @@ typedef std::map<String, bool> DirViewTreeState;
 /**
  * @brief Position value for special items (..) in directory compare view.
  */
-const Poco::UIntPtr SPECIAL_ITEM_POS = (Poco::UIntPtr) - 1L;
+const uintptr_t SPECIAL_ITEM_POS = (uintptr_t) - 1L;
 
 /** Default column width in directory compare */
 const UINT DefColumnWidth = 150;
@@ -115,11 +113,11 @@ public:
 
        void StartCompare(CompareStats *pCompareStats);
        void Redisplay();
-       void RedisplayChildren(Poco::UIntPtr diffpos, int level, UINT &index, int &alldiffs);
+       void RedisplayChildren(uintptr_t diffpos, int level, UINT &index, int &alldiffs);
        void UpdateResources();
        void LoadColumnHeaderItems();
-       Poco::UIntPtr GetItemKey(int idx) const;
-       int GetItemIndex(Poco::UIntPtr key);
+       uintptr_t GetItemKey(int idx) const;
+       int GetItemIndex(uintptr_t key);
        // for populating list
        void DeleteAllDisplayItems();
        void SetColumnWidths();
@@ -211,7 +209,7 @@ public:
 private:
        void InitiateSort();
        void NameColumn(int id, int subitem);
-       int AddNewItem(int i, Poco::UIntPtr diffpos, int iImage, int iIndent);
+       int AddNewItem(int i, uintptr_t diffpos, int iImage, int iIndent);
        bool IsDefaultSortAscending(int col) const;
        int ColPhysToLog(int i) const { return m_invcolorder[i]; }
        int ColLogToPhys(int i) const { return m_colorder[i]; } /**< -1 if not displayed */
@@ -264,12 +262,12 @@ protected:
        int AddSpecialItems();
        void GetCurrentColRegKeys(std::vector<String>& colKeys);
        void WarnContentsChanged(const String & failedPath);
-       void OpenSpecialItems(Poco::UIntPtr pos1, Poco::UIntPtr pos2, Poco::UIntPtr pos3);
-       bool OpenOneItem(Poco::UIntPtr pos1, DIFFITEM **di1, DIFFITEM **di2, DIFFITEM **di3,
+       void OpenSpecialItems(uintptr_t pos1, uintptr_t pos2, uintptr_t pos3);
+       bool OpenOneItem(uintptr_t pos1, DIFFITEM **di1, DIFFITEM **di2, DIFFITEM **di3,
                        PathContext &paths, int & sel1, bool & isDir);
-       bool OpenTwoItems(SELECTIONTYPE selectionType, Poco::UIntPtr pos1, Poco::UIntPtr pos2, DIFFITEM **di1, DIFFITEM **di2,
+       bool OpenTwoItems(SELECTIONTYPE selectionType, uintptr_t pos1, uintptr_t pos2, DIFFITEM **di1, DIFFITEM **di2,
                        PathContext &paths, int & sel1, int & sel2, bool & isDir);
-       bool OpenThreeItems(Poco::UIntPtr pos1, Poco::UIntPtr pos2, Poco::UIntPtr pos3, DIFFITEM **di1, DIFFITEM **di2, DIFFITEM **di3,
+       bool OpenThreeItems(uintptr_t pos1, uintptr_t pos2, uintptr_t pos3, DIFFITEM **di1, DIFFITEM **di2, DIFFITEM **di3,
                        PathContext &paths, int & sel1, int & sel2, int & sel3, bool & isDir);
        bool CreateFoldersPair(DIFFITEM & di, bool side1, String &newFolder);
 
index ef2e19d..86110e4 100644 (file)
@@ -26,8 +26,6 @@
 static char THIS_FILE[] = __FILE__;
 #endif
 
-using Poco::UIntPtr;
-
 /////////////////////////////////////////////////////////////////////////////
 
 
@@ -192,8 +190,8 @@ int CALLBACK CDirView::CompareState::CompareFunc(LPARAM lParam1, LPARAM lParam2,
        if (lParam2 == -1)
                return 1;
 
-       UIntPtr diffposl = (UIntPtr)lParam1;
-       UIntPtr diffposr = (UIntPtr)lParam2;
+       uintptr_t diffposl = (uintptr_t)lParam1;
+       uintptr_t diffposr = (uintptr_t)lParam2;
        const DIFFITEM &ldi = pThis->pCtxt->GetDiffAt(diffposl);
        const DIFFITEM &rdi = pThis->pCtxt->GetDiffAt(diffposr);
        // compare 'left' and 'right' parameters as appropriate
@@ -203,7 +201,7 @@ int CALLBACK CDirView::CompareState::CompareFunc(LPARAM lParam1, LPARAM lParam2,
 }
 
 /// Add new item to list view
-int CDirView::AddNewItem(int i, UIntPtr diffpos, int iImage, int iIndent)
+int CDirView::AddNewItem(int i, uintptr_t diffpos, int iImage, int iIndent)
 {
        LV_ITEM lvItem;
        lvItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE | LVIF_INDENT;
@@ -251,7 +249,7 @@ void CDirView::ReflectGetdispinfo(NMLVDISPINFO *pParam)
 {
        int nIdx = pParam->item.iItem;
        int i = ColPhysToLog(pParam->item.iSubItem);
-       UIntPtr key = GetItemKey(nIdx);
+       uintptr_t key = GetItemKey(nIdx);
        if (key == SPECIAL_ITEM_POS)
        {
                if (IsColName(i))
index 4ef5b55..f01b5c7 100644 (file)
@@ -12,6 +12,7 @@
 #include "stdafx.h"
 #include "DirViewColItems.h"
 #include <shlwapi.h>
+#include <cstdint>
 #include <Poco/Timestamp.h>
 #include "UnicodeString.h"
 #include "Merge.h"
@@ -47,23 +48,23 @@ using std::swap;
 static const UINT KILO = 1024;
 static const UINT MEGA = 1024 * KILO;
 static const UINT GIGA = 1024 * MEGA;
-static const __int64 TERA = 1024 * (__int64) GIGA;
+static const int64_t TERA = 1024 * (int64_t) GIGA;
 /**
  * @}
  */
 
 /**
- * @brief Function to compare two __int64s for a sort
+ * @brief Function to compare two int64_ts for a sort
  */
-static int cmp64(__int64 i1, __int64 i2)
+static int cmp64(int64_t i1, int64_t i2)
 {
        if (i1==i2) return 0;
        return i1>i2 ? 1 : -1;
 }
 /**
- * @brief Convert __int64 to int sign
+ * @brief Convert int64_t to int sign
  */
-static int sign64(__int64 val)
+static int sign64(int64_t val)
 {
   if (val>0) return 1;
   if (val<0) return -1;
@@ -109,11 +110,11 @@ static int cmpfloat(double v1, double v2)
  * @note Localized suffix strings are read from resource.
  * @todo Can't handle > terabyte filesizes.
  */
-static String MakeShortSize(__int64 size)
+static String MakeShortSize(int64_t size)
 {
-#pragma warning(disable:4244) // warning C4244: '=' : conversion from '__int64' to 'double', possible loss of data
+#pragma warning(disable:4244) // warning C4244: '=' : conversion from 'int64_t' to 'double', possible loss of data
        double fsize = size;
-#pragma warning(default:4244) // warning C4244: '=' : conversion from '__int64' to 'double', possible loss of data
+#pragma warning(default:4244) // warning C4244: '=' : conversion from 'int64_t' to 'double', possible loss of data
        double number = 0;
        int ndigits = 0;
        String suffix;
@@ -149,15 +150,15 @@ static String MakeShortSize(__int64 size)
                        ndigits = 1;
                }
        }
-       else if (size < (__int64)TERA)
+       else if (size < (int64_t)TERA)
        {
-               number = fsize / ((__int64)GIGA);
+               number = fsize / ((int64_t)GIGA);
                suffix = theApp.LoadString(IDS_SUFFIX_GIGA);
-               if (size < (__int64)GIGA * 10)
+               if (size < (int64_t)GIGA * 10)
                {
                        ndigits = 2;
                }
-               else if (size < (__int64)GIGA * 100)
+               else if (size < (int64_t)GIGA * 100)
                {
                        ndigits = 1;
                }
@@ -360,7 +361,7 @@ static String ColStatusGet(const CDiffContext *pCtxt, const void *p)
  */
 static String ColTimeGet(const CDiffContext *, const void *p)
 {
-       const __int64 r = *static_cast<const __int64*>(p) / Timestamp::resolution();
+       const int64_t r = *static_cast<const int64_t*>(p) / Timestamp::resolution();
        if (r)
                return locality::TimeString(&r);
        else
@@ -374,7 +375,7 @@ static String ColTimeGet(const CDiffContext *, const void *p)
  */
 static String ColSizeGet(const CDiffContext *, const void *p)
 {
-       const __int64 &r = *static_cast<const __int64*>(p);
+       const int64_t &r = *static_cast<const int64_t*>(p);
        String s;
        if (r != -1)
        {
@@ -390,7 +391,7 @@ static String ColSizeGet(const CDiffContext *, const void *p)
  */
 static String ColSizeShortGet(const CDiffContext *, const void *p)
 {
-       const __int64 &r = *static_cast<const __int64*>(p);
+       const int64_t &r = *static_cast<const int64_t*>(p);
        String s;
        if (r != -1)
        {
@@ -785,8 +786,8 @@ static int ColStatusSort(const CDiffContext *, const void *p, const void *q)
  */
 static int ColTimeSort(const CDiffContext *, const void *p, const void *q)
 {
-       const __int64 &r = *static_cast<const __int64*>(p);
-       const __int64 &s = *static_cast<const __int64*>(q);
+       const int64_t &r = *static_cast<const int64_t*>(p);
+       const int64_t &s = *static_cast<const int64_t*>(q);
        return cmp64(r, s);
 }
 
@@ -798,8 +799,8 @@ static int ColTimeSort(const CDiffContext *, const void *p, const void *q)
  */
 static int ColSizeSort(const CDiffContext *, const void *p, const void *q)
 {
-       const __int64 &r = *static_cast<const __int64*>(p);
-       const __int64 &s = *static_cast<const __int64*>(q);
+       const int64_t &r = *static_cast<const int64_t*>(p);
+       const int64_t &s = *static_cast<const int64_t*>(q);
        return cmp64(r, s);
 }
 
index da39e06..210d6b7 100644 (file)
@@ -9,9 +9,6 @@
 #ifndef FileTextStats_h_included
 #define FileTextStats_h_included
 
-#define POCO_NO_UNWINDOWS 1
-#include <Poco/Types.h>
-
 /**
  * @brief Structure containing statistics about compared file.
  * This structure contains EOL-byte and zero-byte statistics from compared
index 517ecd3..7841b38 100644 (file)
@@ -46,6 +46,7 @@
 #include "WaitStatusCursor.h"
 #include "../Externals/winimerge/src/WinIMergeLib.h"
 #include <cmath>
+#include <cstdint>
 #include <Shlwapi.h>
 
 #ifdef _DEBUG
@@ -282,7 +283,7 @@ bool CImgMergeFrame::IsFileChangedOnDisk(int pane) const
        int tolerance = 0;
        if (GetOptionsMgr()->GetBool(OPT_IGNORE_SMALL_FILETIME))
                tolerance = SmallTimeDiff; // From MainFrm.h
-       Poco::Int64 timeDiff = dfi.mtime - m_fileInfo[pane].mtime;
+       int64_t timeDiff = dfi.mtime - m_fileInfo[pane].mtime;
        if (timeDiff < 0) timeDiff = -timeDiff;
        if ((timeDiff > tolerance * Poco::Timestamp::resolution()) || (dfi.size != m_fileInfo[pane].size))
                return true;
index b2bfdd5..843ca09 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "StdAfx.h"
 #include "MergeDoc.h"
+#include <cstdint>
 #include <shlwapi.h>           // PathCompactPathEx()
 #include <io.h>
 #include <Poco/Timestamp.h>
@@ -2128,7 +2129,7 @@ CMergeDoc::FileChange CMergeDoc::IsFileChangedOnDisk(LPCTSTR szPath, DiffFileInf
 
        dfi.Update(szPath);
 
-       Poco::Int64 timeDiff = dfi.mtime - fileInfo->mtime;
+       int64_t timeDiff = dfi.mtime - fileInfo->mtime;
        if (timeDiff < 0) timeDiff = -timeDiff;
        if ((timeDiff > tolerance * Poco::Timestamp::resolution()) || (dfi.size != fileInfo->size))
        {
index dcf826f..bfd0662 100644 (file)
@@ -7,6 +7,7 @@
 // $Id: locality.cpp 5918 2008-09-07 16:05:46Z sdottaka $
 
 #include "locality.h"
+#include <cstdint>
 #include <windows.h>
 #include <Poco/Format.h>
 #include <Poco/Debugger.h>
@@ -15,7 +16,6 @@
 using Poco::format;
 using Poco::Debugger;
 using Poco::Timestamp;
-using Poco::Int64;
 
 namespace locality {
 
@@ -70,7 +70,7 @@ String NumToLocaleStr(int n)
  * @param [in] n Number to convert.
  * @return Converted string.
  */
-String NumToLocaleStr(Int64 n)
+String NumToLocaleStr(int64_t n)
 {
        TCHAR numbuff[34];
        _i64tot(n, numbuff, 10);
@@ -126,7 +126,7 @@ String GetLocaleStr(const TCHAR *str, int decimalDigits)
  * @param [in] tim Time in seconds since 1.1.1970.
  * @return Time as a string, proper to show in the GUI.
  */
-String TimeString(const Int64 * tim)
+String TimeString(const int64_t * tim)
 {
        if (!tim) return _T("---");
        
index 8d3b286..33305d8 100644 (file)
 #define locality_h_included
 
 #include "UnicodeString.h"
-#include <Poco/Types.h>
+#include <cstdint>
 
 namespace locality {
 
 String NumToLocaleStr(int n);
-String NumToLocaleStr(Poco::Int64 n);
+String NumToLocaleStr(int64_t n);
 String GetLocaleStr(const TCHAR *str, int decimalDigits = 0);
-String TimeString(const Poco::Int64 * tim);
+String TimeString(const int64_t * tim);
 
 };
 
index 8c62c16..28ec236 100644 (file)
@@ -84,6 +84,7 @@ DATE:         BY:                                     DESCRIPTION:
 
 #include "markdown.h"
 #include <cstring>
+#include <cstdint>
 #include <Poco/ByteOrder.h>
 #include <Poco/NumberParser.h>
 #include <Poco/SharedMemory.h>
@@ -101,7 +102,6 @@ using Poco::ByteOrder;
 using Poco::NumberParser;
 using Poco::SharedMemory;
 using Poco::File;
-using Poco::UInt16;
 
 #ifndef _WIN32
 #  include <strings.h>
@@ -800,7 +800,7 @@ CMarkdown::FileImage::FileImage(const TCHAR *path, size_t trunc, unsigned flags)
                        if (pCopy)
                        {
                                for (int i = 0; i < cbImage / 2; ++i)
-                                       *((UInt16 *)pCopy + i) = Poco::ByteOrder::flipBytes(*((UInt16 *)pImage + i));
+                                       *((uint16_t *)pCopy + i) = Poco::ByteOrder::flipBytes(*((uint16_t *)pImage + i));
                        }
 
                        delete m_pSharedMemory;
@@ -811,7 +811,7 @@ CMarkdown::FileImage::FileImage(const TCHAR *path, size_t trunc, unsigned flags)
                        case 2 + 0 + 8:
                                // little endian
                                int cchImage = cbImage / 2;
-                               UInt16 *pchImage = (UInt16 *)pImage;
+                               uint16_t *pchImage = (uint16_t *)pImage;
                                if (nByteOrder & 8)
                                {
                                        ++pchImage;
@@ -821,9 +821,9 @@ CMarkdown::FileImage::FileImage(const TCHAR *path, size_t trunc, unsigned flags)
                                pCopy = new unsigned char[cbImage];
                                if (pCopy)
                                {
-                                       UInt16 *pu16;
+                                       uint16_t *pu16;
                                        unsigned char *pu8;
-                                       for (pu16 = (UInt16 *)pchImage, pu8 = (unsigned char *)pCopy; pu16 < pchImage + cchImage; ++pu16)
+                                       for (pu16 = (uint16_t *)pchImage, pu8 = (unsigned char *)pCopy; pu16 < pchImage + cchImage; ++pu16)
                                                pu8 += ucr::Ucs4_to_Utf8(*pu16, pu8);
                                }
                                delete m_pSharedMemory;
@@ -841,7 +841,7 @@ CMarkdown::FileImage::FileImage(const TCHAR *path, size_t trunc, unsigned flags)
                        if (pCopy)
                        {
                                for (int i = 0; i < cbImage / 2; ++i)
-                                       *((UInt16 *)pCopy + i) = Poco::ByteOrder::flipBytes(*((UInt16 *)pImage + i));
+                                       *((uint16_t *)pCopy + i) = Poco::ByteOrder::flipBytes(*((uint16_t *)pImage + i));
                        }
                        delete m_pSharedMemory;
                        m_pSharedMemory = NULL;