commit eb3f3d345c548bc881d1041d6413fdd3e1cc0987 Author: Alex Rousskov Date: Wed Dec 2 11:11:35 2015 -0700 Fix compilation with GCC 4.4 on 32bit platforms. error: no matching function for call to min(size_type, Size). The added cast is safe because Size cannot be smaller than size_type and because min() will select [smaller] bufSize if tricklingMax exceeds size_type capacity. Merged: ECAP-30-conflicting-types-in-stdmin-in-a diff --git a/src/Xaction.cc b/src/Xaction.cc index 35cc6ff..4e1f7ee 100644 --- a/src/Xaction.cc +++ b/src/Xaction.cc @@ -285,41 +285,41 @@ void Adapter::Xaction::abStopMaking() libecap::Area Adapter::Xaction::abContent(size_type offset, size_type size) { Must(sendingAb == opOn || sendingAb == opComplete); // Bail if the host called us before we called noteAbContentAvailable(), // while we are still waiting for the first noteVbContentAvailable() call. if (!vbFile) return libecap::Area(); Must(abOffset <= std::numeric_limits::max() - offset); // no overflows const Size pos = abOffset + offset; size_type bufSize = size; switch (finalAction) { case actPending: { // We are here because we are or were trickling. If we stopped trickling, // we should not give more than we had trickled (until the final action). const Size tricklingMax = (trickledSize > pos) ? trickledSize - pos : 0; - bufSize = std::min(bufSize, tricklingMax); + bufSize = std::min(static_cast(bufSize), tricklingMax); // fall through to also obey actAllow limits } case actAllow: // do not read more than abBufSizeMax at once bufSize = std::min(bufSize, abBufSizeMax); break; case actBlock: // do not give the host any more body bytes! bufSize = 0; break; } Must(pos <= Service::MaxSize()); // no off_t overflows return vbFile->read(pos, bufSize); } void Adapter::Xaction::abContentShift(size_type bytes) {