From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
To: dccp@vger.kernel.org
Subject: Re: [PATCH 3/3]: Convert Reset code into socket error number
Date: Mon, 01 Oct 2007 20:15:15 +0000 [thread overview]
Message-ID: <20071001201515.GC7881@ghostprotocols.net> (raw)
In-Reply-To: <200709291744.53552@strip-the-willow>
Em Tue, Oct 02, 2007 at 09:07:24AM +1300, Ian McDonald escreveu:
> On 10/2/07, Arnaldo Carvalho de Melo <acme@ghostprotocols.net> wrote:
> > He used a "designated initializer", i.e. he said at which index in the
> > array it the value is to be set. So it really doesn't matter the order.
> > And when checking if the code was within the valid range he tested
> > against the last entry in the enum. Correct code. :-)
> >
> > - Arnaldo
> >
> Yes you are correct. I misread the code.
>
> However - I'd prefer another constant to match last in enum at the
> same point as the declaration of the enum. This way if values are
> added other code doesn't break. I've seen this done before quite a few
> times. It is dangerous on relying on the last value when it's not
> explicitly marked as the last value.
Agreed, TCP_MAX_STATES, etc :-)
- Arnaldo
next prev parent reply other threads:[~2007-10-01 20:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-29 16:44 [PATCH 3/3]: Convert Reset code into socket error number Gerrit Renker
2007-10-01 19:38 ` Ian McDonald
2007-10-01 19:55 ` Arnaldo Carvalho de Melo
2007-10-01 20:07 ` Ian McDonald
2007-10-01 20:15 ` Arnaldo Carvalho de Melo [this message]
2007-10-02 10:04 ` Gerrit Renker
2007-10-02 10:08 ` Gerrit Renker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071001201515.GC7881@ghostprotocols.net \
--to=acme@ghostprotocols.net \
--cc=dccp@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.