lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] [bug #3031] Implement a new fullypool-basedpbufimplemen


From: Jonathan Larmour
Subject: Re: [lwip-devel] [bug #3031] Implement a new fullypool-basedpbufimplementation.
Date: Tue, 31 Jul 2007 16:09:38 +0100
User-agent: Thunderbird 1.5.0.12 (X11/20070530)

Goldschmidt Simon wrote:
I haven't compiled it, but doesn't this do it:

#define pbuf_clen(p, len) \
{ \
  struct pbuf *q = (p); \
  (len) = 0; \
  while (q != NULL) { \
    ++(len); \
    q = q->next; \
  }\
  len    // no semicolon!
}

That's the same as my version, isn't it? The problem is it should be
#define pbuf_clen(p) and _return_ len, to be compatible to the existing
function.

Since it only is used in tcp_in.c, we could maybe create a new define to
use in tcp_in.c and leave the function exist like it is, for application
Compatibility?

Sorry, I've only just seen this thread (taken me a long time to catch up with all mail). What Jared says is right, you can declare a new variable in a local scope, or you can make it be an expression, but not both - I had missed that with my suggestion. I added a comment to https://savannah.nongnu.org/bugs/?3031 on the 26th to this effect, saying it would maybe be better to make a different name for the macro version.

Jifl
--
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["The best things in life aren't things."]------      Opinions==mine




reply via email to

[Prev in Thread] Current Thread [Next in Thread]