From c696ca91e06dabd756694a160671a3e8930391e9 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 11 Dec 2025 11:06:09 +1100 Subject: [PATCH] extmod/modlwip: Narrow error_lookup_table type to int8_t. Reduces code size by about 60 bytes. Signed-off-by: Damien George --- extmod/modlwip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extmod/modlwip.c b/extmod/modlwip.c index 2d9cda8f17..e4bb720dba 100644 --- a/extmod/modlwip.c +++ b/extmod/modlwip.c @@ -213,7 +213,7 @@ static MP_DEFINE_CONST_OBJ_TYPE( // TODO: We just know that change happened somewhere between 1.4.0 and 1.4.1, // investigate in more detail. #if LWIP_VERSION_MACRO < 0x01040100 -static const int error_lookup_table[] = { +static const int8_t error_lookup_table[] = { 0, /* ERR_OK 0 No error, everything OK. */ MP_ENOMEM, /* ERR_MEM -1 Out of memory error. */ MP_ENOBUFS, /* ERR_BUF -2 Buffer error. */ @@ -234,7 +234,7 @@ static const int error_lookup_table[] = { MP_EBADF, /* _ERR_BADF -16 Closed socket (null pcb) */ }; #elif LWIP_VERSION_MACRO < 0x02000000 -static const int error_lookup_table[] = { +static const int8_t error_lookup_table[] = { 0, /* ERR_OK 0 No error, everything OK. */ MP_ENOMEM, /* ERR_MEM -1 Out of memory error. */ MP_ENOBUFS, /* ERR_BUF -2 Buffer error. */ @@ -258,7 +258,7 @@ static const int error_lookup_table[] = { // Matches lwIP 2.0.3 #undef _ERR_BADF #define _ERR_BADF -17 -static const int error_lookup_table[] = { +static const int8_t error_lookup_table[] = { 0, /* ERR_OK 0 No error, everything OK */ MP_ENOMEM, /* ERR_MEM -1 Out of memory error */ MP_ENOBUFS, /* ERR_BUF -2 Buffer error */