From: Alex Rousskov Date: Tue, 12 Apr 2011 18:26:55 +0000 (-0600) Subject: Fixed signed-with-unsigned compiler warnings. X-Git-Tag: take06~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30204d233f9095f349050d83e9b9391a9715fba2;p=thirdparty%2Fsquid.git Fixed signed-with-unsigned compiler warnings. --- diff --git a/src/MemStore.cc b/src/MemStore.cc index a82e1917a6..a9c2afe8a4 100644 --- a/src/MemStore.cc +++ b/src/MemStore.cc @@ -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(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(Ipc::Mem::PageSize()); } /// allocates map slot and calls copyToShm to store the entry in shared memory diff --git a/src/store.cc b/src/store.cc index 0ac43b8a34..d62dd727b0 100644 --- a/src/store.cc +++ b/src/store.cc @@ -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(Config.Store.maxInMemObjSize)) return 0; return 1;