From dab972b9070d6232fd50ff2ab71305556c5d08cd Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Mon, 3 Jul 2023 00:23:55 +0800 Subject: [PATCH] Remove the const cast from the initialization of boardioc_symtab_s::symtab Signed-off-by: Xiang Xiao --- examples/module/module_main.c | 2 +- examples/posix_spawn/spawn_main.c | 2 +- examples/thttpd/thttpd_main.c | 2 +- netutils/thttpd/thttpd.c | 1 - netutils/thttpd/thttpd_cgi.c | 1 - nshlib/nsh_init.c | 2 +- 6 files changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/module/module_main.c b/examples/module/module_main.c index 0b940bc6c..3c72f5aa3 100644 --- a/examples/module/module_main.c +++ b/examples/module/module_main.c @@ -153,7 +153,7 @@ int main(int argc, FAR char *argv[]) #ifdef CONFIG_BUILD_FLAT /* Set the OS symbol table indirectly through the boardctl() */ - symdesc.symtab = (FAR struct symtab_s *)g_mod_exports; + symdesc.symtab = g_mod_exports; symdesc.nsymbols = g_mod_nexports; ret = boardctl(BOARDIOC_OS_SYMTAB, (uintptr_t)&symdesc); if (ret < 0) diff --git a/examples/posix_spawn/spawn_main.c b/examples/posix_spawn/spawn_main.c index a06915f73..38d6e180c 100644 --- a/examples/posix_spawn/spawn_main.c +++ b/examples/posix_spawn/spawn_main.c @@ -262,7 +262,7 @@ int main(int argc, FAR char *argv[]) /* Make sure that we are using our symbol tablee */ - symdesc.symtab = (FAR struct symtab_s *)g_spawn_exports; /* Discard 'const' */ + symdesc.symtab = g_spawn_exports; symdesc.nsymbols = g_spawn_nexports; boardctl(BOARDIOC_APP_SYMTAB, (uintptr_t)&symdesc); diff --git a/examples/thttpd/thttpd_main.c b/examples/thttpd/thttpd_main.c index fe51fb41d..84d6505e3 100644 --- a/examples/thttpd/thttpd_main.c +++ b/examples/thttpd/thttpd_main.c @@ -165,7 +165,7 @@ */ FAR const struct symtab_s *g_thttpdsymtab; -int g_thttpdnsymbols; +int g_thttpdnsymbols; #endif /**************************************************************************** diff --git a/netutils/thttpd/thttpd.c b/netutils/thttpd/thttpd.c index 5a662fcd9..6fe961c8d 100644 --- a/netutils/thttpd/thttpd.c +++ b/netutils/thttpd/thttpd.c @@ -57,7 +57,6 @@ #include #include -#include #include "netutils/thttpd.h" #include "config.h" diff --git a/netutils/thttpd/thttpd_cgi.c b/netutils/thttpd/thttpd_cgi.c index 38416f860..8387b4213 100644 --- a/netutils/thttpd/thttpd_cgi.c +++ b/netutils/thttpd/thttpd_cgi.c @@ -55,7 +55,6 @@ #include #include -#include #include #include "netutils/thttpd.h" diff --git a/nshlib/nsh_init.c b/nshlib/nsh_init.c index ae05e5bf5..64df54cb2 100644 --- a/nshlib/nsh_init.c +++ b/nshlib/nsh_init.c @@ -135,7 +135,7 @@ void nsh_initialize(void) #if defined(CONFIG_NSH_SYMTAB) /* Make sure that we are using our symbol table */ - symdesc.symtab = (FAR struct symtab_s *)CONFIG_NSH_SYMTAB_ARRAYNAME; /* Discard 'const' */ + symdesc.symtab = CONFIG_NSH_SYMTAB_ARRAYNAME; symdesc.nsymbols = CONFIG_NSH_SYMTAB_COUNTNAME; boardctl(BOARDIOC_APP_SYMTAB, (uintptr_t)&symdesc);