hujun260 opened a new pull request, #18142:
URL: https://github.com/apache/nuttx/pull/18142

   ### Summary
   
   This pull request fixes macro definition formatting in 
`include/nuttx/trace.h` by consolidating multi-line macro definitions onto 
single lines. The change eliminates unnecessary line continuations and improves 
code consistency while preserving full functionality.
   
   ### Changes Made
   
   **Macro Formatting Fixes:**
   
   1. **trace_printf macro**: Consolidated from 2 lines to 1 line
      - Removes line continuation after parameter list
      - Places implementation on same line as definition
      
   2. **app_trace_printf macro**: Consolidated from 2 lines to 1 line
      - Same formatting improvement
      - Maintains exact functionality
   
   **No functional changes** - all macros behave identically after formatting 
fix.
   
   ### Impact
   
   - **Code Quality**: Improves macro definition consistency
   - **Readability**: Cleaner, more standard macro formatting
   - **No Functional Impact**: 100% identical functionality
   - **Compiler**: No behavioral changes in generated code
   
   ### Files Modified
   
   - `include/nuttx/trace.h` (2 insertions, 4 deletions)
   
   ### Technical Justification
   
   **Why this change?**
   
   1. **Consistency**: Aligns with NuttX macro definition style
   2. **Readability**: Single-line macros are easier to parse visually
   3. **Standards**: Follows common C preprocessor conventions
   4. **Maintenance**: Reduces unnecessary line continuations
   
   **Code Impact Analysis:**
   
   - **Before**: 2-line macro definitions with line continuation
   - **After**: Single-line macro definitions
   - **Generated Code**: Identical (preprocessor produces same output)
   - **Compiled Code**: No change in binary output
   
   ### Testing Procedures
   
   1. **Compilation Tests**:
      - Build with CONFIG_SCHED_INSTRUMENTATION enabled
      - Verify no compiler warnings
      - Confirm macro expansion is identical
   
   2. **Functional Tests**:
      - Run trace-enabled applications
      - Verify trace output is unchanged
      - Test sched_note_printf functionality
   
   3. **Formatting Tests**:
      - Check all trace macros expand correctly
      - Verify parameter passing unchanged
      - Test with different argument types
   
   ### Verification Checklist
   
   - [x] Code builds without warnings or errors
   - [x] No functional changes to macro behavior
   - [x] Preprocessor output identical to original
   - [x] Formatting follows NuttX conventions
   - [x] All trace functionality preserved
   - [x] No impact on trace output
   - [x] Code readability improved
   
   ### Related Files
   
   **Test files that may benefit from this change:**
   - Any code using `trace_printf()` or `app_trace_printf()`
   - Applications with CONFIG_SCHED_INSTRUMENTATION enabled
   
   ### Backward Compatibility
   
   - ✅ 100% backward compatible
   - ✅ No code changes required
   - ✅ Identical runtime behavior
   - ✅ Preprocessor output unchanged
   


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