Skip to content

Commit

Permalink
Fix some style issues
Browse files Browse the repository at this point in the history
Modified files:
- examples/pdcurses/xmas_main.c
- examples/system/system_main.c
- examples/touchscreen/tc.h
- fsutils/flash_eraseall/flash_eraseall.c
- fsutils/passwd/passwd_append.c
- fsutils/passwd/passwd_delete.c
- fsutils/passwd/passwd_lock.c
- graphics/pdcurs34/include/term.h
- graphics/pdcurs34/pdcurses/pdc_keyname.c
- graphics/pdcurs34/pdcurses/pdc_touch.c
- graphics/tiff/tiff_internal.h
- include/canutils/obd.h
- include/industry/abnt_codi.h
- netutils/chat/chat.h
- netutils/netlib/netlib_ipv4addrconv.c
- netutils/pppd/ahdlc.c
- netutils/pppd/ahdlc.h
- netutils/pppd/pap.h
- netutils/webserver/httpd.h
- netutils/webserver/httpd_fs.c

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
  • Loading branch information
no1wudi committed Jul 27, 2024
1 parent 00e77de commit 6734983
Show file tree
Hide file tree
Showing 20 changed files with 46 additions and 32 deletions.
4 changes: 2 additions & 2 deletions examples/pdcurses/xmas_main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************
* apps/examples/pdcurses/tui.c
* apps/examples/pdcurses/xams_main.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -53,7 +53,6 @@
#define SHOW(win, pause) mvwin(win, y_pos, x_pos); wrefresh(win); \
wrefresh(w_del_msg); napms(pause)


/****************************************************************************
* Private Function Prototypes
****************************************************************************/
Expand Down Expand Up @@ -849,6 +848,7 @@ int main(int argc, FAR char *argv[])
strng5();

/* set up the windows for our blinking trees */

/* treescrn3 */

overlay(treescrn, treescrn3);
Expand Down
6 changes: 5 additions & 1 deletion examples/system/system_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
#include <stdlib.h>

/****************************************************************************
* Name: system_main
* Public Functions
****************************************************************************/

/****************************************************************************
* Name: main
****************************************************************************/

int main(int argc, FAR char *argv[])
Expand Down
2 changes: 2 additions & 0 deletions examples/touchscreen/tc.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/

/* Configuration ************************************************************/

/* CONFIG_EXAMPLES_TOUCHSCREEN_MINOR - The minor device number. Minor=N
* corresponds to touchscreen device /dev/input0. Note this value must
* with CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH. Default 0.
Expand Down
3 changes: 2 additions & 1 deletion fsutils/flash_eraseall/flash_eraseall.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ int flash_eraseall(FAR const char *driver)
if (ret < 0)
{
errcode = errno;
ferr("ERROR: MTD ioctl(%04x) failed: %d\n", MTDIOC_BULKERASE, errcode);
ferr("ERROR: MTD ioctl(%04x) failed: %d\n",
MTDIOC_BULKERASE, errcode);
ret = -errcode;
}

Expand Down
4 changes: 2 additions & 2 deletions fsutils/passwd/passwd_append.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ int passwd_append(FAR const char *username, FAR const char *password)

stream = fopen(CONFIG_FSUTILS_PASSWD_PATH, "a");
if (stream == NULL)
{
{
int errcode = errno;
DEBUGASSERT(errcode > 0);
return errcode;
}
}

/* The format of the password file is:
*
Expand Down
8 changes: 4 additions & 4 deletions fsutils/passwd/passwd_delete.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ static int passwd_copyfile(FAR char *iobuffer, FILE *instream,
{
/* End of file encountered.
*
* This occurs normally when copying to the end-of-the file.
* In that case, the caller just sticks a huge number in for
* copysize and lets the end-of-file indication terminate the
* copy.
* This occurs normally when copying to the end-of-the
* file. In that case, the caller just sticks a huge number
* in for copysize and lets the end-of-file indication
* terminate the copy.
*/

eof = true;
Expand Down
1 change: 1 addition & 0 deletions fsutils/passwd/passwd_lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ static sem_t g_passwd_sem = SEM_INITIALIZER(1);
/****************************************************************************
* Public Functions
****************************************************************************/

/****************************************************************************
* Name: passwd_lock
*
Expand Down
2 changes: 1 addition & 1 deletion graphics/pdcurs34/include/term.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************
* apps/graphics/pdcurses/term.h
* apps/graphics/pdcurs34/include/term.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down
2 changes: 1 addition & 1 deletion graphics/pdcurs34/pdcurses/pdc_keyname.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************
* apps/graphics/pdcurses/pdc_keyname.c
* apps/graphics/pdcurs34/pdcurses/pdc_keyname.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down
2 changes: 1 addition & 1 deletion graphics/pdcurs34/pdcurses/pdc_touch.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************
* apps/graphics/pdcurses/pdc_touch.c
* apps/graphics/pdcurs34/pdcurses/pdc_touch.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down
2 changes: 1 addition & 1 deletion graphics/tiff/tiff_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ extern "C"
#endif

/****************************************************************************
* Public Functions
* Public Function Prototypes
****************************************************************************/

