]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed signed-with-unsigned compiler warnings.
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 12 Apr 2011 18:26:55 +0000 (12:26 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 12 Apr 2011 18:26:55 +0000 (12:26 -0600)
src/MemStore.cc
src/store.cc

index a82e1917a66e423cf2526540a4479548d25429cb..a9c2afe8a43a0a9880cbdcb0f119438f1bcc106d 100644 (file)
@@ -182,7 +182,9 @@ MemStore::copyFromShm(StoreEntry &e, const MemStoreMap::Extras &extras)
 
     assert(e.mem_obj->data_hdr.write(sourceBuf)); // from MemObject::write()
     const int64_t written = e.mem_obj->endOffset();
-    assert(written == sourceBuf.length); // StoreEntry::write never fails?
+    // we should write all because StoreEntry::write() never fails
+    assert(written >= 0 &&
+           static_cast<size_t>(written) == sourceBuf.length);
     // would be nice to call validLength() here, but it needs e.key
 
     debugs(20, 7, HERE << "mem-loaded all " << written << " bytes of " << e <<
@@ -214,7 +216,7 @@ bool
 MemStore::willFit(int64_t need)
 {
     // TODO: obey configured maximum entry size (with page-based rounding)
-    return need <= Ipc::Mem::PageSize();
+    return need <= static_cast<int64_t>(Ipc::Mem::PageSize());
 }
 
 /// allocates map slot and calls copyToShm to store the entry in shared memory
index 0ac43b8a34017be4813138762bd51ef61714243a..d62dd727b03ad971d9764e9f55ccf5d59b79ecb2 100644 (file)
@@ -1450,7 +1450,8 @@ StoreEntry::memoryCachable() const
 
     const int64_t expectedSize = mem_obj->expectedReplySize();
     // objects of unknown size are not allowed into the memory cache, for now
-    if (expectedSize < 0 || expectedSize > Config.Store.maxInMemObjSize)
+    if (expectedSize < 0 ||
+        expectedSize > static_cast<int64_t>(Config.Store.maxInMemObjSize))
         return 0;
 
     return 1;