This is an automated email from the ASF dual-hosted git repository.
davids5 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new d9c1c5b Include assert.h in necessary place
d9c1c5b is described below
commit d9c1c5bbc821bde4249853a48b2d85a03cac2e0b
Author: Xiang Xiao <[email protected]>
AuthorDate: Wed Jun 9 02:05:01 2021 +0800
Include assert.h in necessary place
Signed-off-by: Xiang Xiao <[email protected]>
---
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 e07f614..2d5e492 100644
--- a/examples/esp32_himem/esp32_himem_main.c
+++ b/examples/esp32_himem/esp32_himem_main.c
@@ -27,6 +27,7 @@
#include <fcntl.h>
#include <stdbool.h>
#include <stdint.h>
+#include <assert.h>
#include <nuttx/himem/himem.h>
diff --git a/examples/ftpc/ftpc_main.c b/examples/ftpc/ftpc_main.c
index bf15ae5..658367e 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 <[email protected]>
@@ -41,6 +41,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
+#include <assert.h>
#include <errno.h>
#include <sys/types.h>
diff --git a/examples/hidkbd/hidkbd_main.c b/examples/hidkbd/hidkbd_main.c
index 9862b85..e5f2a52 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 <[email protected]>
@@ -42,6 +42,7 @@
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
+#include <assert.h>
#include <errno.h>
#include <nuttx/usb/usbhost.h>
diff --git a/examples/usrsocktest/usrsocktest_main.c
b/examples/usrsocktest/usrsocktest_main.c
index 8813998..2dfd49f 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 <[email protected]>
@@ -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>
diff --git a/netutils/netlib/netlib_getroute.c
b/netutils/netlib/netlib_getroute.c
index 9e66787..9561b67 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 <[email protected]>
@@ -44,6 +44,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
+#include <assert.h>
#include <errno.h>
#include <net/route.h>
diff --git a/nshlib/nsh_stdsession.c b/nshlib/nsh_stdsession.c
index 4f1252b..6121fb6 100644
--- a/nshlib/nsh_stdsession.c
+++ b/nshlib/nsh_stdsession.c
@@ -42,6 +42,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <assert.h>
#ifdef CONFIG_NSH_CLE
# include "system/cle.h"
diff --git a/system/hex2bin/hex2bin_main.c b/system/hex2bin/hex2bin_main.c
index 86e7505..bb9351e 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 <[email protected]>
@@ -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);
diff --git a/system/hex2bin/hex2mem_main.c b/system/hex2bin/hex2mem_main.c
index cbe18cf..2113324 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 <[email protected]>
@@ -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);
}