提交 0d98e248 编写于 作者: H Haojun Liao

[TD-225]fix compiler error.

上级 c04da26c
...@@ -119,7 +119,7 @@ int32_t tBucketIntHash(tMemBucket *pBucket, const void *value) { ...@@ -119,7 +119,7 @@ int32_t tBucketIntHash(tMemBucket *pBucket, const void *value) {
// divide the value range into 1024 buckets // divide the value range into 1024 buckets
uint64_t span = pBucket->range.i64MaxVal - pBucket->range.i64MinVal; uint64_t span = pBucket->range.i64MaxVal - pBucket->range.i64MinVal;
if (span < pBucket->numOfSlots) { if (span < pBucket->numOfSlots) {
int32_t delta = v - pBucket->range.i64MinVal; int64_t delta = v - pBucket->range.i64MinVal;
index = (delta % pBucket->numOfSlots); index = (delta % pBucket->numOfSlots);
} else { } else {
double slotSpan = (double)span / pBucket->numOfSlots; double slotSpan = (double)span / pBucket->numOfSlots;
...@@ -141,8 +141,8 @@ int32_t tBucketUintHash(tMemBucket *pBucket, const void *value) { ...@@ -141,8 +141,8 @@ int32_t tBucketUintHash(tMemBucket *pBucket, const void *value) {
// divide the value range into 1024 buckets // divide the value range into 1024 buckets
uint64_t span = pBucket->range.u64MaxVal - pBucket->range.u64MinVal; uint64_t span = pBucket->range.u64MaxVal - pBucket->range.u64MinVal;
if (span < pBucket->numOfSlots) { if (span < pBucket->numOfSlots) {
int32_t delta = v - pBucket->range.u64MinVal; int64_t delta = v - pBucket->range.u64MinVal;
index = (delta % pBucket->numOfSlots); index = (int32_t) (delta % pBucket->numOfSlots);
} else { } else {
double slotSpan = (double)span / pBucket->numOfSlots; double slotSpan = (double)span / pBucket->numOfSlots;
index = (int32_t)((v - pBucket->range.u64MinVal) / slotSpan); index = (int32_t)((v - pBucket->range.u64MinVal) / slotSpan);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册