From da9433a4c76053754114325f173699b7244c72a0 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 25 Aug 2019 18:37:23 -0600 Subject: [PATCH] Fix another warnings and an error in typing introduced in the previous commit related to BINFS in PROTECTED mode. --- boards/boardctl.c | 4 ++++ include/nuttx/lib/builtin.h | 6 +++--- include/sys/boardctl.h | 9 +++++---- libs/libc/builtin/lib_builtin_forindex.c | 2 +- libs/libc/builtin/lib_builtin_setlist.c | 4 ++-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/boards/boardctl.c b/boards/boardctl.c index 343dc937b8..65b438cdb1 100644 --- a/boards/boardctl.c +++ b/boards/boardctl.c @@ -68,6 +68,10 @@ # include #endif +#if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_FS_BINFS) +# include +#endif + #ifdef CONFIG_LIB_BOARDCTL /**************************************************************************** diff --git a/include/nuttx/lib/builtin.h b/include/nuttx/lib/builtin.h index b0cf6ec093..1c516b1d0c 100644 --- a/include/nuttx/lib/builtin.h +++ b/include/nuttx/lib/builtin.h @@ -98,7 +98,7 @@ extern "C" * application layer. */ -EXTERN FAR struct builtin_s * const *g_builtins; +EXTERN FAR const struct builtin_s *g_builtins; EXTERN int g_builtin_count; #else @@ -142,7 +142,7 @@ EXTERN const int g_builtin_count; #if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_FS_BINFS) && \ defined(__KERNEL__) -void builtin_setlist(FAR struct builtin_s * const *builtins, int count); +void builtin_setlist(FAR const struct builtin_s *builtins, int count); #endif /**************************************************************************** @@ -199,7 +199,7 @@ FAR const char *builtin_getname(int index); * ****************************************************************************/ -FAR struct builtin_s const *builtin_for_index(int index); +FAR const struct builtin_s *builtin_for_index(int index); #undef EXTERN #if defined(__cplusplus) diff --git a/include/sys/boardctl.h b/include/sys/boardctl.h index 230ab0bec2..33bcd49bcd 100644 --- a/include/sys/boardctl.h +++ b/include/sys/boardctl.h @@ -58,6 +58,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Common commands * * CMD: BOARDIOC_INIT @@ -223,7 +224,7 @@ struct boardioc_symtab_s struct builtin_s; /* Forward reference */ struct boardioc_builtin_s { - FAR char * const *builtins; + FAR const struct builtin_s *builtins; int count; }; #endif @@ -235,9 +236,9 @@ struct boardioc_builtin_s * * enum boardioc_usbdev_identifier_e: Identifies the USB device class. * In the case of multiple instances of the USB device class, the - * specific instance is identifed by the 'inst' field of the structure. + * specific instance is identified by the 'inst' field of the structure. * - * enum boardioc_usbdev_action_e: Identifies the action to peform on + * enum boardioc_usbdev_action_e: Identifies the action to perform on * the USB device class instance. * * struct boardioc_usbdev_ctrl_s: @@ -305,7 +306,7 @@ enum boardioc_termtype_e { BOARDIOC_XTERM_RAW = 0, /* Raw NX terminal window */ BOARDIOC_XTERM_FRAMED, /* Framed NxTK terminal window */ - BOARDIOC_XTERM_TOOLBAR /* Tooolbar of framed NxTK terminal window */ + BOARDIOC_XTERM_TOOLBAR /* Toolbar of framed NxTK terminal window */ }; struct boardioc_nxterm_create_s diff --git a/libs/libc/builtin/lib_builtin_forindex.c b/libs/libc/builtin/lib_builtin_forindex.c index 1b80405239..80409ca903 100644 --- a/libs/libc/builtin/lib_builtin_forindex.c +++ b/libs/libc/builtin/lib_builtin_forindex.c @@ -49,7 +49,7 @@ * Public Functions ****************************************************************************/ -FAR struct builtin_s const *builtin_for_index(int index) +FAR const struct builtin_s *builtin_for_index(int index) { if (index < g_builtin_count) { diff --git a/libs/libc/builtin/lib_builtin_setlist.c b/libs/libc/builtin/lib_builtin_setlist.c index eb1944ee7d..63577650be 100644 --- a/libs/libc/builtin/lib_builtin_setlist.c +++ b/libs/libc/builtin/lib_builtin_setlist.c @@ -55,7 +55,7 @@ * Public Functions ****************************************************************************/ -FAR struct builtin_s * const *g_builtins; +FAR const struct builtin_s *g_builtins; int g_builtin_count; /**************************************************************************** @@ -87,7 +87,7 @@ int g_builtin_count; * ****************************************************************************/ -void builtin_setlist(FAR struct builtin_s * const *builtins, int count) +void builtin_setlist(FAR const struct builtin_s *builtins, int count) { g_builtins = builtins; g_builtin_count = count;