From ac61c18fcc9bbd45b112c37d12fe0c787593ad6e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 23 Aug 2019 09:12:20 -0600 Subject: [PATCH] Move apps/builtins/builtin_forindex.c to nuttx/libs/libc/builtin since it is required by kernel logic as well. Other changes account for movement of builtin.h from nuttx/include/nuttx/binfmt/built.h to nuttx/include/lib/builtin.h. --- builtin/Makefile | 2 +- builtin/builtin_forindex.c | 65 ------------------------------- builtin/builtin_list.c | 4 +- examples/chrono/chrono_main.c | 3 -- include/builtin/builtin.h | 2 +- nshlib/nsh_builtin.c | 4 +- nshlib/nsh_command.c | 2 +- system/readline/readline_common.c | 2 +- 8 files changed, 8 insertions(+), 76 deletions(-) delete mode 100644 builtin/builtin_forindex.c diff --git a/builtin/Makefile b/builtin/Makefile index 57dbc2e02..15b99dbe0 100644 --- a/builtin/Makefile +++ b/builtin/Makefile @@ -37,7 +37,7 @@ # Source and object files -CSRCS = builtin_forindex.c builtin_list.c exec_builtin.c +CSRCS = builtin_list.c exec_builtin.c # Registry entry lists diff --git a/builtin/builtin_forindex.c b/builtin/builtin_forindex.c deleted file mode 100644 index ba8b184e7..000000000 --- a/builtin/builtin_forindex.c +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** - * apps/builtin/builtin_forindex.c - * - * Copyright (C) 2011 Uros Platise. All rights reserved. - * Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved. - * Authors: Uros Platise - * Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -extern const struct builtin_s g_builtins[]; -extern const int g_builtin_count; - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -FAR const struct builtin_s *builtin_for_index(int index) -{ - if (index < g_builtin_count) - { - return &g_builtins[index]; - } - - return NULL; -} diff --git a/builtin/builtin_list.c b/builtin/builtin_list.c index a5556bf54..f8122d571 100644 --- a/builtin/builtin_list.c +++ b/builtin/builtin_list.c @@ -2,7 +2,7 @@ * apps/builtin/builtin_list.c * * Copyright (C) 2011 Uros Platise. All rights reserved. - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2019 Gregory Nutt. All rights reserved. * Authors: Uros Platise * Gregory Nutt * @@ -41,7 +41,7 @@ #include -#include +#include /**************************************************************************** * Private Types diff --git a/examples/chrono/chrono_main.c b/examples/chrono/chrono_main.c index 878ea4670..89bacf808 100644 --- a/examples/chrono/chrono_main.c +++ b/examples/chrono/chrono_main.c @@ -121,7 +121,6 @@ static int button_daemon(int argc, char *argv[]) FAR struct slcd_chrono_s *priv = &g_slcd; struct btn_notify_s btnevents; btn_buttonset_t supported; - btn_buttonset_t sample = 0; int ret; int fd; @@ -197,8 +196,6 @@ static int button_daemon(int argc, char *argv[]) goto errout_with_fd; } - sample = (btn_buttonset_t)value.si_value.sival_int; - if (priv->state == CHRONO_STOPPED) { (void)clock_gettime(CLOCK_MONOTONIC, &priv->ts_start); diff --git a/include/builtin/builtin.h b/include/builtin/builtin.h index 96aeb86a7..5b2a94b5a 100644 --- a/include/builtin/builtin.h +++ b/include/builtin/builtin.h @@ -51,7 +51,7 @@ #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/nshlib/nsh_builtin.c b/nshlib/nsh_builtin.c index 7f69753a9..e32838620 100644 --- a/nshlib/nsh_builtin.c +++ b/nshlib/nsh_builtin.c @@ -8,7 +8,7 @@ * * With subsequent updates, modifications, and general maintenance by: * - * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2013, 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -55,7 +55,7 @@ #include #include -#include +#include #include "builtin/builtin.h" #include "nsh.h" diff --git a/nshlib/nsh_command.c b/nshlib/nsh_command.c index cb9061ff4..735c603cf 100644 --- a/nshlib/nsh_command.c +++ b/nshlib/nsh_command.c @@ -42,7 +42,7 @@ #include #ifdef CONFIG_NSH_BUILTIN_APPS -# include +# include #endif #if defined(CONFIG_SYSTEM_READLINE) && defined(CONFIG_READLINE_HAVE_EXTMATCH) diff --git a/system/readline/readline_common.c b/system/readline/readline_common.c index 6d65db6d2..92a98c538 100644 --- a/system/readline/readline_common.c +++ b/system/readline/readline_common.c @@ -48,7 +48,7 @@ #include #include -#include +#include #include "system/readline.h" #include "readline.h"