Include assert.h in necessary place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
eef3e1e009
commit
d9c1c5bbc8
@ -27,6 +27,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <nuttx/himem/himem.h>
|
||||
|
||||
|
@ -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 <gnutt@nuttx.org>
|
||||
@ -41,6 +41,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -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 <gnutt@nuttx.org>
|
||||
@ -42,6 +42,7 @@
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/usb/usbhost.h>
|
||||
|
@ -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 <jussi.kivilinna@haltian.com>
|
||||
@ -44,6 +44,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
|
@ -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 <gnutt@nuttx.org>
|
||||
@ -44,6 +44,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <net/route.h>
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef CONFIG_NSH_CLE
|
||||
# include "system/cle.h"
|
||||
|
@ -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 <gnutt@nuttx.org>
|
||||
@ -42,6 +42,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <hex2bin.h>
|
||||
|
||||
@ -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<hexfile>:\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<binfile>:\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 <start address>\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 <end address>\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 <swap code>\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);
|
||||
|
@ -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 <gnutt@nuttx.org>
|
||||
@ -42,6 +42,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <hex2bin.h>
|
||||
|
||||
@ -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<hexfile>:\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 <start address>\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 <end address>\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 <swap code>\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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user