From d9c1c5bbc821bde4249853a48b2d85a03cac2e0b Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Wed, 9 Jun 2021 02:05:01 +0800 Subject: [PATCH] Include assert.h in necessary place Signed-off-by: Xiang Xiao --- examples/esp32_himem/esp32_himem_main.c | 1 + examples/ftpc/ftpc_main.c | 3 ++- examples/hidkbd/hidkbd_main.c | 3 ++- examples/usrsocktest/usrsocktest_main.c | 3 ++- netutils/netlib/netlib_getroute.c | 3 ++- nshlib/nsh_stdsession.c | 1 + system/hex2bin/hex2bin_main.c | 30 +++++++++++++------------ system/hex2bin/hex2mem_main.c | 28 +++++++++++++---------- 8 files changed, 42 insertions(+), 30 deletions(-) diff --git a/examples/esp32_himem/esp32_himem_main.c b/examples/esp32_himem/esp32_himem_main.c index e07f614f2..2d5e49240 100644 --- a/examples/esp32_himem/esp32_himem_main.c +++ b/examples/esp32_himem/esp32_himem_main.c @@ -27,6 +27,7 @@ #include #include #include +#include #include diff --git a/examples/ftpc/ftpc_main.c b/examples/ftpc/ftpc_main.c index bf15ae567..658367e88 100644 --- a/examples/ftpc/ftpc_main.c +++ b/examples/ftpc/ftpc_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * examples/ftpc/ftpc_main.c + * apps/examples/ftpc/ftpc_main.c * * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -41,6 +41,7 @@ #include #include #include +#include #include #include diff --git a/examples/hidkbd/hidkbd_main.c b/examples/hidkbd/hidkbd_main.c index 9862b8555..e5f2a523b 100644 --- a/examples/hidkbd/hidkbd_main.c +++ b/examples/hidkbd/hidkbd_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * examples/hidkbd/hidkbd_main.c + * apps/examples/hidkbd/hidkbd_main.c * * Copyright (C) 2011, 2013-2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -42,6 +42,7 @@ #include #include #include +#include #include #include diff --git a/examples/usrsocktest/usrsocktest_main.c b/examples/usrsocktest/usrsocktest_main.c index 88139989b..2dfd49f97 100644 --- a/examples/usrsocktest/usrsocktest_main.c +++ b/examples/usrsocktest/usrsocktest_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * examples/usrsocktest/usrsocktest_main.c + * apps/examples/usrsocktest/usrsocktest_main.c * * Copyright (C) 2015, 2017 Haltian Ltd. All rights reserved. * Author: Jussi Kivilinna @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include diff --git a/netutils/netlib/netlib_getroute.c b/netutils/netlib/netlib_getroute.c index 9e66787eb..9561b67fd 100644 --- a/netutils/netlib/netlib_getroute.c +++ b/netutils/netlib/netlib_getroute.c @@ -1,5 +1,5 @@ /**************************************************************************** - * netutils/netlib/netlib_getroute.c + * apps/netutils/netlib/netlib_getroute.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -44,6 +44,7 @@ #include #include #include +#include #include #include diff --git a/nshlib/nsh_stdsession.c b/nshlib/nsh_stdsession.c index 4f1252b05..6121fb62d 100644 --- a/nshlib/nsh_stdsession.c +++ b/nshlib/nsh_stdsession.c @@ -42,6 +42,7 @@ #include #include #include +#include #ifdef CONFIG_NSH_CLE # include "system/cle.h" diff --git a/system/hex2bin/hex2bin_main.c b/system/hex2bin/hex2bin_main.c index 86e750593..bb9351e2e 100644 --- a/system/hex2bin/hex2bin_main.c +++ b/system/hex2bin/hex2bin_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/system/hex2bin_main.c + * apps/system/hex2bin/hex2bin_main.c * * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -65,27 +66,28 @@ static void show_usage(FAR const char *progname, int exitcode) fprintf(stderr, "\t%s -h\n", progname); fprintf(stderr, "Where:\n"); fprintf(stderr, "\t:\n"); - fprintf(stderr, "\t\tThe file containing the Intel HEX data to be converted.\n"); + fprintf(stderr, "\t\tThe file containing the Intel HEX data to be\n"); + fprintf(stderr, "\t\tconverted.\n"); fprintf(stderr, "\t:\n"); - fprintf(stderr, "\t\tThe output file to be created contained the converted\n"); - fprintf(stderr, "\t\tbinary data.\n"); + fprintf(stderr, "\t\tThe output file to be created contained the\n"); + fprintf(stderr, "\t\tconverted binary data.\n"); fprintf(stderr, "\t-h:\n"); fprintf(stderr, "\t\tPrints this message and exits\n"); fprintf(stderr, "And [OPTIONS] include:\n"); fprintf(stderr, "\t-s \n"); - fprintf(stderr, "\t\tSets the start address of the binary output. This value\n"); - fprintf(stderr, "\t\tis used to (1) calculate offsets into the output stream,\n"); - fprintf(stderr, "\t\tand (2) for error checking. Default: 0x%08x\n", - CONFIG_SYSTEM_HEX2BIN_BASEADDR); + fprintf(stderr, "\t\tSets the start address of the binary output. This\n"); + fprintf(stderr, "\t\tvalue is used to (1) calculate offsets into the\n"); + fprintf(stderr, "\t\toutput stream, and (2) for error checking.\n"); + fprintf(stderr, "\t\tDefault: 0x%08x\n", CONFIG_SYSTEM_HEX2BIN_BASEADDR); fprintf(stderr, "\t-e \n"); - fprintf(stderr, "\t\tSets the maximum address (plus 1) of the binary output.\n"); - fprintf(stderr, "\t\tThis value is used to only for error checking. The value\n"); - fprintf(stderr, "\t\tzero disables error checking. Default: 0x%08x\n", - CONFIG_SYSTEM_HEX2BIN_ENDPADDR); + fprintf(stderr, "\t\tSets the maximum address (plus 1) of the binary\n"); + fprintf(stderr, "\t\toutput. This value is used to only for error\n"); + fprintf(stderr, "\t\tchecking. The value zero disables error checking.\n"); + fprintf(stderr, "\t\t Default: 0x%08x\n", CONFIG_SYSTEM_HEX2BIN_ENDPADDR); fprintf(stderr, "\t\tno error checking\n"); fprintf(stderr, "\t-w \n"); - fprintf(stderr, "\t\t(0) No swap, (1) swap bytes in 16-bit values, or (3) swap\n"); - fprintf(stderr, "\t\tbytes in 32-bit values. Default: %d\n", + fprintf(stderr, "\t\t(0) No swap, (1) swap bytes in 16-bit values, or\n"); + fprintf(stderr, "\t\t(3) swap bytes in 32-bit values. Default: %d\n", CONFIG_SYSTEM_HEX2BIN_SWAP); #endif exit(exitcode); diff --git a/system/hex2bin/hex2mem_main.c b/system/hex2bin/hex2mem_main.c index cbe18cf07..2113324c8 100644 --- a/system/hex2bin/hex2mem_main.c +++ b/system/hex2bin/hex2mem_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/system/hex2mem_main.c + * apps/system/hex2bin/hex2mem_main.c * * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -65,22 +66,25 @@ static void show_usage(FAR const char *progname, int exitcode) fprintf(stderr, "\t%s -h\n", progname); fprintf(stderr, "Where:\n"); fprintf(stderr, "\t:\n"); - fprintf(stderr, "\t\tThe file containing the Intel HEX data to be converted.\n"); + fprintf(stderr, "\t\tThe file containing the Intel HEX data to be\n"); + fprintf(stderr, "\t\tconverted.\n"); fprintf(stderr, "\t-h:\n"); fprintf(stderr, "\t\tPrints this message and exits\n"); fprintf(stderr, "And [OPTIONS] include:\n"); fprintf(stderr, "\t-s \n"); - fprintf(stderr, "\t\tSets the start memory address for the binary output. Hex\n"); - fprintf(stderr, "\t\tdata is written to memory relative to this address. Default:\n"); - fprintf(stderr, "\t\t0x%08x\n", CONFIG_SYSTEM_HEX2MEM_BASEADDR); + fprintf(stderr, "\t\tSets the start memory address for the binary\n"); + fprintf(stderr, "\t\toutput. Hex data is written to memory relative\n"); + fprintf(stderr, "\t\tto this address. Default: 0x%08x\n", + CONFIG_SYSTEM_HEX2MEM_BASEADDR); fprintf(stderr, "\t-e \n"); - fprintf(stderr, "\t\tSets the maximum memory address (plus 1). This value is\n"); - fprintf(stderr, "\t\tused to assure that the program does not write past the end\n"); - fprintf(stderr, "\t\tof memory. The value zero disables error checking.\n"); - fprintf(stderr, "\t\tDefault: 0x%08x\n", CONFIG_SYSTEM_HEX2MEM_ENDPADDR); + fprintf(stderr, "\t\tSets the maximum memory address (plus 1). This\n"); + fprintf(stderr, "\t\tvalue is used to assure that the program does not\n"); + fprintf(stderr, "\t\twrite past the end of memory. The value zero\n"); + fprintf(stderr, "\t\tdisables error checking. Default: 0x%08x\n", + CONFIG_SYSTEM_HEX2MEM_ENDPADDR); fprintf(stderr, "\t-w \n"); - fprintf(stderr, "\t\t(0) No swap, (1) swap bytes in 16-bit values, or (3) swap\n"); - fprintf(stderr, "\t\tbytes in 32-bit values. Default: %d\n", + fprintf(stderr, "\t\t(0) No swap, (1) swap bytes in 16-bit values, or\n"); + fprintf(stderr, "\t\t(3) swap bytes in 32-bit values. Default: %d\n", CONFIG_SYSTEM_HEX2MEM_SWAP); #endif exit(exitcode); @@ -194,7 +198,7 @@ int main(int argc, FAR char *argv[]) if (endpaddr <= baseaddr) { - printf("ERROR: Memory end (+1) address must be AFTER memory base address\n"); + printf("ERROR: End (+1) address must be AFTER base address\n"); show_usage(argv[0], EXIT_FAILURE); }