patchlwIP - A Lightweight TCP/IP stack - Patches: patch #5764, api_lib.c cleanup: after patch...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #5764: api_lib.c cleanup: after patch #5687

Submitter:  Dmitry Potapov <dpotapov>
Submitted:  Wed 28 Feb 2007 05:49:17 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  fbernon Open/Closed:  Closed
Planned Release:  None

Sun 04 Mar 2007 11:57:45 AM UTC, comment #5: 

The patch should be included, yes. But I think api_msg should be left as it is. For me, it works fine the way it is now. Also, it would make the netconn struct bigger and I'd prefer to have the message on stack.

Simon Goldschmidt <goldsimon>
Group administrator
Sun 04 Mar 2007 08:24:52 AM UTC, comment #4: 

I think we should apply the change to remove the unnecessary underscore variables, but leave the api_msg in the netconn struct as it is.

Kieran Mansley <kieranm>
Group Member
Sun 04 Mar 2007 12:17:10 AM UTC, comment #3: 

Simon,

If it's good for you and for others, I can upgrade the CVS source code with these modifications, but what do you think about include the api_msg struct in the netconn struct?


Frédéric Bernon <fbernon>
Group Member
Thu 01 Mar 2007 07:03:41 AM UTC, comment #2: 

As it was me who submitted the original patch: I know I did that wrong, and I'd prefer the new version, too (#5764). When submitting the patch, I only wanted to have as little change as possible to point out the idea...

Simon Goldschmidt <goldsimon>
Group administrator
Wed 28 Feb 2007 06:07:16 PM UTC, comment #1: 

I'm agree with you, not about the underscore, but because avoiding the extra pointer give a simplest code...

Other remark, if LwIP's sockets and netconns are designed to be call by only one thread in the same time, so, perhaps put the struct api_msg directly in the netconn struct can be a idea. We could directly access to "conn->msg..." and it will avoid something like 10 "msg->msg.conn = conn;". But it is just a detail...



Frédéric Bernon <fbernon>
Group Member
Wed 28 Feb 2007 05:49:17 PM UTC, original submission:  

Declaring variables beginning with underscore is not good (the C standard reserves these names for vendor extentions)
Also, it is better to avoid extra pointer, which is not really necessary. So basic idea of this patch is:

-  struct api_msg _msg;
-  struct api_msg *msg = &_msg;
+  struct api_msg msg;

Dmitry Potapov <dpotapov>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by kieranm (Posted a comment)
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by fbernon (Posted a comment)
  • -email is unavailable- added by dpotapov (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-03-05 fbernon StatusNone Done
        Open/ClosedOpen Closed
    2007-03-04 fbernon Assigned toNone fbernon
    2007-02-28 dpotapov Attached File- Added MEMP_API_MSG_cleanup.patch, #12062

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code