David Rose 19 سال پیش
والد
کامیت
36d9d7148c
2فایلهای تغییر یافته به همراه5 افزوده شده و 5 حذف شده
  1. 4 4
      panda/src/express/checksumHashGenerator.I
  2. 1 1
      panda/src/express/checksumHashGenerator.h

+ 4 - 4
panda/src/express/checksumHashGenerator.I

@@ -25,7 +25,7 @@
 //               is the principle implementation of the HashGenerator.
 ////////////////////////////////////////////////////////////////////
 INLINE void ChecksumHashGenerator::
-add_int(int sum) {
+add_int(long sum) {
   _hash += (size_t)sum;
 }
 
@@ -48,7 +48,7 @@ add_bool(bool flag) {
 ////////////////////////////////////////////////////////////////////
 INLINE void ChecksumHashGenerator::
 add_fp(float number, float threshold) {
-  add_int((int)(number / threshold));
+  add_int((long)(number / threshold));
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -60,7 +60,7 @@ add_fp(float number, float threshold) {
 ////////////////////////////////////////////////////////////////////
 INLINE void ChecksumHashGenerator::
 add_fp(double number, double threshold) {
-  add_int((int)(number / threshold));
+  add_int((long)(number / threshold));
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -72,5 +72,5 @@ add_fp(double number, double threshold) {
 ////////////////////////////////////////////////////////////////////
 INLINE void ChecksumHashGenerator::
 add_pointer(void *ptr) {
-  add_int((int)ptr);
+  add_int((long)ptr);
 }

+ 1 - 1
panda/src/express/checksumHashGenerator.h

@@ -31,7 +31,7 @@
 ////////////////////////////////////////////////////////////////////
 class EXPCL_PANDAEXPRESS ChecksumHashGenerator : public HashGeneratorBase {
 public:
-  INLINE void add_int(int num);
+  INLINE void add_int(long num);
   INLINE void add_bool(bool flag);
   INLINE void add_fp(float num, float threshold);
   INLINE void add_fp(double num, double threshold);