mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-04 05:39:53 +00:00
PPP, CORE, Fixed warning with PPP_PROTOCOLNAME enabled
lwip/src/netif/ppp/ppp.c: In function ‘ppp_input’: lwip/src/netif/ppp/ppp.c:769:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic] const char *pname = protocol_name(protocol); ^
This commit is contained in:
parent
bce29ac353
commit
5b29f1cdec
@ -654,6 +654,9 @@ void ppp_link_end(ppp_pcb *pcb) {
|
|||||||
*/
|
*/
|
||||||
void ppp_input(ppp_pcb *pcb, struct pbuf *pb) {
|
void ppp_input(ppp_pcb *pcb, struct pbuf *pb) {
|
||||||
u16_t protocol;
|
u16_t protocol;
|
||||||
|
#if PPP_DEBUG && PPP_PROTOCOLNAME
|
||||||
|
const char *pname;
|
||||||
|
#endif /* PPP_DEBUG && PPP_PROTOCOLNAME */
|
||||||
|
|
||||||
protocol = (((u8_t *)pb->payload)[0] << 8) | ((u8_t*)pb->payload)[1];
|
protocol = (((u8_t *)pb->payload)[0] << 8) | ((u8_t*)pb->payload)[1];
|
||||||
|
|
||||||
@ -766,7 +769,7 @@ void ppp_input(ppp_pcb *pcb, struct pbuf *pb) {
|
|||||||
|
|
||||||
#if PPP_DEBUG
|
#if PPP_DEBUG
|
||||||
#if PPP_PROTOCOLNAME
|
#if PPP_PROTOCOLNAME
|
||||||
const char *pname = protocol_name(protocol);
|
pname = protocol_name(protocol);
|
||||||
if (pname != NULL) {
|
if (pname != NULL) {
|
||||||
ppp_warn("Unsupported protocol '%s' (0x%x) received", pname, protocol);
|
ppp_warn("Unsupported protocol '%s' (0x%x) received", pname, protocol);
|
||||||
} else
|
} else
|
||||||
|
Loading…
Reference in New Issue
Block a user