------------------------------------------------------------ revno: 13588 revision-id: squid3@treenet.co.nz-20140915005729-v02shmottaem2yzx parent: squid3@treenet.co.nz-20140915005305-9vomnjc1j1wpk6xa committer: Amos Jeffries branch nick: trunk timestamp: Sun 2014-09-14 17:57:29 -0700 message: Portability: rename BodyPipe member to avoid clash with pipe() macro Our Windows compatibility layer defines pipe() as a macro. On MinGW at least the precompiler makes no distinction between parameterless macro pipe() and pipe variables. Use thePipe for member naming and aPipe for function local variables. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20140915005729-v02shmottaem2yzx # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: 165d3cc61ac6d9ec21fb96a4f2440e65557b1e94 # timestamp: 2014-09-15 10:53:24 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squid3@treenet.co.nz-20140915005305-\ # 9vomnjc1j1wpk6xa # # Begin patch === modified file 'src/BodyPipe.cc' --- src/BodyPipe.cc 2014-09-13 13:59:43 +0000 +++ src/BodyPipe.cc 2014-09-15 00:57:29 +0000 @@ -78,10 +78,9 @@ return false; const BodyProducer::Pointer &producer = job; - BodyPipe::Pointer pipe = arg1; - if (!pipe->stillProducing(producer)) { - debugs(call.debugSection, call.debugLevel, HERE << producer << - " no longer producing for " << pipe->status()); + BodyPipe::Pointer aPipe = arg1; + if (!aPipe->stillProducing(producer)) { + debugs(call.debugSection, call.debugLevel, producer << " no longer producing for " << aPipe->status()); return call.cancel("no longer producing"); } @@ -95,10 +94,9 @@ return false; const BodyConsumer::Pointer &consumer = job; - BodyPipe::Pointer pipe = arg1; - if (!pipe->stillConsuming(consumer)) { - debugs(call.debugSection, call.debugLevel, HERE << consumer << - " no longer consuming from " << pipe->status()); + BodyPipe::Pointer aPipe = arg1; + if (!aPipe->stillConsuming(consumer)) { + debugs(call.debugSection, call.debugLevel, consumer << " no longer consuming from " << aPipe->status()); return call.cancel("no longer consuming"); } @@ -108,24 +106,23 @@ /* BodyProducer */ // inform the pipe that we are done and clear the Pointer -void BodyProducer::stopProducingFor(RefCount &pipe, bool atEof) +void BodyProducer::stopProducingFor(RefCount &p, bool atEof) { - debugs(91,7, HERE << this << " will not produce for " << pipe << - "; atEof: " << atEof); - assert(pipe != NULL); // be strict: the caller state may depend on this - pipe->clearProducer(atEof); - pipe = NULL; + debugs(91,7, this << " will not produce for " << p << "; atEof: " << atEof); + assert(p != NULL); // be strict: the caller state may depend on this + p->clearProducer(atEof); + p = NULL; } /* BodyConsumer */ // inform the pipe that we are done and clear the Pointer -void BodyConsumer::stopConsumingFrom(RefCount &pipe) +void BodyConsumer::stopConsumingFrom(RefCount &p) { - debugs(91,7, HERE << this << " will not consume from " << pipe); - assert(pipe != NULL); // be strict: the caller state may depend on this - pipe->clearConsumer(); - pipe = NULL; + debugs(91,7, this << " will not consume from " << p); + assert(p != NULL); // be strict: the caller state may depend on this + p->clearConsumer(); + p = NULL; } /* BodyPipe */ @@ -479,7 +476,7 @@ /* BodyPipeCheckout */ -BodyPipeCheckout::BodyPipeCheckout(BodyPipe &aPipe): pipe(aPipe), +BodyPipeCheckout::BodyPipeCheckout(BodyPipe &aPipe): thePipe(aPipe), buf(aPipe.checkOut()), offset(aPipe.consumedSize()), checkedOutSize(buf.contentSize()), checkedIn(false) { @@ -492,7 +489,7 @@ // TODO: consider implementing the long-term solution discussed at // http://www.mail-archive.com/squid-dev@squid-cache.org/msg07910.html debugs(91,2, HERE << "Warning: cannot undo BodyPipeCheckout"); - pipe.checkIn(*this); + thePipe.checkIn(*this); } } @@ -500,11 +497,11 @@ BodyPipeCheckout::checkIn() { assert(!checkedIn); - pipe.checkIn(*this); + thePipe.checkIn(*this); checkedIn = true; } -BodyPipeCheckout::BodyPipeCheckout(const BodyPipeCheckout &c): pipe(c.pipe), +BodyPipeCheckout::BodyPipeCheckout(const BodyPipeCheckout &c): thePipe(c.thePipe), buf(c.buf), offset(c.offset), checkedOutSize(c.checkedOutSize), checkedIn(c.checkedIn) { === modified file 'src/BodyPipe.h' --- src/BodyPipe.h 2014-09-13 13:59:43 +0000 +++ src/BodyPipe.h 2014-09-15 00:57:29 +0000 @@ -31,7 +31,7 @@ virtual void noteBodyConsumerAborted(RefCount bp) = 0; protected: - void stopProducingFor(RefCount &pipe, bool atEof); + void stopProducingFor(RefCount &, bool atEof); }; /** Interface for those who want to consume body content from others. @@ -52,7 +52,7 @@ virtual void noteBodyProducerAborted(RefCount bp) = 0; protected: - void stopConsumingFrom(RefCount &pipe); + void stopConsumingFrom(RefCount &); }; /** Makes raw buffer checkin/checkout interface efficient and exception-safe. @@ -64,13 +64,13 @@ friend class BodyPipe; public: - BodyPipeCheckout(BodyPipe &pipe); // checks out + BodyPipeCheckout(BodyPipe &); // checks out ~BodyPipeCheckout(); // aborts checkout unless checkedIn void checkIn(); public: - BodyPipe &pipe; + BodyPipe &thePipe; MemBuf &buf; const uint64_t offset; // of current content, relative to the body start