You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/03/08 10:20:01 UTC
[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a change in pull request #1053: apps: update licenses to Apache
pkarashchenko commented on a change in pull request #1053:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1053#discussion_r821514749
##########
File path: examples/netpkt/netpkt_main.c
##########
@@ -137,8 +122,23 @@ int main(int argc, FAR char *argv[])
int rxc;
uint8_t *buf;
const int buflen = 128;
- const char da[6] = {0xf0, 0xde, 0xf1, 0x02, 0x43, 0x01};
- const char sa[6] = {0x00, 0xe0, 0xde, 0xad, 0xbe, 0xef};
+ const char da[6] = {
+ 0xf0,
+ 0xde,
+ 0xf1,
+ 0x02,
+ 0x43,
+ 0x01
+ };
+
+ const char sa[6] = {
+ 0x00,
+ 0xe0,
+ 0xde,
+ 0xad,
+ 0xbe,
+ 0xef
+ };
Review comment:
```suggestion
const char da[6] =
{
0xf0, 0xde, 0xf1, 0x02, 0x43, 0x01
};
const char sa[6] =
{
0x00, 0xe0, 0xde, 0xad, 0xbe, 0xef
};
```
##########
File path: examples/nxdemo/nxdemo_bkgd.c
##########
@@ -292,7 +278,7 @@ static void nxdemo_demo_1(NXWINDOW hwnd)
center.x = g_nxdemo.xres >> 1;
center.y = g_nxdemo.yres >> 1;
- for (i = 0; i<MIN(g_nxdemo.xres, g_nxdemo.yres)>> 1; i++)
+ for (i = 0; i < MIN(g_nxdemo.xres, g_nxdemo.yres) >> 1; i++)
Review comment:
```suggestion
for (i = 0; i < (MIN(g_nxdemo.xres, g_nxdemo.yres) >> 1); i++)
```
##########
File path: examples/relays/relays_main.c
##########
@@ -125,15 +110,16 @@ int main(int argc, FAR char *argv[])
if (optind == argc - 1)
{
stat = argv[optind];
- set_stat = (!strcmp(stat,"on") || !strcmp(stat,"ON")) ? true : false ;
+ set_stat = (!strcmp(stat, "on") ||
+ !strcmp(stat, "ON")) ? true : false ;
Review comment:
```suggestion
set_stat = (strcmp(stat, "on") == 0 || strcmp(stat, "ON") == 0);
```
##########
File path: netutils/esp8266/esp8266.c
##########
@@ -1014,7 +1000,8 @@ static int lesp_parse_cipxxx_ans_line(const char *ptr, in_addr_t *ip)
* see in:
* https://room-15.github.io/blog/2015/03/26/esp8266-at-command-reference/
* or
- * http://www.espressif.com/sites/default/files/documentation/4a-esp8266_at_instruction_set_en.pdf
+ * http://www.espressif.com/sites/default/files/documentation/
Review comment:
IMO we should keep links as a single line
##########
File path: netutils/esp8266/esp8266.c
##########
@@ -2284,7 +2281,8 @@ 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_connect(int sockfd,
+ FAR const struct sockaddr *addr, socklen_t addrlen)
Review comment:
Minor
```suggestion
int lesp_connect(int sockfd, FAR const struct sockaddr *addr,
socklen_t addrlen)
```
##########
File path: netutils/esp8266/esp8266.c
##########
@@ -2672,8 +2673,10 @@ int lesp_setsockopt(int sockfd, int level, int option,
case SO_RCVTIMEO:
if (value_len == sizeof(struct timeval))
{
- sock->rcv_timeo.tv_sec = ((struct timeval *)(value))->tv_sec;
- sock->rcv_timeo.tv_nsec = ((struct timeval *)(value))->tv_usec;
+ sock->rcv_timeo.tv_sec = ((struct timeval *)
+ (value))->tv_sec;
+ sock->rcv_timeo.tv_nsec = ((struct timeval *)
+ (value))->tv_usec;
Review comment:
Maybe next will satisfy the style
```suggestion
sock->rcv_timeo.tv_sec = ((struct timeval *)value)->tv_sec;
sock->rcv_timeo.tv_nsec = ((struct timeval *)value)->tv_usec;
```
##########
File path: examples/nxdemo/nxdemo_bkgd.c
##########
@@ -350,7 +336,7 @@ static void nxdemo_demo_2(NXWINDOW hwnd)
center.x = g_nxdemo.xres >> 1;
center.y = g_nxdemo.yres >> 1;
- for (i = 0; i<MIN(g_nxdemo.xres, g_nxdemo.yres)>> 1; i++)
+ for (i = 0; i < MIN(g_nxdemo.xres, g_nxdemo.yres) >> 1; i++)
Review comment:
```suggestion
for (i = 0; i < (MIN(g_nxdemo.xres, g_nxdemo.yres) >> 1); i++)
```
##########
File path: netutils/esp8266/esp8266.c
##########
@@ -1843,17 +1837,19 @@ int lesp_set_net(lesp_mode_t mode, in_addr_t ip, in_addr_t mask, in_addr_t gatew
if (ret >= 0)
{
- ret = lesp_ask_ans_ok(lespTIMEOUT_MS, "AT+CIP%s_CUR=\"%d.%d.%d.%d\","
+ ret = lesp_ask_ans_ok(LESP_TIMEOUT_MS, "AT+CIP%s_CUR=\"%d.%d.%d.%d\","
"\"%d.%d.%d.%d\",\"%d.%d.%d.%d\"\r\n",
- (mode == lesp_eMODE_STATION)?"STA":"AP",
+ (mode == LESP_MODE_STATION)?"STA":"AP",
Review comment:
```suggestion
(mode == LESP_MODE_STATION) ? "STA" : "AP",
```
##########
File path: examples/lvgldemo/tp_cal.h
##########
@@ -62,7 +47,7 @@ extern "C"
void tp_cal_create(void);
#ifdef __cplusplus
-} /* extern "C" */
-#endif
+}
+#endif /* extern "C" */
Review comment:
```suggestion
#endif
```
as there is no such comment in other files
##########
File path: netutils/esp8266/esp8266.c
##########
@@ -2339,10 +2337,11 @@ int lesp_connect(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen)
if (ret >= 0)
{
- ret = lesp_ask_ans_ok(lespTIMEOUT_MS, "AT+CIPSTART=%d,\"%s\","
+ ret = lesp_ask_ans_ok(LESP_TIMEOUT_MS, "AT+CIPSTART=%d,\"%s\","
"\"%d.%d.%d.%d\",%d\r\n", sockfd, proto_str,
*((uint8_t *)&(ip)+0), *((uint8_t *)&(ip)+1),
- *((uint8_t *)&(ip)+2), *((uint8_t *)&(ip)+3), port);
+ *((uint8_t *)&(ip)+2), *((uint8_t *)&(ip)+3),
Review comment:
```suggestion
*((uint8_t *)&ip + 2), *((uint8_t *)&ip + 3),
```
##########
File path: netutils/esp8266/esp8266.c
##########
@@ -2339,10 +2337,11 @@ int lesp_connect(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen)
if (ret >= 0)
{
- ret = lesp_ask_ans_ok(lespTIMEOUT_MS, "AT+CIPSTART=%d,\"%s\","
+ ret = lesp_ask_ans_ok(LESP_TIMEOUT_MS, "AT+CIPSTART=%d,\"%s\","
"\"%d.%d.%d.%d\",%d\r\n", sockfd, proto_str,
*((uint8_t *)&(ip)+0), *((uint8_t *)&(ip)+1),
Review comment:
```suggestion
*((uint8_t *)&ip + 0), *((uint8_t *)&ip + 1),
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org