OSDN Git Service

2005-07-20 Perry
authorPerry Rapp <elsapo@users.sourceforge.net>
Wed, 20 Jul 2005 18:07:57 +0000 (18:07 +0000)
committerPerry Rapp <elsapo@users.sourceforge.net>
Wed, 20 Jul 2005 18:07:57 +0000 (18:07 +0000)
 PATCH: [ 1241753 ] Fix DirViewColItems int64 cast warnings
  Src: DirViewColItems.cpp

Src/DirViewColItems.cpp
Src/readme.txt

index 3670e12..852e0f4 100644 (file)
@@ -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<const DiffFileInfo *>(p);
        const DiffFileInfo &s = *static_cast<const DiffFileInfo *>(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);
 }
 /* @} */
 
index 3ab86b5..9559f18 100644 (file)
@@ -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