[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [patch #9876] Const-correctness fixes, pointer types for bu
From: |
Freddie Chopin |
Subject: |
[lwip-devel] [patch #9876] Const-correctness fixes, pointer types for buffers & couple minor tweaks |
Date: |
Thu, 5 Dec 2019 16:25:40 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0 |
URL:
<https://savannah.nongnu.org/patch/?9876>
Summary: Const-correctness fixes, pointer types for buffers &
couple minor tweaks
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: freddie_chopin
Submitted on: Thu 05 Dec 2019 09:25:38 PM UTC
Category: PPP
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Details:
The major part of these patches is changing `u8_t*` to `const void*` for
pppos_input_tcpip(), pppos_input() and pppos_output_cb_fn(). There is no good
reason to use non-const buffers for these functions (and this is possibly
dangerous - why should output callback modify what lwIP gives it or why should
lwIP modify in-place what was given by user?).
While changes to pppos_input_tcpip() and pppos_input() are mostly harmless and
should not affect any application, change to pppos_output_cb_fn() (which I
actually consider the most important) is going to be non-backward compatible
and breaking change in all possible cases. Unfortunately users will now have
to change their prototypes (and maybe also slightly change the
implementation). This is evident from the changes which I had to make in the
example apps.
There is a similar problem for the functions from sio.h - while it may be
debatable whether one should use `u8_t*` or `void*`, functions which do
"writes" should use const pointers in all cases. Please let me know whether
you're open to changing that.
Please compile-test before (hopefully) submitting, as I was probably not able
to build every important combination of options and neither did I try to build
the test apps.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Thu 05 Dec 2019 09:25:38 PM UTC Name:
0001-Use-const-void-instead-of-u8_t-in-pppos_input_tcpip.patch Size: 2KiB
By: freddie_chopin
<http://savannah.nongnu.org/patch/download.php?file_id=48006>
-------------------------------------------------------
Date: Thu 05 Dec 2019 09:25:38 PM UTC Name:
0002-Use-const-void-instead-of-u8_t-in-pppos_input.patch Size: 2KiB By:
freddie_chopin
<http://savannah.nongnu.org/patch/download.php?file_id=48007>
-------------------------------------------------------
Date: Thu 05 Dec 2019 09:25:38 PM UTC Name:
0003-Remove-useless-cast-from-pppos_input_sys.patch Size: 846B By:
freddie_chopin
<http://savannah.nongnu.org/patch/download.php?file_id=48008>
-------------------------------------------------------
Date: Thu 05 Dec 2019 09:25:38 PM UTC Name:
0004-Use-const-void-instead-of-u8_t-in-pppos_output_cb_fn.patch Size: 3KiB
By: freddie_chopin
<http://savannah.nongnu.org/patch/download.php?file_id=48009>
_______________________________________________________
Reply to this item at:
<https://savannah.nongnu.org/patch/?9876>
_______________________________________________
Message sent via Savannah
https://savannah.nongnu.org/
- [lwip-devel] [patch #9876] Const-correctness fixes, pointer types for buffers & couple minor tweaks,
Freddie Chopin <=