From: Jim Meyering Date: Tue, 6 Jan 2015 23:15:46 +0000 (-0800) Subject: folly/wangle/channel/ChannelPipeline.h: avoid -Wsign-compare errors (trivial) X-Git-Tag: v0.22.0~39 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=042bbfeb7aee1aa37567d48d1dc50eb4d82b5811;p=folly.git folly/wangle/channel/ChannelPipeline.h: avoid -Wsign-compare errors (trivial) Summary: * folly/wangle/channel/ChannelPipeline.h: Declare for-loop indices to be of type size_t(not int), to match size of upper bound. Otherwise, gcc-4.9 fails with e.g., folly/wangle/channel/ChannelPipeline.h:126:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] Test Plan: Run this and note there are fewer errors than before: fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo Reviewed By: davejwatson@fb.com Subscribers: fugalh, folly-diffs@ FB internal diff: D1767783 Tasks: 5941250 Signature: t1:1767783:1420587925:d662b75e6a62ebd5bacdde28ad6e1da22ef777ac --- diff --git a/folly/wangle/channel/ChannelPipeline.h b/folly/wangle/channel/ChannelPipeline.h index 07d10ba8..6536efac 100644 --- a/folly/wangle/channel/ChannelPipeline.h +++ b/folly/wangle/channel/ChannelPipeline.h @@ -123,7 +123,7 @@ class ChannelPipeline : public DelayedDestruction { return; } - for (int i = 0; i < ctxs_.size() - 1; i++) { + for (size_t i = 0; i < ctxs_.size() - 1; i++) { ctxs_[i]->link(ctxs_[i+1].get()); } @@ -293,7 +293,7 @@ class ChannelPipeline } if (!ctxs_.empty()) { - for (int i = 0; i < ctxs_.size() - 1; i++) { + for (size_t i = 0; i < ctxs_.size() - 1; i++) { ctxs_[i]->link(ctxs_[i+1].get()); } ctxs_.back()->link(&ctx_);