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/10/16 19:46:59 UTC

[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a diff in pull request #1353: Remove the unnecessary cast for main_t, NULL and argv

pkarashchenko commented on code in PR #1353:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1353#discussion_r996485995


##########
graphics/pdcurs34/pdcurses/pdc_terminfo.c:
##########
@@ -244,15 +244,15 @@ char *tigetstr(const char *capname)
 {
   PDC_LOG(("tigetstr() - called: capname %s\n", capname));
 
-  return (char *)(-1);
+  return (-1);

Review Comment:
   why cast is removed here? Isn't compiler warning produced?



##########
graphics/nxwidgets/UnitTests/CGlyphButton/cglyphbuttontest.cxx:
##########
@@ -136,7 +136,7 @@ bool CGlyphButtonTest::createWindow(void)
 {
   // Initialize the widget control using the default style
 
-  m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL);
+  m_widgetControl = new CWidgetControlNULL);

Review Comment:
   ```suggestion
     m_widgetControl = new CWidgetControl(NULL);
   ```



##########
graphics/nxwidgets/UnitTests/CCheckBox/ccheckboxtest.cxx:
##########
@@ -149,7 +149,7 @@ bool CCheckBoxTest::createWindow(void)
 {
   // Initialize the widget control using the default style
 
-  m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL);
+  m_widgetControl = new CWidgetControlNULL);

Review Comment:
   ```suggestion
     m_widgetControl = new CWidgetControl(NULL);
   ```



##########
netutils/thttpd/libhttpd.c:
##########
@@ -1637,7 +1671,8 @@ static void ls_child(int argc, char **argv)
             {
               oldmax    = maxnames;
               maxnames *= 2;
-              names     = RENEW(names, char, oldmax*(PATH_MAX + 1), maxnames*(PATH_MAX + 1));
+              names     = RENEW(names, char, oldmax*(PATH_MAX + 1),
+                                maxnames*(PATH_MAX + 1));

Review Comment:
   ```suggestion
                 names     = RENEW(names, char, oldmax * (PATH_MAX + 1),
                                   maxnames * (PATH_MAX + 1));
   ```



##########
graphics/nxwidgets/UnitTests/CButton/cbuttontest.cxx:
##########
@@ -64,9 +64,9 @@
 
 CButtonTest::CButtonTest()
 {
-  m_bgWindow = (CBgWindow *)NULL;
-  m_nxFont   = (CNxFont *)NULL;
-  m_text     = (CNxString *)NULL;
+  m_bgWindow = NULL;
+  m_nxFont   = NULL;
+  m_text     = NULL;

Review Comment:
   just for my understanding. a generic question not related to this PR. shouldn't cxx code use `nullptr`?



##########
graphics/nxwidgets/UnitTests/CButton/cbuttontest.cxx:
##########
@@ -154,7 +154,7 @@ bool CButtonTest::createWindow(void)
 {
   // Initialize the widget control using the default style
 
-  m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL);
+  m_widgetControl = new CWidgetControlNULL);

Review Comment:
   ```suggestion
     m_widgetControl = new CWidgetControl(NULL);
   ```



##########
graphics/nxwidgets/UnitTests/CButtonArray/cbuttonarraytest.cxx:
##########
@@ -134,7 +134,7 @@ bool CButtonArrayTest::createWindow(void)
 {
   // Initialize the widget control using the default style
 
-  m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL);
+  m_widgetControl = new CWidgetControlNULL);

Review Comment:
   ```suggestion
     m_widgetControl = new CWidgetControl(NULL);
   ```



-- 
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