patacongo commented on PR #19555:
URL: https://github.com/apache/nuttx/pull/19555#issuecomment-5626198329

   Michal,
   
   You are right.  I hate becoming old and forgetful.  I hesitate to respond to 
things at all because I make so many errors.
   
   There is an exception in the Coding Standard under 1.4 Braces
   that I forgot about:
   
   Exception to Indentation Rule for Braces. The exception is braces that 
follow structure, enumeration, union, and function declarations. There is no 
additional indentation for those braces; those braces align with the beginning 
of the definition
   
   The examples there are just as those presented earlier in this thread.
   
   The confusion is that the exception is not close to the Indentation section 
in the Coding Standard so it is easy to miss.
   
   It is easy to miss but is at least fairly precisely defined.
   
   Greg
   
   ________________________________
   From: Michal Lenc ***@***.***>
   Sent: Thursday, September 10, 2026 2:24 PM
   To: apache/nuttx ***@***.***>
   Cc: patacongo ***@***.***>; Review requested ***@***.***>
   Subject: Re: [apache/nuttx] tools/nxstyle: fix most of the incompatibilities 
with the coding standard (PR #19555)
   
   [https://avatars.githubusercontent.com/u/68998543?s=20&v=4]michallenc left a 
comment 
(apache/nuttx#19555)<https://github.com/apache/nuttx/pull/19555#issuecomment-5624951432>
   
   the thing is this is not precisely defined in the standard (or I can't find 
it).
   
   Most of global data looks like this:
   
   static const uintptr_t stm32_pfccr_layer_t[DMA2D_NLAYERS] =
   {
     STM32_DMA2D_FGPFCCR,
     STM32_DMA2D_BGPFCCR,
     STM32_DMA2D_OPFCCR
   };
   
   
   most of local data looks like this:
   
     static const int modeflags[] =
     {
       O_RDONLY | O_TEXT,
       O_RDONLY,
       O_RDWR | O_TEXT,
       O_RDWR,
       O_WRONLY | O_CREAT | O_TRUNC | O_TEXT,
       O_WRONLY | O_CREAT | O_TRUNC,
       O_RDWR | O_CREAT | O_TRUNC | O_TEXT,
       O_RDWR | O_CREAT | O_TRUNC,
       O_WRONLY | O_CREAT | O_APPEND | O_TEXT,
       O_WRONLY | O_CREAT | O_APPEND,
       O_RDWR | O_CREAT | O_APPEND | O_TEXT,
       O_RDWR | O_CREAT | O_APPEND,
     };
   
   
   These are stats:
   
   Global:
     - aligned: 9039
     - indented: 65
   
     Local (in function):
     - aligned: 354
     - indented: 295
   
   
   so aligned version (the second one) is more popular. For local data this is 
small difference, but if we want align this with global data, aligned version 
is huge win.
   
   Imho aligned version looks good in global data but is not well arranged in 
local data.
   
   —
   Reply to this email directly, view it on 
GitHub<https://github.com/apache/nuttx/pull/19555?email_source=notifications&email_token=ABFUG6RJ3J54LIN3AIXB72T5OMEY3A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNRSGQ4TKMJUGMZKM4TFMFZW63VQOJSXM2LFO5PXEZLROVSXG5DFMSSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-5624951432>,
 or 
unsubscribe<https://github.com/notifications/unsubscribe-auth/ABFUG6TJFWITASCULDRC4GL5OMEY3AVCNFSNUABFKJSXA33TNF2G64TZHMZDEOBRGAZTENZTHNEXG43VMU5TIOJYG4YDAMJZGY22C5QC>.
   Triage notifications, keep track of coding agent tasks and review pull 
requests on the go with GitHub Mobile for 
iOS<https://github.com/notifications/mobile/ios/ABFUG6R4352MZGU2HNZPP4T5OMEY3A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNRSGQ4TKMJUGMZKM4TFMFZW63VQOJSXM2LFO5PXEZLROVSXG5DFMSSWK5TFNZ2KUZTPN52GK4S7NFXXG>
 and 
Android<https://github.com/notifications/mobile/android/ABFUG6RVWTGC52MBJ6O2AMT5OMEY3A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNRSGQ4TKMJUGMZKM4TFMFZW63VQOJSXM2LFO5PXEZLROVSXG5DFMSSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
 Download it today!
   You are receiving this because your review was requested.Message ID: 
***@***.***>
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to