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 adc3c9fae964049e3c58a26200f563ea9d99a9dd Author: Alin Jerpelea <[email protected]> AuthorDate: Fri Jun 11 11:07:52 2021 +0200 include: nxstyle fixes fixes for nxstyle errors reported by nxstyle tool Signed-off-by: Alin Jerpelea <[email protected]> --- include/builtin/builtin.h | 2 +- include/canutils/canlib.h | 5 +-- include/fsutils/mkfatfs.h | 23 +++++++------- include/fsutils/mksmartfs.h | 6 ++-- include/netutils/curl4nx.h | 3 +- include/netutils/discover.h | 4 +++ include/netutils/esp8266.h | 11 ++++--- include/netutils/ftpd.h | 12 ++++--- include/netutils/telnetc.h | 23 +++++++------- include/netutils/telnetd.h | 5 +-- include/netutils/tftp.h | 2 +- include/netutils/thttpd.h | 2 +- include/netutils/urldecode.h | 8 +++-- include/platform/configdata.h | 3 +- include/system/termcurses.h | 71 +++++++++++++++++++++++------------------- include/system/zmodem.h | 2 ++ include/testing/unity_config.h | 4 +-- 17 files changed, 107 insertions(+), 79 deletions(-) diff --git a/include/builtin/builtin.h b/include/builtin/builtin.h index d39fafa..dd8ff4b 100644 --- a/include/builtin/builtin.h +++ b/include/builtin/builtin.h @@ -53,7 +53,7 @@ extern "C" #endif /**************************************************************************** - * Public Functions + * Public Functions Prototypes ****************************************************************************/ /**************************************************************************** diff --git a/include/canutils/canlib.h b/include/canutils/canlib.h index 3194ca9..75521b2 100644 --- a/include/canutils/canlib.h +++ b/include/canutils/canlib.h @@ -92,8 +92,9 @@ int canlib_getbaud(int fd, FAR int *bauds); * Name: canlib_setloopback * * Description: - * Wrapper for CANIOC_SET_CONNMODES. When loopback mode is enabled, the CAN - * peripheral transmits on the bus, but only receives its own sent messages. + * Wrapper for CANIOC_SET_CONNMODES. + * When loopback mode is enabled, the CAN peripheral transmits on the bus, + * but only receives its own sent messages. * * Input Parameter: * fd - file descriptor of an opened can device diff --git a/include/fsutils/mkfatfs.h b/include/fsutils/mkfatfs.h index 9c96307..09334b9 100644 --- a/include/fsutils/mkfatfs.h +++ b/include/fsutils/mkfatfs.h @@ -67,16 +67,16 @@ struct fat_format_s { - uint8_t ff_nfats; /* Number of FATs */ - uint8_t ff_fattype; /* FAT size: 0 (autoselect), 12, 16, or 32 */ - uint8_t ff_clustshift; /* Log2 of sectors per cluster: 0-5, 0xff (autoselect) */ - uint8_t ff_volumelabel[11]; /* Volume label */ - uint16_t ff_backupboot; /* Sector number of the backup boot sector (0=use default)*/ - uint16_t ff_rootdirentries; /* Number of root directory entries */ - uint16_t ff_rsvdseccount; /* Reserved sectors */ - uint32_t ff_hidsec; /* Count of hidden sectors preceding fat */ - uint32_t ff_volumeid; /* FAT volume id */ - uint32_t ff_nsectors; /* Number of sectors from device to use: 0: Use all */ + uint8_t ff_nfats; /* Number of FATs */ + uint8_t ff_fattype; /* FAT size: 0 (autoselect), 12, 16, or 32 */ + uint8_t ff_clustshift; /* Log2 of sectors per cluster: 0-5, 0xff (autoselect) */ + uint8_t ff_volumelabel[11]; /* Volume label */ + uint16_t ff_backupboot; /* Sector number of the backup boot sector (0=use default) */ + uint16_t ff_rootdirentries; /* Number of root directory entries */ + uint16_t ff_rsvdseccount; /* Reserved sectors */ + uint32_t ff_hidsec; /* Count of hidden sectors preceding fat */ + uint32_t ff_volumeid; /* FAT volume id */ + uint32_t ff_nsectors; /* Number of sectors from device to use: 0: Use all */ }; /**************************************************************************** @@ -109,7 +109,8 @@ extern "C" * fmt - Describes characteristics of the desired filesystem * * Return: - * Zero (OK) on success; -1 (ERROR) on failure with errno set appropriately: + * Zero (OK) on success; + * -1 (ERROR) on failure with errno set appropriately: * * EINVAL - NULL block driver string, bad number of FATS in 'fmt', bad FAT * size in 'fmt', bad cluster size in 'fmt' diff --git a/include/fsutils/mksmartfs.h b/include/fsutils/mksmartfs.h index 0c30dfe..4929598 100644 --- a/include/fsutils/mksmartfs.h +++ b/include/fsutils/mksmartfs.h @@ -52,7 +52,8 @@ extern "C" * pathname - the full path to a registered block driver * * Return: - * Zero (OK) on success; -1 (ERROR) on failure with errno set appropriately: + * Zero (OK) on success; + * -1 (ERROR) on failure with errno set appropriately: * * EINVAL - NULL block driver string * ENOENT - 'pathname' does not refer to anything in the filesystem. @@ -76,7 +77,8 @@ int issmartfs(FAR const char *pathname); * on this device (supports multiple mount points). * * Return: - * Zero (OK) on success; -1 (ERROR) on failure with errno set appropriately: + * Zero (OK) on success; + * -1 (ERROR) on failure with errno set appropriately: * * EINVAL - NULL block driver string * ENOENT - 'pathname' does not refer to anything in the filesystem. diff --git a/include/netutils/curl4nx.h b/include/netutils/curl4nx.h index ed105fb..cb5d25e 100644 --- a/include/netutils/curl4nx.h +++ b/include/netutils/curl4nx.h @@ -255,7 +255,8 @@ int curl4nx_easy_setopt(FAR struct curl4nx_s *handle, int option, /**************************************************************************** * Name: curl4nx_easy_reset() * - * Description: Reset all operations that were set using curl4nx_easy_setopt() + * Description: + * Reset all operations that were set using curl4nx_easy_setopt() * to their default values. * ****************************************************************************/ diff --git a/include/netutils/discover.h b/include/netutils/discover.h index 4b7ef76..535ba81 100644 --- a/include/netutils/discover.h +++ b/include/netutils/discover.h @@ -21,6 +21,10 @@ #ifndef __APPS_INCLUDE_NETUTILS_DISCOVER_H #define __APPS_INCLUDE_NETUTILS_DISCOVER_H +/**************************************************************************** + * Included Files + ****************************************************************************/ + #include <stdint.h> /**************************************************************************** diff --git a/include/netutils/esp8266.h b/include/netutils/esp8266.h index d9e7bc1..c6d2c2c 100644 --- a/include/netutils/esp8266.h +++ b/include/netutils/esp8266.h @@ -64,7 +64,7 @@ typedef enum typedef struct { lesp_security_t security; - char ssid[lespSSID_SIZE+1]; /* +1 for null char */ + char ssid[lespSSID_SIZE + 1]; /* +1 for null char */ uint8_t bssid[lespBSSID_SIZE]; int rssi; int channel; @@ -79,7 +79,8 @@ int lesp_soft_reset(void); const char *lesp_security_to_str(lesp_security_t security); -int lesp_ap_connect(const char *ssid_name, const char *ap_key, int timeout_s); +int lesp_ap_connect(const char *ssid_name, + const char *ap_key, int timeout_s); int lesp_ap_get(lesp_ap_t *ap); int lesp_ap_is_connected(void); @@ -97,8 +98,10 @@ int lesp_list_access_points(lesp_cb_t cb); int lesp_socket(int domain, int type, int protocol); int lesp_closesocket(int sockfd); -int lesp_bind(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen); -int lesp_connect(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen); +int lesp_bind(int sockfd, + FAR const struct sockaddr *addr, socklen_t addrlen); +int lesp_connect(int sockfd, + FAR const struct sockaddr *addr, socklen_t addrlen); int lesp_listen(int sockfd, int backlog); int lesp_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen); ssize_t lesp_send(int sockfd, FAR const uint8_t *buf, size_t len, int flags); diff --git a/include/netutils/ftpd.h b/include/netutils/ftpd.h index 7b9ddd9..91bcb37 100644 --- a/include/netutils/ftpd.h +++ b/include/netutils/ftpd.h @@ -32,7 +32,9 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ + /* Required configuration settings: Of course TCP networking support is * required. But here are a couple that are less obvious: * @@ -104,7 +106,7 @@ extern "C" #endif /**************************************************************************** - * Public Functions + * Public Functions Prototypes ****************************************************************************/ /**************************************************************************** @@ -115,8 +117,8 @@ extern "C" * used to run the server. * * Input Parameters: - * family - The type of INET family to use when opening the socket. AF_INET - * and AF_INET6 are supported. + * family - The type of INET family to use when opening the socket. + * AF_INET and AF_INET6 are supported. * * Returned Value: * On success, a non-NULL handle is returned that can be used to reference @@ -134,8 +136,8 @@ FTPD_SESSION ftpd_open(sa_family_t family); * * Input Parameters: * handle - A handle previously returned by ftpd_open - * accountflags - The characteristics of this user (see FTPD_ACCOUNTFLAGS_* - * definitions above). + * accountflags - The characteristics of this user + * (see FTPD_ACCOUNTFLAGS_* definitions above). * user - The user login name. May be NULL indicating that no login is * required. * passwd - The user password. May be NULL indicating that no password diff --git a/include/netutils/telnetc.h b/include/netutils/telnetc.h index ec1cce5..163efdc 100644 --- a/include/netutils/telnetc.h +++ b/include/netutils/telnetc.h @@ -38,13 +38,13 @@ * SUMMARY: * * libtelnet is a library for handling the TELNET protocol. It includes - * routines for parsing incoming data from a remote peer as well as formatting - * data to send to the remote peer. + * routines for parsing incoming data from a remote peer as well as + * formatting data to send to the remote peer. * * libtelnet uses a callback-oriented API, allowing application-specific - * handling of various events. The callback system is also used for buffering - * outgoing protocol data, allowing the application to maintain control over - * the actual socket connection. + * handling of various events. The callback system is also used for + * buffering outgoing protocol data, allowing the application to maintain + * control over the actual socket connection. * * Features supported include the full TELNET protocol, Q-method option * negotiation, ZMP, MCCP2, MSSP, and NEW-ENVIRON. @@ -62,9 +62,10 @@ * * The author or authors of this code dedicate any and all copyright interest * in this code to the public domain. We make this dedication for the benefit - * of the public at large and to the detriment of our heirs and successors. We - * intend this dedication to be an overt act of relinquishment in perpetuity of - * all present and future rights to this code under copyright law. + * of the public at large and to the detriment of our heirs and successors. + * We intend this dedication to be an overt act of relinquishment in + * perpetuity of all present and future rights to this code under copyright + * law. * * Author: Sean Middleditch <[email protected]> */ @@ -290,7 +291,7 @@ union telnet_event_u /* Subnegotiation event */ - struct + struct { enum telnet_event_type_e _type; /* Alias for type */ const char *buffer; /* Data of sub-negotiation */ @@ -679,8 +680,8 @@ void telnet_newenviron_value(struct telnet_s *telnet, unsigned char type, * Description: * Finish a NEW-ENVIRON command. * - * This must be called after a call to telnet_begin_newenviron() to finish a - * NEW-ENVIRON variable list. + * This must be called after a call to telnet_begin_newenviron() to finish + * a NEW-ENVIRON variable list. * * telnet Telnet state tracker object. * diff --git a/include/netutils/telnetd.h b/include/netutils/telnetd.h index 9de55af..11fb39f 100644 --- a/include/netutils/telnetd.h +++ b/include/netutils/telnetd.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/include/netutils/telnetd.h + * apps/include/netutils/telnetd.h * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -30,6 +30,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* CONFIG_TELNETD_CONSOLE - Use the first Telnet session as the default * console. */ @@ -38,7 +39,7 @@ * Public Types ****************************************************************************/ - /* An instance of the struct telnetd_config_s structure must be passed to +/* An instance of the struct telnetd_config_s structure must be passed to * telnetd_start in order to configure the new Telnet daemon. */ diff --git a/include/netutils/tftp.h b/include/netutils/tftp.h index 5f042ae..ae2eee8 100644 --- a/include/netutils/tftp.h +++ b/include/netutils/tftp.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/include/netutils/tftp.h + * apps/include/netutils/tftp.h * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/include/netutils/thttpd.h b/include/netutils/thttpd.h index 225559a..1f34764 100644 --- a/include/netutils/thttpd.h +++ b/include/netutils/thttpd.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/include/netutils/thttpd.h + * apps/include/netutils/thttpd.h * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/include/netutils/urldecode.h b/include/netutils/urldecode.h index 331e2d8..60b098a 100644 --- a/include/netutils/urldecode.h +++ b/include/netutils/urldecode.h @@ -42,15 +42,17 @@ char *url_decode(char *str); #endif /* CONFIG_CODECS_URLCODE_NEWMEMORY */ #ifdef CONFIG_CODECS_URLCODE -char *urlencode(const char *src, const int src_len, char *dest, int *dest_len); -char *urldecode(const char *src, const int src_len, char *dest, int *dest_len); +char *urlencode(const char *src, const int src_len, + char *dest, int *dest_len); +char *urldecode(const char *src, const int src_len, + char *dest, int *dest_len); int urlencode_len(const char *src, const int src_len); int urldecode_len(const char *src, const int src_len); #endif /* CONFIG_CODECS_URLCODE */ #ifdef CONFIG_CODECS_AVR_URLCODE void urlrawdecode(char *urlbuf); -void urlrawencode(char *str,char *urlbuf); +void urlrawencode(char *str, char *urlbuf); #endif /* CONFIG_CODECS_AVR_URLCODE */ #ifdef __cplusplus diff --git a/include/platform/configdata.h b/include/platform/configdata.h index 2ea783b..98ea14c 100644 --- a/include/platform/configdata.h +++ b/include/platform/configdata.h @@ -38,6 +38,7 @@ /**************************************************************************** * Public Types ****************************************************************************/ + /* This enumeration identifies classes of configuration data */ enum config_data_e @@ -74,7 +75,7 @@ extern "C" #endif /**************************************************************************** - * Public Functions + * Public Functions Prototypes ****************************************************************************/ /**************************************************************************** diff --git a/include/system/termcurses.h b/include/system/termcurses.h index 9f73bca..4169ac0 100644 --- a/include/system/termcurses.h +++ b/include/system/termcurses.h @@ -1,4 +1,4 @@ -/******************************************************************************************** +/**************************************************************************** * apps/include/system/termcurses.h * * Licensed to the Apache Software Foundation (ASF) under one or more @@ -16,22 +16,22 @@ * License for the specific language governing permissions and limitations * under the License. * - ********************************************************************************************/ + ****************************************************************************/ #ifndef __APPS_INCLUDE_SYSTEM_TERMCURSES_H #define __APPS_INCLUDE_SYSTEM_TERMCURSES_H -/******************************************************************************************** +/**************************************************************************** * Included Files - ********************************************************************************************/ + ****************************************************************************/ #include <stdint.h> #include <nuttx/fs/ioctl.h> #include <nuttx/fs/fs.h> -/******************************************************************************************** +/**************************************************************************** * Pre-processor Definitions - ********************************************************************************************/ + ****************************************************************************/ #define TCURS_CLEAR_SCREEN 1 #define TCURS_CLEAR_LINE 2 @@ -56,9 +56,9 @@ #define TCURS_ATTRIB_CURS_HIDE 0x0010 #define TCURS_ATTRIB_CURS_SHOW 0x0020 -/******************************************************************************************** +/**************************************************************************** * Public Type Definitions - ********************************************************************************************/ + ****************************************************************************/ /* Used with TTY ioctls */ @@ -88,7 +88,8 @@ struct termcurses_ops_s /* Get terminal size in row/col dimensions */ - CODE int (*getwinsize)(FAR struct termcurses_s *dev, FAR struct winsize *winsz); + CODE int (*getwinsize)(FAR struct termcurses_s *dev, + FAR struct winsize *winsz); /* Set fg/bg colors */ @@ -97,11 +98,14 @@ struct termcurses_ops_s /* Set display attributes */ - CODE int (*setattrib)(FAR struct termcurses_s *dev, unsigned long attributes); + CODE int (*setattrib)(FAR struct termcurses_s *dev, + unsigned long attributes); /* Get a keycode value */ - CODE int (*getkeycode)(FAR struct termcurses_s *dev, int *specialkey, int *keymodifers); + CODE int (*getkeycode)(FAR struct termcurses_s *dev, + int *specialkey, + int *keymodifers); /* Check for cached keycode value */ @@ -132,9 +136,9 @@ struct termcurses_colors_s uint8_t bg_blue; }; -/******************************************************************************************** +/**************************************************************************** * Public Function Prototypes - ********************************************************************************************/ + ****************************************************************************/ #ifdef __cplusplus #define EXTERN extern "C" @@ -144,87 +148,90 @@ extern "C" #define EXTERN extern #endif -/******************************************************************************************** +/**************************************************************************** * termcurses_initterm: * * Finds a termcurses_s device based on terminal type string and initialize * a new context for device control. * - ********************************************************************************************/ + ****************************************************************************/ int termcurses_initterm(FAR const char *term_type, int in_fd, int out_fd, FAR struct termcurses_s **dev); -/************************************************************************************ +/**************************************************************************** * Name: termcurses_deinitterm * * Description: * Free all space for the termcurses terminal and perform any specific * de-initialization tasks. * - ************************************************************************************/ + ****************************************************************************/ int termcurses_deinitterm(FAR struct termcurses_s *dev); -/************************************************************************************ +/**************************************************************************** * Name: termcurses_moveyx * * Description: * Configure output text to render in the specified fg/bg colors. * - ************************************************************************************/ + ****************************************************************************/ int termcurses_moveyx(FAR struct termcurses_s *term, int row, int col); -/************************************************************************************ +/**************************************************************************** * Name: termcurses_setattribute * * Description: * Configure output text to render in the specified fg/bg colors. * - ************************************************************************************/ + ****************************************************************************/ -int termcurses_setattribute(FAR struct termcurses_s *term, unsigned long attrib); +int termcurses_setattribute(FAR struct termcurses_s *term, + unsigned long attrib); -/************************************************************************************ +/**************************************************************************** * Name: termcurses_setcolors * * Description: * Configure output text to render in the specified fg/bg colors. * - ************************************************************************************/ + ****************************************************************************/ int termcurses_setcolors(FAR struct termcurses_s *term, FAR struct termcurses_colors_s *colors); -/************************************************************************************ +/**************************************************************************** * Name: termcurses_getwinsize * * Description: - * Determines the size of the terminal screen in terms of character rows and cols. + * Determines the size of the terminal screen in terms of character rows + * and cols. * - ************************************************************************************/ + ****************************************************************************/ -int termcurses_getwinsize(FAR struct termcurses_s *term, FAR struct winsize *winsz); +int termcurses_getwinsize(FAR struct termcurses_s *term, + FAR struct winsize *winsz); -/************************************************************************************ +/**************************************************************************** * Name: termcurses_getkeycode * * Description: * Get a translated key code from the terminal input. * - ************************************************************************************/ + ****************************************************************************/ int termcurses_getkeycode(FAR struct termcurses_s *term, FAR int *specialkey, FAR int *keymodifiers); -/************************************************************************************ +/**************************************************************************** * Name: termcurses_checkkey * * Description: * Check if there is a key waiting to be processed. * - ************************************************************************************/ + ****************************************************************************/ bool termcurses_checkkey(FAR struct termcurses_s *term); diff --git a/include/system/zmodem.h b/include/system/zmodem.h index 8d728f9..4066e86 100644 --- a/include/system/zmodem.h +++ b/include/system/zmodem.h @@ -38,6 +38,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ /* The default device used by the Zmodem commands if the -d option is not @@ -166,6 +167,7 @@ /**************************************************************************** * Public Types ****************************************************************************/ + /* Opaque handles returned by initialization functions */ typedef FAR void *ZMHANDLE; diff --git a/include/testing/unity_config.h b/include/testing/unity_config.h index 829e087..4cfe157 100644 --- a/include/testing/unity_config.h +++ b/include/testing/unity_config.h @@ -1,5 +1,5 @@ /**************************************************************************** - * include/testing/unity/unity_config.h + * apps/include/testing/unity_config.h * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -18,7 +18,7 @@ * ****************************************************************************/ -/* See Also: Unity/docs/UnityConfigurationGuide.pdf /* +/* See Also: Unity/docs/UnityConfigurationGuide.pdf */ #ifndef UNITY_CONFIG_H #define UNITY_CONFIG_H
