]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Portability Fix: always-true comparison in ICAP for some 32-bit platforms
authorFrancesco Chemolli <kinkie@squid-cache.org>
Sun, 29 May 2011 06:45:37 +0000 (00:45 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 29 May 2011 06:45:37 +0000 (00:45 -0600)
configure.ac
src/adaptation/icap/ModXact.cc

index d129c7563cc99a81a5d3db3f1394025d963f1772..df4e57eea332d35dac7b8932d3a0156c5e2ec29b 100644 (file)
@@ -2593,6 +2593,7 @@ AC_CHECK_TYPE(uint64_t,[
   ],,SQUID_DEFAULT_INCLUDES)
 #need the define for overflow checks
 AC_CHECK_SIZEOF(off_t)
+AC_CHECK_SIZEOF(size_t)
 
 dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
 dnl that is incompatible with the updated Solaris header files.
index 5fffd340e2c14957ebdbac3a2f384e5fadf7c3f4..c719cbd0455084e3e30fd10dc193ac1b236daa53 100644 (file)
@@ -1620,6 +1620,10 @@ void Adaptation::Icap::VirginBodyAct::disable()
 void Adaptation::Icap::VirginBodyAct::progress(size_t size)
 {
     Must(active());
+#if SIZEOF_SIZE_T > 4
+    /* always true for smaller size_t's */
+    Must(static_cast<int64_t>(size) >= 0);
+#endif
     theStart += static_cast<int64_t>(size);
 }