Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #10179

Re: Thoughts on function

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c++
Subject Re: Thoughts on function
Date 2011-09-16 07:38 +1200
Message-ID <9df2i4F2gmU11@mid.individual.net> (permalink)
References <19d88541-0f1e-4fa5-90dd-9ff8c23046f3@19g2000vbx.googlegroups.com> <9ddfi0F784U12@mid.individual.net> <85a545df-d6b9-4e67-9570-4d2aab13b8c3@f41g2000yqh.googlegroups.com>

Show all headers | View raw


On 09/16/11 02:34 AM, Ebenezer wrote:
> On Sep 15, 12:08 am, Ian Collins<ian-n...@hotmail.com>  wrote:
>> On 09/15/11 05:01 PM, Ebenezer wrote:
>>
>>
>>
>>> Shalom
>>
>>> How to improve this function?
>>
>>> bool
>>> SendBuffer::Flush ()
>>> {
>>>     uint32_t const all = buf_.size();
>>>     uint32_t numWritten = 0;
>>
>> You're probably better off using size_t unless you have a really really
>> good reason to use uint32_t.
>>
>>>     if (partialFlush_) {
>>>       ::neolib::segmented_array<unsigned char, chunk_size>::segment&
>>> segment =
>>>                  segmented_iterator<unsigned char,
>>> chunk_size>(buf_.begin()).segment();
>>
>>>       numWritten = Write(sock_,&buf_[0], segment.size());
>>
>> Undeclared function again.
>>
>>>       if (numWritten<    segment.size()) goto ending;
>>
>> Ug.
>>
>>>       partialFlush_ = false;
>>
>> Lots of undefined stuff there, so can't comment.
>
> Sorry.  Some are here --
> http://webEbenezer.net/misc/SendBuffer.hh .
> The Write function is here
> http://webEbenezer.net/misc/IO.cc .

But that doesn't excuse the gratuitous use of goto!

-- 
Ian Collins

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Thoughts on function Ebenezer <woodbrian77@gmail.com> - 2011-09-14 22:01 -0700
  Re: Thoughts on function Ian Collins <ian-news@hotmail.com> - 2011-09-15 17:08 +1200
    Re: Thoughts on function Ebenezer <woodbrian77@gmail.com> - 2011-09-15 07:34 -0700
      Re: Thoughts on function Ian Collins <ian-news@hotmail.com> - 2011-09-16 07:38 +1200
        Re: Thoughts on function Leigh Johnston <leigh@i42.co.uk> - 2011-09-15 20:40 +0100
        Re: Thoughts on function Ebenezer <woodbrian77@gmail.com> - 2011-09-15 17:23 -0700
          Re: Thoughts on function Ebenezer <woodbrian77@gmail.com> - 2011-09-18 13:30 -0700
            Re: Thoughts on function Ian Collins <ian-news@hotmail.com> - 2011-09-19 09:34 +1200
              Re: Thoughts on function Ebenezer <woodbrian77@gmail.com> - 2011-09-18 18:25 -0700
                Re: Thoughts on function Geoff <geoff@invalid.invalid> - 2011-09-18 19:08 -0700
                Re: Thoughts on function Ebenezer <woodbrian77@gmail.com> - 2011-09-18 19:46 -0700
                Re: Thoughts on function Geoff <geoff@invalid.invalid> - 2011-09-18 20:12 -0700
                Re: Thoughts on function Ebenezer <woodbrian77@gmail.com> - 2011-09-18 21:28 -0700
                Re: Thoughts on function Miles Bader <miles@gnu.org> - 2011-09-19 13:26 +0900
                Re: Thoughts on function Ian Collins <ian-news@hotmail.com> - 2011-09-19 16:45 +1200
                Re: Thoughts on function Miles Bader <miles@gnu.org> - 2011-09-19 15:19 +0900
                Re: Thoughts on function Ian Collins <ian-news@hotmail.com> - 2011-09-19 16:43 +1200
                Re: Thoughts on function Ebenezer <woodbrian77@gmail.com> - 2011-09-19 11:16 -0700
                Re: Thoughts on function Ian Collins <ian-news@hotmail.com> - 2011-09-20 07:44 +1200
                Re: Thoughts on function Ebenezer <woodbrian77@gmail.com> - 2011-09-19 18:03 -0700
                Re: Thoughts on function Ian Collins <ian-news@hotmail.com> - 2011-09-20 13:15 +1200
                Re: Thoughts on function Ebenezer <woodbrian77@gmail.com> - 2011-09-19 18:27 -0700
  Re: Thoughts on function Fulvio Esposito <esposito.fulvio@gmail.com> - 2011-09-16 02:19 -0700
    Re: Thoughts on function Ebenezer <woodbrian77@gmail.com> - 2011-09-16 11:20 -0700
      Re: Thoughts on function Fulvio Esposito <esposito.fulvio@gmail.com> - 2011-09-16 13:51 -0700
  Re: Thoughts on function hanukas <jukka@liimatta.org> - 2011-09-19 06:19 -0700

csiph-web