From 590791e12daf3e586e65beed408e560bc252c9ee Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 27 Feb 2017 07:29:46 -0600 Subject: [PATCH] NSH: Eliminate a warning when all memory inspection commands are disabled. --- nshlib/nsh_dbgcmds.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/nshlib/nsh_dbgcmds.c b/nshlib/nsh_dbgcmds.c index 65bbc1ddb..28c90199b 100644 --- a/nshlib/nsh_dbgcmds.c +++ b/nshlib/nsh_dbgcmds.c @@ -1,7 +1,7 @@ /**************************************************************************** * apps/nshlib/dbg_dbgcmds.c * - * Copyright (C) 2008-2009, 2011-2012, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2011-2012, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -57,10 +57,17 @@ * Pre-processor Definitions ****************************************************************************/ +#undef NSH_HAVE_MEMCMDS +#if !defined(CONFIG_NSH_DISABLE_MB) || !defined(CONFIG_NSH_DISABLE_MH) || \ + !defined(CONFIG_NSH_DISABLE_MW) +# define NSH_HAVE_MEMCMDS 1 +#wendif + /**************************************************************************** * Private Types ****************************************************************************/ +#ifdef NSH_HAVE_MEMCMDS struct dbgmem_s { bool dm_write; /* true: perfrom write operation */ @@ -68,18 +75,7 @@ struct dbgmem_s uint32_t dm_value; /* Value to write */ unsigned int dm_count; /* The number of bytes to access */ }; - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ +#endif /**************************************************************************** * Private Functions @@ -89,8 +85,9 @@ struct dbgmem_s * Name: mem_parse ****************************************************************************/ +#ifdef NSH_HAVE_MEMCMDS static int mem_parse(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv, - struct dbgmem_s *mem) + struct dbgmem_s *mem) { char *pcvalue = strchr(argv[1], '='); unsigned long lvalue = 0; @@ -134,6 +131,7 @@ static int mem_parse(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv, return OK; } +#endif /**************************************************************************** * Public Functions