aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/PositionCache.cxx4
-rw-r--r--src/PositionCache.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx
index f197a6559..820fd4895 100644
--- a/src/PositionCache.cxx
+++ b/src/PositionCache.cxx
@@ -594,7 +594,7 @@ bool PositionCacheEntry::Retrieve(unsigned int styleNumber_, const char *s_,
}
}
-int PositionCacheEntry::Hash(unsigned int styleNumber_, const char *s, unsigned int len_) {
+unsigned int PositionCacheEntry::Hash(unsigned int styleNumber_, const char *s, unsigned int len_) {
unsigned int ret = s[0] << 7;
for (unsigned int i=0; i<len_; i++) {
ret *= 1000003;
@@ -652,7 +652,7 @@ void PositionCache::MeasureWidths(Surface *surface, ViewStyle &vstyle, unsigned
// long comments with only a single comment.
// Two way associative: try two probe positions.
- int hashValue = PositionCacheEntry::Hash(styleNumber, s, len);
+ unsigned int hashValue = PositionCacheEntry::Hash(styleNumber, s, len);
probe = static_cast<int>(hashValue % pces.size());
if (pces[probe].Retrieve(styleNumber, s, len, positions)) {
return;
diff --git a/src/PositionCache.h b/src/PositionCache.h
index 871bb6e46..d8ea0119d 100644
--- a/src/PositionCache.h
+++ b/src/PositionCache.h
@@ -111,7 +111,7 @@ public:
void Set(unsigned int styleNumber_, const char *s_, unsigned int len_, XYPOSITION *positions_, unsigned int clock);
void Clear();
bool Retrieve(unsigned int styleNumber_, const char *s_, unsigned int len_, XYPOSITION *positions_) const;
- static int Hash(unsigned int styleNumber_, const char *s, unsigned int len);
+ static unsigned int Hash(unsigned int styleNumber_, const char *s, unsigned int len);
bool NewerThan(const PositionCacheEntry &other) const;
void ResetClock();
};