You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/05/15 05:36:18 UTC
[incubator-nuttx-apps] 02/02: exmaples: some nxstyle fixes for
module/sotest/thttpd
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git
commit 79e544f0323d1133060aeed306c58b887e75e0eb
Author: liuhaitao <li...@xiaomi.com>
AuthorDate: Fri May 15 11:03:12 2020 +0800
exmaples: some nxstyle fixes for module/sotest/thttpd
Signed-off-by: liuhaitao <li...@xiaomi.com>
---
examples/module/module_main.c | 6 ++++--
examples/sotest/sotest_main.c | 8 ++++++--
examples/thttpd/thttpd_main.c | 25 +++++++++++++++----------
3 files changed, 25 insertions(+), 14 deletions(-)
diff --git a/examples/module/module_main.c b/examples/module/module_main.c
index 1b765ac..405f766 100644
--- a/examples/module/module_main.c
+++ b/examples/module/module_main.c
@@ -122,7 +122,7 @@
* Private data
****************************************************************************/
-static const char g_write_string[] = "Hi there, installed driver\n";
+static const char g_write_string[] = "Hi there installed driver\n";
/****************************************************************************
* Symbols from Auto-Generated Code
@@ -196,7 +196,9 @@ int main(int argc, FAR char *argv[])
NSECTORS(romfs_img_len), SECTORSIZE);
if (ret < 0)
{
- /* This will happen naturally if we registered the ROM disk previously. */
+ /* This will happen naturally if we registered the ROM disk
+ * previously.
+ */
if (ret != -EEXIST)
{
diff --git a/examples/sotest/sotest_main.c b/examples/sotest/sotest_main.c
index acf460b..e1a4b31 100644
--- a/examples/sotest/sotest_main.c
+++ b/examples/sotest/sotest_main.c
@@ -145,7 +145,9 @@ int main(int argc, FAR char *argv[])
NSECTORS(romfs_img_len), SECTORSIZE);
if (ret < 0)
{
- /* This will happen naturally if we registered the ROM disk previously. */
+ /* This will happen naturally if we registered the ROM disk
+ * previously.
+ */
if (ret != -EEXIST)
{
@@ -257,7 +259,9 @@ int main(int argc, FAR char *argv[])
testfunc(msg);
#if CONFIG_MODLIB_MAXDEPEND > 0
- /* This should fail because the second shared library depends on the first. */
+ /* This should fail because the second shared library depends on
+ * the first.
+ */
ret = dlclose(handle1);
if (ret == 0)
diff --git a/examples/thttpd/thttpd_main.c b/examples/thttpd/thttpd_main.c
index 25e720e..5812c0c 100644
--- a/examples/thttpd/thttpd_main.c
+++ b/examples/thttpd/thttpd_main.c
@@ -110,13 +110,13 @@
/* Ethernet specific configuration */
#ifdef CONFIG_NET_ETHERNET
- /* Use the standard Ethernet device name */
+/* Use the standard Ethernet device name */
# define NET_DEVNAME "eth0"
#else
- /* No Ethernet -> No MAC address operations */
+/* No Ethernet -> No MAC address operations */
# undef CONFIG_EXAMPLES_THTTPD_NOMAC
#endif
@@ -125,7 +125,7 @@
#ifdef CONFIG_NET_SLIP
- /* TTY device to use */
+/* TTY device to use */
# ifndef CONFIG_NET_SLIPTTY
# define CONFIG_NET_SLIPTTY "/dev/ttyS1"
@@ -216,7 +216,7 @@ int main(int argc, FAR char *argv[])
}
#endif
-/* Many embedded network interfaces must have a software assigned MAC */
+ /* Many embedded network interfaces must have a software assigned MAC */
#ifdef CONFIG_EXAMPLES_THTTPD_NOMAC
printf("Assigning MAC\n");
@@ -256,7 +256,8 @@ int main(int argc, FAR char *argv[])
printf("Registering romdisk\n");
- ret = romdisk_register(0, (uint8_t*)romfs_img, NSECTORS(romfs_img_len), SECTORSIZE);
+ ret = romdisk_register(0, (uint8_t *)romfs_img, NSECTORS(romfs_img_len),
+ SECTORSIZE);
if (ret < 0)
{
printf("ERROR: romdisk_register failed: %d\n", ret);
@@ -283,22 +284,26 @@ int main(int argc, FAR char *argv[])
ret = mount(NULL, BINFS_MOUNTPT, "binfs", MS_RDONLY, NULL);
if (ret < 0)
{
- printf("ERROR: mount(NULL,%s,binfs) failed: %d\n", BINFS_MOUNTPT, errno);
+ printf("ERROR: mount(NULL,%s,binfs) failed: %d\n",
+ BINFS_MOUNTPT, errno);
}
/* Now create and mount the union file system */
printf("Creating UNIONFS filesystem at %s\n", UNIONFS_MOUNTPT);
- ret = unionfs_mount(ROMFS_MOUNTPT, ROMFS_PREFIX, BINFS_MOUNTPT, BINFS_PREFIX,
- UNIONFS_MOUNTPT);
+ ret = unionfs_mount(ROMFS_MOUNTPT, ROMFS_PREFIX, BINFS_MOUNTPT,
+ BINFS_PREFIX, UNIONFS_MOUNTPT);
if (ret < 0)
{
- printf("ERROR: Failed to create the union file system at %s: %d\n", UNIONFS_MOUNTPT, ret);
+ printf("ERROR: Failed to create the union file system at %s: %d\n",
+ UNIONFS_MOUNTPT, ret);
}
#endif
- /* Start THTTPD. At present, symbol table info is passed via global variables */
+ /* Start THTTPD. At present, symbol table info is passed via
+ * global variables.
+ */
#ifdef CONFIG_THTTPD_NXFLAT
g_thttpdsymtab = g_thttpd_exports;