From 65bdd05e47f047230b192c0f69850969adf5f11c Mon Sep 17 00:00:00 2001 From: dim Date: Tue, 23 Oct 2012 18:36:07 +0000 Subject: Fix several clang warnings in libstdc++, which were exposed by the recent atf import. These changes are purely cosmetic, no functional change. MFC after: 1 week --- contrib/libstdc++/include/bits/fstream.tcc | 32 ++++++++++++++++-------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'contrib/libstdc++/include/bits/fstream.tcc') diff --git a/contrib/libstdc++/include/bits/fstream.tcc b/contrib/libstdc++/include/bits/fstream.tcc index ea097c6..7b6f09b 100644 --- a/contrib/libstdc++/include/bits/fstream.tcc +++ b/contrib/libstdc++/include/bits/fstream.tcc @@ -641,21 +641,23 @@ _GLIBCXX_BEGIN_NAMESPACE(std) setbuf(char_type* __s, streamsize __n) { if (!this->is_open()) - if (__s == 0 && __n == 0) - _M_buf_size = 1; - else if (__s && __n > 0) - { - // This is implementation-defined behavior, and assumes that - // an external char_type array of length __n exists and has - // been pre-allocated. If this is not the case, things will - // quickly blow up. When __n > 1, __n - 1 positions will be - // used for the get area, __n - 1 for the put area and 1 - // position to host the overflow char of a full put area. - // When __n == 1, 1 position will be used for the get area - // and 0 for the put area, as in the unbuffered case above. - _M_buf = __s; - _M_buf_size = __n; - } + { + if (__s == 0 && __n == 0) + _M_buf_size = 1; + else if (__s && __n > 0) + { + // This is implementation-defined behavior, and assumes that + // an external char_type array of length __n exists and has + // been pre-allocated. If this is not the case, things will + // quickly blow up. When __n > 1, __n - 1 positions will be + // used for the get area, __n - 1 for the put area and 1 + // position to host the overflow char of a full put area. + // When __n == 1, 1 position will be used for the get area + // and 0 for the put area, as in the unbuffered case above. + _M_buf = __s; + _M_buf_size = __n; + } + } return this; } -- cgit v1.1