mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-29 00:32:51 +00:00
PPP: set protocol_list[] const
This array is a constant list of protocols, save some ram space by adding the const modifier it deserves.
This commit is contained in:
parent
1e6c4ac017
commit
c4eb52dcff
@ -1447,7 +1447,7 @@ int get_loop_output(void) {
|
|||||||
struct protocol_list {
|
struct protocol_list {
|
||||||
u_short proto;
|
u_short proto;
|
||||||
const char *name;
|
const char *name;
|
||||||
} protocol_list[] = {
|
} const protocol_list[] = {
|
||||||
{ 0x21, "IP" },
|
{ 0x21, "IP" },
|
||||||
{ 0x23, "OSI Network Layer" },
|
{ 0x23, "OSI Network Layer" },
|
||||||
{ 0x25, "Xerox NS IDP" },
|
{ 0x25, "Xerox NS IDP" },
|
||||||
@ -1582,7 +1582,7 @@ struct protocol_list {
|
|||||||
* protocol_name - find a name for a PPP protocol.
|
* protocol_name - find a name for a PPP protocol.
|
||||||
*/
|
*/
|
||||||
const char * protocol_name(int proto) {
|
const char * protocol_name(int proto) {
|
||||||
struct protocol_list *lp;
|
const struct protocol_list *lp;
|
||||||
|
|
||||||
for (lp = protocol_list; lp->proto != 0; ++lp) {
|
for (lp = protocol_list; lp->proto != 0; ++lp) {
|
||||||
if (proto == lp->proto) {
|
if (proto == lp->proto) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user