mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
style: Fix coding style violations in nuttx-apps
Fix various coding style issues including: - Case statement formatting - Include placement and ordering - Whitespace issues - Long line formatting - Bracket alignment Affected modules: - audioutils, examples, include - netutils, system Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
parent
63f61d080a
commit
4e8a0ae4c4
15 changed files with 64 additions and 38 deletions
|
|
@ -66,8 +66,8 @@ static int sigusr2_rcvd = 0;
|
|||
* Name: siguser_action
|
||||
****************************************************************************/
|
||||
|
||||
/* NOTE: it is necessary for functions that are referred to by function pointers
|
||||
* pointer to be declared with global scope (at least for ARM). Otherwise,
|
||||
/* NOTE: it is necessary for functions that are referred to by function
|
||||
* pointers to be declared with global scope (at least for ARM). Otherwise,
|
||||
* a relocation type that is not supported by ELF is generated by GCC.
|
||||
*/
|
||||
|
||||
|
|
@ -225,7 +225,7 @@ int main(int argc, char **argv)
|
|||
|
||||
/* Verify that the handler that was removed was siguser_action */
|
||||
|
||||
if ((void*)act.sa_handler != (void*)siguser_action)
|
||||
if ((void *)act.sa_handler != (void *)siguser_action)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Old SIGUSR2 signal handler (%p) is not siguser_action (%p)\n",
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
const struct struct_dummy_s dummy_struct =
|
||||
{
|
||||
DUMMY_SCALAR_VALUE3
|
||||
DUMMY_SCALAR_VALUE3
|
||||
};
|
||||
|
||||
int dummy_scalar = DUMMY_SCALAR_VALUE2;
|
||||
|
|
|
|||
|
|
@ -97,8 +97,8 @@ int create_ramdisk(void)
|
|||
ret = mkfatfs(g_source, &g_fmt);
|
||||
if (ret < 0)
|
||||
{
|
||||
printf("create_ramdisk: Failed to create FAT filesystem on ramdisk at %s\n",
|
||||
g_source);
|
||||
printf("create_ramdisk: Failed to create FAT filesystem on "
|
||||
"ramdisk at %s\n", g_source);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@
|
|||
* buffering s not yet support for UDP)
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CONFIG_NET
|
||||
# error Network socket support not enabled
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -66,8 +66,8 @@ static int sigusr2_rcvd = 0;
|
|||
* Name: siguser_action
|
||||
****************************************************************************/
|
||||
|
||||
/* NOTE: it is necessary for functions that are referred to by function pointers
|
||||
* pointer to be declared with global scope (at least for ARM). Otherwise,
|
||||
/* NOTE: it is necessary for functions that are referred to by function
|
||||
* pointers to be declared with global scope (at least for ARM). Otherwise,
|
||||
* a relocation type that is not supported by ELF is generated by GCC.
|
||||
*/
|
||||
|
||||
|
|
@ -225,7 +225,7 @@ int main(int argc, char **argv)
|
|||
|
||||
/* Verify that the handler that was removed was siguser_action */
|
||||
|
||||
if ((void*)act.sa_handler != (void*)siguser_action)
|
||||
if ((void *)act.sa_handler != (void *)siguser_action)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Old SIGUSR2 signal handler (%p) is not siguser_action (%p)\n",
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
const struct struct_dummy_s dummy_struct =
|
||||
{
|
||||
DUMMY_SCALAR_VALUE3
|
||||
DUMMY_SCALAR_VALUE3
|
||||
};
|
||||
|
||||
int dummy_scalar = DUMMY_SCALAR_VALUE2;
|
||||
|
|
|
|||
|
|
@ -51,10 +51,14 @@ static void show_usage(FAR const char *progname, FAR FILE *stream,
|
|||
int exit_code)
|
||||
{
|
||||
fprintf(stream, "USAGE:\n");
|
||||
fprintf(stream, "\t%s -uid <uid> - Show user info by ID\n", progname);
|
||||
fprintf(stream, "\t%s -uname <name> - Show user info by name\n", progname);
|
||||
fprintf(stream, "\t%s -gid <gid> - Show group info by ID\n", progname);
|
||||
fprintf(stream, "\t%s -gname <name> - Show group info by name\n", progname);
|
||||
fprintf(stream, "\t%s -uid <uid> - Show user info by ID\n",
|
||||
progname);
|
||||
fprintf(stream, "\t%s -uname <name> - Show user info by name\n",
|
||||
progname);
|
||||
fprintf(stream, "\t%s -gid <gid> - Show group info by ID\n",
|
||||
progname);
|
||||
fprintf(stream, "\t%s -gname <name> - Show group info by name\n",
|
||||
progname);
|
||||
fprintf(stream, "\t%s -h - Show this help info\n", progname);
|
||||
exit(exit_code);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue