You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "xiaoxiang781216 (via GitHub)" <gi...@apache.org> on 2023/08/15 18:59:28 UTC
[GitHub] [nuttx-apps] xiaoxiang781216 opened a new pull request, #1970: Use the macros from sys/params.h
xiaoxiang781216 opened a new pull request, #1970:
URL: https://github.com/apache/nuttx-apps/pull/1970
## Summary
- Change all sizeof(arr)/sizeof(arr[0]) to nitems
- Remove the definition of MIN/MAX
## Impact
code refactor only
## Testing
ci
--
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
[GitHub] [nuttx-apps] xiaoxiang781216 commented on a diff in pull request #1970: Use the macros from sys/param.h
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #1970:
URL: https://github.com/apache/nuttx-apps/pull/1970#discussion_r1296640197
##########
examples/webserver/cgi.c:
##########
@@ -80,7 +81,7 @@ static void net_stats(struct httpd_state *pstate, char *ptr)
chunked_http_tx = pstate->ht_chunked;
#endif
- for (i = 0; i < sizeof(g_netstats) / sizeof(net_stats_t); i++)
+ for (i = 0; i < nitems(g_netstats); i++)
Review Comment:
Done
--
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
[GitHub] [nuttx-apps] pkarashchenko merged pull request #1970: Use the macros from sys/param.h
Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko merged PR #1970:
URL: https://github.com/apache/nuttx-apps/pull/1970
--
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
[GitHub] [nuttx-apps] xiaoxiang781216 commented on a diff in pull request #1970: Use the macros from sys/params.h
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #1970:
URL: https://github.com/apache/nuttx-apps/pull/1970#discussion_r1295536065
##########
wireless/iwpan/src/iwpan.c:
##########
@@ -22,6 +22,7 @@
* Included Files
****************************************************************************/
+#include <sys/params.h>
Review Comment:
Done.
--
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
[GitHub] [nuttx-apps] pkarashchenko commented on a diff in pull request #1970: Use the macros from sys/param.h
Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on code in PR #1970:
URL: https://github.com/apache/nuttx-apps/pull/1970#discussion_r1296412797
##########
examples/webserver/cgi.c:
##########
@@ -80,7 +81,7 @@ static void net_stats(struct httpd_state *pstate, char *ptr)
chunked_http_tx = pstate->ht_chunked;
#endif
- for (i = 0; i < sizeof(g_netstats) / sizeof(net_stats_t); i++)
+ for (i = 0; i < nitems(g_netstats); i++)
Review Comment:
This part will not work with `nitems` since here the structure members are iterated and `g_netstats` is not an array.
Let's revert changes in this file
--
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
[GitHub] [nuttx-apps] pkarashchenko commented on a diff in pull request #1970: Use the macros from sys/params.h
Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on code in PR #1970:
URL: https://github.com/apache/nuttx-apps/pull/1970#discussion_r1295447442
##########
wireless/iwpan/src/iwpan.c:
##########
@@ -22,6 +22,7 @@
* Included Files
****************************************************************************/
+#include <sys/params.h>
Review Comment:
```suggestion
#include <sys/param.h>
```
In all similar places from this PR
--
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