Merge pull request #4196 from neheb/gcc10
authorFlorian Eckert <fe@dev.tdt.de>
Thu, 2 Jul 2020 16:52:22 +0000 (18:52 +0200)
committerGitHub <noreply@github.com>
Thu, 2 Jul 2020 16:52:22 +0000 (18:52 +0200)
move nixio__bin2hex to header and make static

libs/luci-lib-nixio/src/address.c
libs/luci-lib-nixio/src/binary.c
libs/luci-lib-nixio/src/nixio.h

index 0bf53caf82cee3c1211b8ae911f5e2d3c45c81f7..6ed3e5c0e919ca9eff909286a9243be4015612a9 100644 (file)
@@ -153,7 +153,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;
index da794536ce79653d2f3707d7527471bc2102200c..56f6d1e2f695ceb72960edca27ed7555a693f3b9 100644 (file)
 #include "nixio.h"
 #include <stdlib.h>
 
-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+/";
 
index 5eb84d11ae34f6340c26e3886d37a8b4c315da20..25874eb04f77014738338cdddaa130d206f8263f 100644 (file)
@@ -107,7 +107,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);