From e45d30756dde16e12c6b69aa88b78997f86cc699 Mon Sep 17 00:00:00 2001 From: Perry Rapp Date: Wed, 20 Jul 2005 18:07:57 +0000 Subject: [PATCH] 2005-07-20 Perry PATCH: [ 1241753 ] Fix DirViewColItems int64 cast warnings Src: DirViewColItems.cpp --- Src/DirViewColItems.cpp | 13 +++++++++++-- Src/readme.txt | 4 ++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Src/DirViewColItems.cpp b/Src/DirViewColItems.cpp index 3670e126c..852e0f406 100644 --- a/Src/DirViewColItems.cpp +++ b/Src/DirViewColItems.cpp @@ -77,6 +77,15 @@ static int cmp64(__int64 i1, __int64 i2) return i1>i2 ? 1 : -1; } /** + * @brief Convert __int64 to int sign + */ +static int sign64(__int64 val) +{ + if (val>0) return 1; + if (val<0) return -1; + return 0; +} +/** * @brief Function to compare two diffcodes for a sort */ static int cmpdiffcode(int diffcode1, int diffcode2) @@ -418,9 +427,9 @@ static int ColEncodingSort(const CDiffContext *, const void *p, const void *q) const DiffFileInfo &r = *static_cast(p); const DiffFileInfo &s = *static_cast(q); __int64 n = cmp64(r.unicoding, s.unicoding); - if (n) return n; + if (n) return sign64(n); n = cmp64(r.codepage, s.codepage); - return n; + return sign64(n); } /* @} */ diff --git a/Src/readme.txt b/Src/readme.txt index 3ab86b5c9..9559f1860 100644 --- a/Src/readme.txt +++ b/Src/readme.txt @@ -1,3 +1,7 @@ +2005-07-20 Perry + PATCH: [ 1241753 ] Fix DirViewColItems int64 cast warnings + Src: DirViewColItems.cpp + 2005-07-19 Kimmo PATCH: [ 1238194 ] Use proper member names in MergeDiffDetailView Src: MergeDiffDetailView.cpp MergeDiffDetailView.h -- 2.11.0