/****************************************************************************
Expand Down
6 changes: 3 additions & 3 deletions include/canutils/obd.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ int obd_send_request(FAR struct obd_dev_s *dev, uint8_t opmode, uint8_t pid);
* Wait for a message from ECUs with requested PID that was sent using
* obd_send_request().
*
* It will return an error case it doesn't receive the msg after the elapsed
* "timeout" time.
* It will return an error case it doesn't receive the msg after the
* elapsed "timeout" time.
*
****************************************************************************/

Expand All @@ -114,4 +114,4 @@ int obd_wait_response(FAR struct obd_dev_s *dev, uint8_t opmode, uint8_t pid,

FAR char *obd_decode_pid(FAR struct obd_dev_s *dev, uint8_t pid);

#endif /*__APPS_INCLUDE_CANUTILS_OBD_H */
#endif /* __APPS_INCLUDE_CANUTILS_OBD_H */
3 changes: 2 additions & 1 deletion include/industry/abnt_codi.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ uint8_t abnt_codi_checksum(FAR const uint8_t *data);

/* Parse a specific ABNT CODI sequence. */

bool abnt_codi_parse(FAR const uint8_t *data, FAR struct abnt_codi_proto_s *proto);
bool abnt_codi_parse(FAR const uint8_t *data,
FAR struct abnt_codi_proto_s *proto);

#ifdef __cplusplus
}
Expand Down
8 changes: 4 additions & 4 deletions netutils/chat/chat.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,23 @@ struct chat_line

/* type-1 chat line expected string */

FAR char* expect;
FAR char *expect;
} lhs;

/* type 0: command argument
* type 1: string to be sent
*/

FAR char* rhs;
FAR struct chat_line* next; /* pointer to the next line in the script */
FAR char *rhs;
FAR struct chat_line *next; /* pointer to the next line in the script */
};

/* Chat private state. */

struct chat
{
struct chat_ctl ctl; /* Embedded 'chat_ctl' type. */
FAR struct chat_line* script; /* first line of the script */
FAR struct chat_line *script; /* first line of the script */
};

#endif /* __APPS_NETUTILS_CHAT_CHAT_H */
6 changes: 3 additions & 3 deletions netutils/netlib/netlib_ipv4addrconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ bool netlib_ipv4addrconv(FAR const char *addrstr, FAR uint8_t *ipaddr)
{
ch = *addrstr++;
if (++j > 4)
{
return false;
}
{
return false;
}

if (ch == '.' || ch == 0)
{
Expand Down
4 changes: 3 additions & 1 deletion netutils/pppd/ahdlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ uint8_t ahdlc_rx(FAR struct ppp_context_s *ctx, uint8_t c)

ctx->ahdlc_flags &= ~PPP_ESCAPED;

/* If value is 0x7e then silently discard and reset receive packet */
/* If value is 0x7e then silently discard and reset receive
* packet
*/

if (c == 0x7e)
{
Expand Down
4 changes: 2 additions & 2 deletions netutils/pppd/ahdlc.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ void ahdlc_rx_ready(FAR struct ppp_context_s *ctx);

uint8_t ahdlc_rx(FAR struct ppp_context_s *ctx, uint8_t);
uint8_t ahdlc_tx(FAR struct ppp_context_s *ctx, uint16_t protocol,
FAR uint8_t *header, FAR uint8_t *buffer, uint16_t headerlen,
uint16_t datalen);
FAR uint8_t *header, FAR uint8_t *buffer,
uint16_t headerlen, uint16_t datalen);

#undef EXTERN
#ifdef __cplusplus
Expand Down
1 change: 1 addition & 0 deletions netutils/pppd/pap.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
****************************************************************************/

/* PAP state machine flags */

/* Client only */

#define PAP_TX_UP 0x01
Expand Down
2 changes: 1 addition & 1 deletion netutils/webserver/httpd.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
* Public Function Prototypes
****************************************************************************/

/* 'file' must be allocated by caller and will be filled in by the function. */
/* 'file' must be allocated by caller and will be filled in by the function */

#if defined(CONFIG_NETUTILS_HTTPD_SENDFILE)

Expand Down
8 changes: 5 additions & 3 deletions netutils/webserver/httpd_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
****************************************************************************/

/****************************************************************************
* Included Header Files
* Included Files
****************************************************************************/

#include <stdint.h>
Expand Down Expand Up @@ -69,7 +69,7 @@ static uint8_t httpd_fs_strcmp(const char *str1, const char *str2)
int i;

i = 0;
for (;;)
for (; ; )
{
if (str2[i] == 0 || str1[i] == '\r' || str1[i] == '\n')
{
Expand Down Expand Up @@ -109,6 +109,7 @@ int httpd_fs_open(const char *name, struct httpd_fs_file *file)
#endif
return OK;
}

#ifdef CONFIG_NETUTILS_HTTPDFSSTATS
++i;
#endif
Expand All @@ -122,7 +123,7 @@ void httpd_fs_init(void)
#ifdef CONFIG_NETUTILS_HTTPDFSSTATS
uint16_t i;

count = (uint16_t*)malloc(g_httpd_numfiles * sizeof(uint16_t));
count = (uint16_t *)malloc(g_httpd_numfiles * sizeof(uint16_t));

for (i = 0; i < g_httpd_numfiles; i++)
{
Expand All @@ -146,6 +147,7 @@ uint16_t httpd_fs_count(char *name)
{
return count[i];
}

++i;
}

Expand Down

0 comments on commit 6734983

Please sign in to comment.