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 2020/03/12 20:25:02 UTC

[GitHub] [incubator-nuttx] johannes-nivus opened a new pull request #559: Nxstyle

johannes-nivus opened a new pull request #559: Nxstyle
URL: https://github.com/apache/incubator-nuttx/pull/559
 
 
   This change addresses cases like #553 .
   ```
     struct
     {
       const char *pathname;
       long mode;
       size_t len;
     } open = {
       .pathname = pathname,
       .mode = host_flags_to_mode(flags),
       .len = strlen(pathname),
     };
   ```
   And as side effect it relaxes brace rules inside data declarations and assignments.
   
   ```
     const struct clock_configuration_s g_initial_clkconfig =
     {
       .scg =
       {
         .sirc =
         {
           .range       = SCG_SIRC_RANGE_HIGH,              /* RANGE - High range (8 MHz) */
           .div1        = SCG_ASYNC_CLOCK_DIV_BY_1,         /* SIRCDIV1 */
         },
         .firc =
         {
           .range       = SCG_FIRC_RANGE_48M,               /* RANGE */
           .div1        = SCG_ASYNC_CLOCK_DIV_BY_1,         /* FIRCDIV1 */
         }
       }
     };
   ```
   This is only relevant for architecture specific directories, but since we don't distinguish it shouldn't throw errors.
   
   I'm open for discussion.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] patacongo commented on a change in pull request #559: Nxstyle

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #559: Nxstyle
URL: https://github.com/apache/incubator-nuttx/pull/559#discussion_r392193665
 
 

 ##########
 File path: tools/nxstyle.c
 ##########
 @@ -967,8 +968,8 @@ int main(int argc, char **argv, char **envp)
 
                   rhcomment = -1;
 
-                  if (ncomment > 0 && (!strncmp(&line[ii], "if", 2)
-                      || !strncmp(&line[ii], "el", 2)))
+                  if (ncomment > 0 && (strncmp(&line[ii], "if", 2) == 0
+                      || strncmp(&line[ii], "el", 2) == 0))
 
 Review comment:
   In all other places in nxstyle.c, the conditional is broken with the || at the end of the preceding line, not at the beginning of the following line, I don't think this is addressed by the coding standard, but it would be nice to be consistent within the documents.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] patacongo commented on a change in pull request #559: Nxstyle

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #559: Nxstyle
URL: https://github.com/apache/incubator-nuttx/pull/559#discussion_r392200980
 
 

 ##########
 File path: tools/nxstyle.c
 ##########
 @@ -1974,7 +1982,7 @@ int main(int argc, char **argv, char **envp)
 
                 case '/':
 
-                  /* C comment terminator */
+                  /* C comment terminator*/
 
 Review comment:
   Ooops.. now I see a missing space before the comment terminator.  Ironic in this case.  nxstyle will probably complain about itself.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] patacongo commented on a change in pull request #559: Nxstyle

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #559: Nxstyle
URL: https://github.com/apache/incubator-nuttx/pull/559#discussion_r392200980
 
 

 ##########
 File path: tools/nxstyle.c
 ##########
 @@ -1974,7 +1982,7 @@ int main(int argc, char **argv, char **envp)
 
                 case '/':
 
-                  /* C comment terminator */
+                  /* C comment terminator*/
 
 Review comment:
   Ooops.. now I see a missing space before the comment terminator.  Ironic in this case.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on issue #559: Nxstyle

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on issue #559: Nxstyle
URL: https://github.com/apache/incubator-nuttx/pull/559#issuecomment-598557242
 
 
   > Edit: I forgot to rebase, now there are already pulled commits again in the PR. Should I cancel and resubmit?
   > I'm still a git newbie.
   
   If you want to re-organize the patchset(merge/reoder), you can refine the patch locally:
   https://thoughtbot.com/blog/git-interactive-rebase-squash-amend-rewriting-history
   and update PR again:
   git push -f ...
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] johannes-nivus edited a comment on issue #559: Nxstyle

Posted by GitBox <gi...@apache.org>.
johannes-nivus edited a comment on issue #559: Nxstyle
URL: https://github.com/apache/incubator-nuttx/pull/559#issuecomment-598666158
 
 
   @patacongo what do you think?
   Please review and merge if ok.
   
   Edit: Sorry @xiaoxiang781216 I forgot to thank you for your help. Rebase and force push helped.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] johannes-nivus commented on issue #559: Nxstyle

Posted by GitBox <gi...@apache.org>.
johannes-nivus commented on issue #559: Nxstyle
URL: https://github.com/apache/incubator-nuttx/pull/559#issuecomment-598666158
 
 
   @patacongo what do you think?
   Please review and merge if ok.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] patacongo commented on issue #559: Nxstyle

Posted by GitBox <gi...@apache.org>.
patacongo commented on issue #559: Nxstyle
URL: https://github.com/apache/incubator-nuttx/pull/559#issuecomment-598704737
 
 
   Hmmm.. nxstyle did not run.  I says it was successful, but didn't do anything.  Something is broken???
   
   We do need to fix the deleted space at line 1977

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] patacongo merged pull request #559: Nxstyle

Posted by GitBox <gi...@apache.org>.
patacongo merged pull request #559: Nxstyle
URL: https://github.com/apache/incubator-nuttx/pull/559
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] johannes-nivus commented on issue #559: Nxstyle

Posted by GitBox <gi...@apache.org>.
johannes-nivus commented on issue #559: Nxstyle
URL: https://github.com/apache/incubator-nuttx/pull/559#issuecomment-598705414
 
 
   This is a regression perhaps of my poor git abilities. I reverted 2 earlier commits by accident.
   Sorry, I check this.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] johannes-nivus edited a comment on issue #559: Nxstyle

Posted by GitBox <gi...@apache.org>.
johannes-nivus edited a comment on issue #559: Nxstyle
URL: https://github.com/apache/incubator-nuttx/pull/559#issuecomment-598705414
 
 
   This is a regression perhaps of my poor git abilities. I reverted 2 earlier commits by accident.
   Sorry, I check this.
   
   Edit: I killed my own PR #543

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services