From aa12cbf9240365801d7f8a089e0f7284c79cef02 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 20 Jul 2021 00:40:06 +0800 Subject: [PATCH] luci-lib-nixio: fixes compilation under GCC10/11 --- libs/luci-lib-nixio/src/address.c | 2 +- libs/luci-lib-nixio/src/binary.c | 4 ---- libs/luci-lib-nixio/src/nixio.h | 4 +++- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/libs/luci-lib-nixio/src/address.c b/libs/luci-lib-nixio/src/address.c index 8ab4fa89..2fca28b1 100644 --- a/libs/luci-lib-nixio/src/address.c +++ b/libs/luci-lib-nixio/src/address.c @@ -152,7 +152,7 @@ int nixio__addr_write(nixio_addr *addr, struct sockaddr *saddr) { /** * netmask to prefix helper */ -int nixio__addr_prefix(struct sockaddr *saddr) { +static int nixio__addr_prefix(struct sockaddr *saddr) { int prefix = 0; size_t len; uint8_t *addr; diff --git a/libs/luci-lib-nixio/src/binary.c b/libs/luci-lib-nixio/src/binary.c index 2c416222..28b2523d 100644 --- a/libs/luci-lib-nixio/src/binary.c +++ b/libs/luci-lib-nixio/src/binary.c @@ -19,10 +19,6 @@ #include "nixio.h" #include -const char nixio__bin2hex[16] = { -'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' -}; - static unsigned char nixio__b64encode_tbl[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; diff --git a/libs/luci-lib-nixio/src/nixio.h b/libs/luci-lib-nixio/src/nixio.h index 8802e920..0608f351 100644 --- a/libs/luci-lib-nixio/src/nixio.h +++ b/libs/luci-lib-nixio/src/nixio.h @@ -103,7 +103,9 @@ int nixio__mode_write(int mode, char *modestr); int nixio__push_stat(lua_State *L, nixio_stat_t *buf); -const char nixio__bin2hex[16]; +static const char nixio__bin2hex[16] = { +'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' +}; /* Module functions */ void nixio_open_file(lua_State *L);